IoT End Devices Karel Slavicek Vaclav Oujezsky 2024 Schedule update ● Next week, 8th of October, the lecture at 10:00 is canceled. ● Lab exercises take place according to schedule. Global remarks ● Overview of available components ● Don’t try to memorize it all ● Key reprezetatives available in the lab ● More components on demand ● Very very brief excursion into electronic design Structure of an IoT System Structure of an IoT System Overview ● HMI ● Input devices ● Displays ● Environmental sensors ● Proximity, positioning and inertial measurements ● Biometric ● Data storage and supportive devices HMI Input Devices ● Pushbuttons and switches ● Capacitive / Inductive touch sensors ● Keyboard ● Rotary encoder Pushbuttons and switches ● Frequently with „negative“ logic: ● Possible utilization of internal pull-up resistors of MCU Keyboard ● Rows and columns ● Set all row pins as Input_Pullup ● Go column by column ● Set column pin output LOW ● Read all row pins Rotary encoder ● Counting pulses ● Clockwise ● Counterclockwise ● Navigation in a list ● Zooming in / out Displays ● LED, RGB LED, LED matrix ● 7-Segment LED ● LCD ● TFT ● OLED ● E-Paper LED, RBG LED ● Current limited by resistor ● Light intensity regulated by PWM (Pulse-Width Modulation) ● Resistor value computation: Ohms law U = R x I LED, RGB LED – Ohms law ● Commonly, the LED can survive up to 20 mA ● 1 – 2 mA should be enough ● R = (U – 2V) / 2mA R = (3.3V – 2V) / 2mA = 650 Ω ● Nearest common value 680 Ω ● Required precision of current set: low RGB LED ● Three LED diodes in one package ● Both common cathode and common anode LED, RBG LED ● Current limited by resistor ● Light intensity regulated by PWM (Pulse-Width Modulation) ● PWM frequency at least 50Hz ● Recommended at least 100Hz ● PWM can be generated in software ● Hardware generated PWM is expected ● Depends on hardware architecture PWM on STM32F103 ● 4 timers ● Each has 4 channels ● Channels of one timer have the same period and phase ● Channels are connected to GPIO PINs ● Timer can use internal or external clock source ● System clock is 8 - 72 MHz PWM on STM32F103 ● Timer has 16-bit counter register and a Prescale register ● One of possible modes of operation is PWM PWM on STM32F103 ● Auto-Reload Register (ARR) determines period of PWM ● Capture Compare Register (CCR) determines the duty cycle PWM on STM32F103 ● PWM Frequency ● PWM Duty Cycle (%) LED Matrix ● Matrix of 8x8 LED diodes ● Stackable modules ● Driver MAX7219 ● Acts as a shift register 7-segment LED display ● 8 LEDS in one package ● Many sizes ● Beware of maximum current ● Both variants – common cathode and common anode ● Limit number of pins → shift register Shift register NeoPixel LED ● 3 LED diodes (RGB) ● 3x8 bit ● Simplified shift register (Data_IN, Data_Out) Fixed timing LCD ● Traditional, might seem to be a bit old-fashioned ● 2x16 or 4x20 characters ● Based on Hitachi HD44780 chip or clones ● 4 or 8 bits for data + 3 control signals ● Commonly used with I2C converter TFT ● Matrix of pixels ● Various sizes (in inches and number of points) ● Commonly with SPI interface ● Many modules equipped with touch screen ● Touchscreen has standalone SPI interface ● Example: ILI9341 ● 2.4“ 240x320 pixels OLED ● Small modules, typically ● 0.91“ (128x32 pixels) ● 0.96“, 1.3“ (128x64 pixels) ● Single color, twocolour a bit tricked ● I2C or SPI interface e-Paper ● E-paper or e-ink ● Can keep the image even if powered off ● Better to blank the screen after couple of days ● Small modules for reasonable price 200x200 points ● Single or dual color ● Suspicious cheap → probably without driver ● SPI interface ● Beware of image size Environmental sensors ● Temperature ● Relative humidity ● Barometric pressure ● Concentration of gasses ● Concentration of dust particles ● Intensity of light Temperature ● Analog – PT100/PT1000, NTC, …. ● Dallas DS18B20 ● NXP LM75 ● TI TMP112 ● Sensirion SHT30, SHT31, SHT35, SHT45, …. ● Infrared termometers and pyrometers ● Part of humidity and/or barometric pressure measurement DS18B20 ● Interface 1-Wire ● Unique ID ● Package TO-92, SOIC-8, or hermeticaly sealed NEXPERIA LM75A ● General purpose chip temperature meters ● Resolution of 0.125 °C ● I2C interface ● Similar devices from TI (LM75A) or Analog Devices (ADT75A) ● SO8 / TSSOP8 / MSOP8 / … package Texas Instruments TMP112 ● Miniature termometers ● SOT563 package (1.2 x 1.6 mm) ● Measurement on PCBs and in electronic devices ● I2C interface ● Alert on treshold (SMBus ALERT function) ● Similar models TMP101, TMP102 ● TMP114 in package Picostar (0.76 x 0.76 mm) ● TMP117 in packge WSON / DSBGA package Sensirion ● Swiss manufacturer of sensors ● SHT series includes humidity sensors ● Similar to TI TMP series ● SHT4x about 1.5x1.5mm 0.4uA ● Used mainly on PCBs ● Interface I2C Infrared sensors ● Contactless measurement ● Industrial, building automation, medical ● Many types and modules ● Output analog, I2C, PWM ● Example: Melexis MLX90614, MLX90615 Barometric pressure and combined sensors ● Robert Bosch GmbH ● One of few chip manufacturers in Europe ● Interface I2C ● BMP180 – just pressure ● BMP280 includes temperature ● BME280 adds humidity Humidity sensors ● DHT-11 / DHT-22 ● Temperature and relative humidity ● Specific serial protocol similar to 1-Wire ● Not compatible with Dallas 1-Wire ● 16 bit relative humidity, 16 bit temperature, 8bit checksum Gas concentration ● Carbon dioxide ● Carbon monoxide ● Combustible gases ● Commonly long pre-heat time ● Frequently analog output Gas concentration ● MQ-7 – Carbon monoxide ● MQ-2 – Combustible gas ● Carbon dioxide MG811 ● Carbon dioxide NIR based ● MH-Z19B – UART/PWM ● SDC30 - UART/I2C/PWM Dust particles ● Sharp GP2Y1010AU0F ● Based on light reflected from dust particles ● Analog output ● Sensirion SEN54-SDN-T ● The same principle ● Interface I2C Light intensity ● A lot of analog devices ● BH1750 ● I2C ● 0 - 65535lux ● Precision and callibration ● VEML7700 (Vishay) ● I2C ● 0 - 120000lux Proximity measurement ● PIR ● Ultrasound ● Lidar PIR - Pyroelectric (passive) InfraRed ● Motion sensor ● Surveillance ● Binary output ● Some delay ● Various angle and reach ● Many types: HC-SR505, HC-SR501, AM312 Ultrasound ● Distance measurement ● Originaly parking sensor in cars ● Many new applications ● Reach about 4 m, resolution 0.5 cm ● Trigger pin sends 8 x 40 kHz pulses ● Echo pin receives reflected signal Ultrasound Ultrasound ● Speed of the sound in air 340m/sec ● Obstacle in distance 1m: ● Time the signal travels from sensor to obstacle = 1/340 s = 2.9 ms ● Signal roundtrip time = 5.8 ms ● Distance in cm = echo pulse width in μs/58 Lidar ● VL53L0X ● I2C interface ● Same principle as ultrasound sensor ● Same reach and precision Doppler radar ● RCWL-0516 ● Movement detection up to ~ 8m ● Competitor to PIR sensors GPS ● Most commonly used module NEO6M / NEO6Mv2 ● Antena on uFL connector ● UART and PPS interface ● Serial text based protocol ● NMEA 0183 Standard For Interfacing Marine Electronic Devices, Version 2.30 GPS Gyroscope + Accelerometer ● Most popular solutions based on InvenSense MPU6050 ● 3-axis gyroscope and accelerometer ● Gyroscope: + 250 500 1000 2000°/s ● Accelerometer: ± 2 ± 4 ± 8 ± 16g ● 16-bit ADC ● Interface I2C ● Alternative MPU6000 – SPI interface Inertial sensor with magnetometer ● InvenSense MPU9250 ● Similar to MPU6050 ● Added magnetometer = electronic compass ● Interface both I2C and SPI ● Position expressed in angle coordinates: yaw, pitch, and roll Angle coordinates Direction cosine method ● It is necessary to align output of sensor to the Earth coordinate system and orient it to north pole Direction cosine matrix ● Offset compensation ● Optionally, Kalman filter for data smoothing ● Euler angles, DCM computation Biometric sensors ● Fingerprint ● Heart rate ● EKG Fingerprint ● Will be part of followup lecture „IoT Security“ ● Commonly, UART interface ● Main manufacturer of simple components is Synochip Heart rate ● Chip Maxim Integrated MAX30100 ● Includes oxymeter ● IR LED: 880nm ● RED LED: 660nm ● Interface I2C ● Low power consumption EKG ● Based on Analog Devices AD8232 ● Analog output ● Software for Arduino available Data Storage ● uSD ● Flash ● EEPROM ● eMMC uSD card reader ● A lot of simple and cheap modules ● Interface SPI ● Filesystem FAT32 ● Software libreries exists, though the FAT is simple enough Flash ● Block organization, no filesystem ● SPI interface ● Larger capacity than EEPROM and smaller than SD cards ● Popular module W25Q32 – 32MBit = 4MByte eMMC ● In some sense successor of uSD ● About the same capacity ● More solid mechanical connection ● Used instead of uSD in several Something-Pi ● Reader in uSD format Unsorted ● RTC ● Converters ● Multiplexers ● ADC ● NFC card reader RTC ● With few exceptions, MCUs used in IoT don’t have real time clock ● Several external RTC exist ● Battery keeping the time ● Interrupt sometimes on exotic voltage level → additional electronics needed to wake-up MCU ● I2C interface ● PCF8563, DS3231 Thank you for your atttention! Questions and comments?