iot essentials guide · 6 example, companies often provide or publish c++ source and header files...
TRANSCRIPT
IoT Essentials Guide
Internet of Things (IoT) and the Smart Home are device concepts that have been steadily gainingpopularity with consumer companies. The idea is simple—connect devices, especially home appliancesor systems, to the Internet to make them “smarter” or easier to use. Our IoT Essentials Guide will help youchoose the right components you need to build your very own IoT smart-home projects from scratch!We are not limited to just finding and buying smart home products—why not make them ourselves?
The topics covered in our IoT Essentials Guide:
●• Microcontroller and basic computer options for your IoT projects●• Overview of various types of sensors and how to implement them in IoT projects●• List of Do-It-Yourself IoT project ideas●• Networking and internet connection board options
You will also have the opportunity to enter to win FREE sample sensor kit! You won’t want to miss this!
Presented by Rohm
2
THE ESSENTIALS FOR ANY DIY IOT PROJECT!
This is a comprehensive guide of all the essentials for making your IoT projects! The guide will describesensors, microcontrollers, and internet connection boards, and will provide some examples of DIY IoTprojects around the home for you to start building!
________________________________________
Microcontroller/Computer:
●• The “brain” of any IoT project●• Users define the functionality of their IoT projects by programming these control boards to repeatedly run a series of routines.●• The routines are generally comprised of three parts (examples of these operations are italicized)● – Acquire Data - check the brightness outside from sunlight● – Process Data - compare the level of brightness to a threshold level● – Trigger resulting events - if the brightness outside is above some threshold, open the blinds
The Essentials for any DIY IoT Project! This is a comprehensive guide of all the essentials for making your IoT projects! The guide will describe sensors, microcontrollers, and internet connection boards, and will provide some examples of DIY IoT projects around the home for you to start building!
Microcontroller/Computer:
● The “brain” of any IoT project ● Users define the functionality of their IoT projects by programming these control boards to repeatedly run a series of routines. ● The routines are generally comprised of three parts (examples of these operations are italicized)
○ Acquire Data - check the brightness outside from sunlight ○ Process Data - compare the level of brightness to a threshold level ○ Trigger resulting events - if the brightness outside is above some threshold, open the blinds
Microcontroller
● A small processor that runs some routines repeatedly, but is limited in capability
● Cannot store files to media drives without some additional hardware, for example
● Some common microcontrollers are the Arduino and spin-offs like the NetDuino
Computer
● A processor capable of performing regular computer functions at a smaller scale
● Generally more powerful than a microcontroller and useful for applications that require a large amount of processing
● Often harder to implement than microcontroller solutions
● Some common small-scale computers are the Raspberry Pi and the BeagleBone
3
Arduino
Microcontroller Chip ATmega328P
Operating Voltage 5V
Power Supply 7-12V
Digital I/O Pins 14 (6 also provide PWM)
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin
50 mA
Flash Memory 32 KB (ATmega328P)
of which 0.5 KB used by bootloader
Clock Speed 16 MHz
Dimensions 68.6 mm X 53.4mm
Raspberry Pi
SoC
Broadcom BCM2837
CPU 4× ARM Cortex-A53, 1.2GHz
GPU Broadcom VideoCore IV RAM: 1GB LPDDR2 (900 MHz)
Networking 10/100 Ethernet, 2.4GHz 802.11n wireless
Bluetooth
Bluetooth 4.1 Classic, Bluetooth Low Energy
Storage
microSD
GPIO
40-pin header
Ports HDMI, 3.5mm analogue audio-video jack, 4× USB 2.0, Ethernet, Camera Serial Interface (CSI), Display Serial Interface (DSI)
4
Netduino
Microcontroller Chip AT91SAM7X512
GPIO Operating Voltage
3.3V (5V tolerant)
Power Supply 7V to 12V DC
Digital I/O Pins 14 (4 also provide PWM, 4 also serve as UART pins)
PWM Digital I/O Pins 4
Analog Input Pins 6 (2 also serve as I2C SDA/SCL)
DC Current per I/O Pin 16 mA
Flash Memory 128KB code storage, 60KB RAM
Clock Speed 48 MHz
Dimensions 68.6 mm X 53.4mm
Beaglebone
SoC
TI OMAP3530
CPU ARM Cortex-A8, 720MHz
GPU TI TMS320C64x+ and Imagination Technologies PowerVR SGX 2D/3D
Networking 10/100 Ethernet
Storage
Onboard and SD
GPIOs
65
GPIO Operating Voltage
3.3V
Ports HDMI, S-Video, USB AB, USB, SD/MMC, Stereo in and out, RS-232, JTAG
Programming Language
Multiple languages: Python, C++, Java, etc.
5
Sensors:
Temperature Sensor
https://www.sparkfun.com/products/10988
http://www.mouser.com/ProductDetail/Texas-Instruments/LM61CIZ-NOPB
IC TMP36 LM61
Dimensions 5.1mm X 5.1mm X 5.1 mm 5.2mm X 4.2mm X 3.8mm
Sensing Range
Power Supply 2.7V to 5V DC 2.7V to 10V DC
Datasheet http://cdn.sparkfun.com/datasheets/Sensors/Temp/TMP35_36_37.pdf
http://www.ti.com/lit/ds/symlink/lm61.pdf
Specs/Outputs/Communication Analog: Produces a voltage proportional to the temperature relative to a “zero” value.
What It Measures Temperature of a surface or the surrounding environment
Required Math in Control Software Some sensors will require calculation to relate the Analog-Digital conversion integer value to a Celsius or Fahrenheit temperature value (The specific equation for the conversion can usually be found on the sensor’s datasheet) Other sensors will come with provided libraries for the programming language being used. For
6
example, companies often provide or publish C++ source and header files as Arduino libraries.
Sample Home IoT Projects ● Networked thermostat: internet-connected statistics on house temperature settings and conditions
● Refrigerator/Freezer failure notifier: notifies the user when the fridge is no longer functional ● Automatic window control: open the windows on warm days to cool the house and save on A/C
energy costs. ● Plant Monitoring and Watering Device: http://www.deviceplus.com/how-tos/arduino-guide/an-
arduino-plant-monitoring-watering-device/
White Light (Photoresistor) Sensor
https://www.sparkfun.com/products/9088
http://www.digikey.com/product-detail/en/luna-optoelectronics/PDV-P5003/PDV-P5003-ND/480601
Dimensions 4.3mm X 5.1mm X 36mm 9.3mm X 11mm X 25.4mm
Max Voltage 150V 350V
Resistance Range 8kΩ (light) to 1MΩ (dark) 12kΩ (light) to 1MΩ (dark)
Datasheet http://cdn.sparkfun.com/datasheets/Sensors/LightImaging/SEN-09088.pdf
http://media.digikey.com/pdf/Data%20Sheets/Photonic%20Detetectors%20Inc%20PDFs/PDV-P5003.pdf
Specs/Outputs/Communication Analog: Resistance changes proportionally with the intensity of light in the surrounding environment. This can be used to produce a proportional voltage.
7
Photoresistors come in many sizes in many Ω ranges
What It Measures The brightness of white light present in the surrounding environment
Required Math in Control Software Applications will require comparing the Analog-Digital conversion integer value to a threshold value Example: if (brightness > threshold)
Sample Home IoT Projects ● Automatic window blinds control: open the blinds during the day and close them during at dusk ● Plant Monitoring and Watering Device: http://www.deviceplus.com/how-tos/arduino-guide/an-
arduino-plant-monitoring-watering-device/
Proximity/Ambient Light Sensor
http://www.robotshop.com/ca/en/roboard-ir-proximity-ambient-light-sensor.html
http://www.icstation.com/ap3216-ambient-light-sensorals-proximity-sensorps-p-7958.html
IC Si1143 AP3216C
Power Supply 1.8V to 3.6V DC 3.3V DC
Communication I2C I2C
Proximity Range 150mm (<2.5kLx light) or 500mm (>2.5kLx light) 365Lx, 1460Lx, 5840Lx, 23360Lx
8
Datasheet http://www.robotshop.com/media/files/pdf/datasheet-rm-g201.pdf
http://www.dyna-image.com/upfiles/english/en_product_caty01430291326.pdf
Specs/Outputs/Communication I2C or SPI protocols: Proximity/Ambient Light Sensors typically communicate via the I2C or SPI protocols, sending data regarding the proximity of nearby objects and the intensity of white light in the surrounding environment
What It Measures Both nearness of other objects and ambient light in the surrounding environment
Required Math in Control Software Calculations for proximity sensing and ambient light-level sensing will typically be handled by either the sensor module itself or by libraries provided by the manufacturer.
Sample Home IoT Projects ● DIY home security system: networked security system that alerts you or the authorities when an intrusion has occurred
Ultrasonic Distance Sensor
https://www.parallax.com/product/28015
Dimensions 22mm X 46mm X 16mm
Power Supply 5V DC
Sensing Range 2cm to 3m
Datasheet https://www.parallax.com/sites/default/files/downloads/28015-PING-Documentation-v1.6.pdf
Specs/Outputs/Communication Digital:
9
When the microcontroller pin is configured as an output, a digital “high” sends an ultrasonic ping, and “low” stops sending an ultrasonic ping When the microcontroller as an input, a digital “high” indicates that a ultrasonic ping has bounced back to the sensor and been read.
What It Measures Distance to other objects
Required Math in Control Software Ping time must be converted to distance using the ultrasonic signal travel speed and the equation d = r * t / 2, where d is the distance the signal traveled, r is the speed at which the ultrasonic signal travels, and t is the time between the ping send and receive.
Sample Home IoT Projects ● Mail Notifier: Notifies a user via SMS when there is mail in his or her mailbox ● Parking assistant: a device on the curb or on the user’s driveway that indicates when the car is at a good
position. Helps keep the car close to the curb while also preventing misjudgment in tricky driving maneuvers ● Arduino Hexapod Robot: http://www.deviceplus.com/how-tos/arduino-guide/how-to-arduino-hexapod-part-1-
mechanics-and-wiring/ ● Motion-Controlled Lamp: http://www.deviceplus.com/how-tos/raspberrypi-guide/how-to-create-a-motion-
control-lamp-with-raspberry-pi/
Hall Effect Sensor
https://www.sparkfun.com/products/9312
https://www.adafruit.com/product/158
IC US1881 US5881
Power Supply 3.5V to 24V DC 1.8V to 28 DC
Datasheet https://www.sparkfun.com/datasheets/Components/General/Hall-US1881EUA.pdf
https://cdn-shop.adafruit.com/datasheets/US5881_rev007.pdf
10
Specs/Outputs/Communication Digital: The sensor outputs a digital “low” when a magnetic field is present and a “high” when a magnetic field is not present.
What It Measures Presence of a magnetic field
Sample Home IoT Projects ● Garage monitor: Allows the user to remotely check if the garage is open or closed through the internet. Notify the user via text message when he or she has left the garage open for too long (i.e. if he or she has left home). A magnet could be placed on the door and the hall-effect sensor could be placed on the ground.
Accelerometer
https://www.adafruit.com/product/163
https://www.sparkfun.com/products/12916
IC ADXL377 HMC6343
Dimensions .75in X .75in 0.8 in x0.8 in
Power Supply 5V DC 3.3V DC
Sensing Range ±3g acceleration measurement in each axis ±2g
Output Analog (-3g = 0V, 0g = 3.3V, +3g = 5V)
Datasheet http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL377.pdf
https://cdn.sparkfun.com/datasheets/Sensors/Magneto/HMC6343.pdf
Specs/Outputs/Communication Analog or I2C/SPI, depending on the module.
What It Measures Acceleration in 3 axes
11
Required Math in Control Software Applications will require comparing the acceleration components’ values to threshold values Example: if (acceleration_x > max_acceleration_x)
Sample Home IoT Projects ● Pet detector: keep track of your pets when they enter or leave the house by placing an accelerometer on the pet door to determine when it has been opened.
● Remote light control: turn a light on or off with a flick of a remote ● Smart Bike Lighting System: http://www.deviceplus.com/how-tos/arduino-guide/smart-arduino-
bike-lighting-system/
Gyroscope
https://www.element14.com/community/docs/DOC-69814/l/gyroscope-module-3-axis-l3g4200d
https://www.adafruit.com/products/1714
IC L3G4200D IC L3DG20H gyroscope and LSM303 accelerometer/magnetic compass
Dimensions .85in X .80in Dimensions 38mm X 23mm
Power Supply 2.7 to 6.5V DC Output 3-axis accelerometer, 3-axis gyroscope, 3-axis magnetic compass (“9 degrees of freedom”)
Communication I2C and SPI Power Supply 2.6V to 3.6V DC
Datasheet https://www.parallax.com/sites/default/files/downloads/27911-Gyroscope-3-Axis-L3G4200D-Guide-v1.1.pdf
Accelerometer Sensing Ranges ±2g, ±4g, ±8g, ±16g options
Gyroscope Sensing Ranges ±250°/s, ±500°/s, ±2000°/s options
12
Magnetic Compass Sensing Ranges ±1.3gauss, ±1.9gauss, ±2.5 gauss, ±4.0gauss, ±4.7gauss, ±5.6gauss, ±8.1gauss
Communication I2C
Datasheets https://cdn-shop.adafruit.com/datasheets/LSM303DLHC.PDF --- https://cdn-shop.adafruit.com/datasheets/L3GD20.pdf
Specs/Outputs/Communication I2C or SPI protocols: Gyroscopes typically communicate via the I2C or SPI protocols, sending separate data for angular velocity around the x, y, and z-axes.
What It Measures Angular velocity (typically in 3 axes)
Required Math in Control Software
Applications will require comparing values for the angular velocity in each axis to threshold values Example: if (omega_x > max_omega_x)
Sample Home IoT Projects ● DIY robot vacuum: Use a gyroscope for accurate (closed-loop) driving/control ● Arduino Bluetooth Gloves: http://www.deviceplus.com/how-tos/arduino-guide/arduino-bluetooth-gloves/
Potentiometer Sensor
https://www.sparkfun.com/products/9939
http://www.digikey.com/product-detail/en/tt-electronics-bi/P0915N-FC15BR10K/987-1649-ND/4780740
http://www.digikey.com/product-detail/en/bourns-inc/PTA3043-2010CIB103/PTA3043-2010CIB103-ND/3781185
13
Total Rotation Travel 300° 300°
Resistance Range 5kΩ to 1MΩ 1kΩ to 500kΩ 1kΩ to 250kΩ
Datasheet https://www.sparkfun.com/datasheets/Components/General/R12-0-.pdf
http://www.bitechnologies.com/pdfs/p09x.pdf http://www.bourns.com/docs/Product-Datasheets/pta.pdf
Specs/Outputs/Communication Analog: Resistance changes proportionally with the position of the knob (can be used to produce a proportional voltage) Linear potentiometers have knobs that slide along a straight path, interpreting linear motion. Rotary potentiometers have knobs that turn along a central axis, interpreting angular motion. Come in many sizes in many Ω ranges.
What It Measures Linear or Rotary Position
Required Math in Control Software
Applications will require comparing the Analog-Digital conversion integer value to a threshold value Example: if (linear_position > threshold)
Sample Home IoT Projects ● DIY dimming lamps: allows lights around the home to be dimmed to the user’s preference
14
Pressure (Force-Resistive) Sensor
https://www.sparkfun.com/products/9673
http://www.robotshop.com/en/interlink-electronics-circular-fsr-short-34-00015.html
Force Sensitivity Range .1N to 10N .2N to 20N
Resistance Range 2.5kΩ (max pressure) to 1MΩ (no pressure) >10 MΩ
Sensing Pad .3in diameter 14.7mm diameter
Dimensions 1.76in X .28in 30mm X 25mm
Datasheet http://cdn.sparkfun.com/datasheets/Sensors/ForceFlex/2010-10-26-DataSheet-FSR400-Layout2.pdf
http://www.robotshop.com/media/files/pdf/datasheet-34-00005.pdf
Specs/Outputs/Communication Analog: Resistance changes proportionally with the pressure applied (can be used to produce a proportional voltage)
What It Measures Force applied (warning: large instantaneous forces can damage the sensor)
Required Math in Control Software Voltage Analog-Digital conversion integer value must be calibrated (define zero-load integer value and max-load integer value) Applications will require comparing the Analog-Digital conversion integer value to a threshold value Example: if (pressure > threshold)
Sample Home IoT Projects ● DIY security system: place pressure sensors under or on items or places that you don’t want touched. The system could send alerts about and record which items are taken.
● Smart laundry: reminds the user to do the laundry when the bin is nearly full.
15
Barometric Pressure Sensor
http://www.robotshop.com/en/bmp180-barometric-pressure-temperaturealtitude-sensor.html
https://www.sparkfun.com/products/11824
IC BMP180
Communication I2C
Power Supply 1.8V to 3.6V DC
Measurement Range 300 to 1100 hPa
Measurement Resolution .02 to .06 hPa
Datasheet http://cdn.sparkfun.com/datasheets/Sensors/Pressure/BMP180.pdf
Specs/Outputs/Communication I2C or SPI protocols: Barometric pressure modules typically communicate via the I2C or SPI protocols, sending barometric pressure data in Pa or hPa.
What It Measures Atmospheric pressure in the surrounding environment
Required Math in Control Software Applications will require comparing values for the barometric pressure to threshold values Example: if (air_pressure > threshold)
16
Sample Home IoT Projects ● DIY weather gauge: Monitor and record different aspects of the weather. ● Plant water-o-meter: Uses weather forecast data online combined with current weather conditions
to control plant watering to save water
Ultraviolet Sensor
https://www.sparkfun.com/products/12705
http://www.rohm.com/web/global/sensor-shield-support/uv-sensor
IC ML8511A
Power Supply 5V DC
Detectable Wavelengths of UV light 280nm to 390nm
Datasheet https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/ML8511_3-8-13.pdf
Specs/Outputs/Communication Analog: Produces a voltage proportional to the intensity of ultraviolet light
What It Measures The intensity of ultraviolet light present in the surrounding environment
Required Math in Control Software Applications will require comparing the Analog-Digital conversion integer value to a threshold value Example: if (uv_intensity > threshold)
17
Sample Home IoT Projects ● Sunlight UV data logger: Measure and track UV radiation through the day. Notify the user to protect himself or herself during periods of high radiation
Fingerprint Sensor
https://www.sparkfun.com/products/11792
https://www.seeedstudio.com/Grove-Fingerprint-Sensor-p-1424.html
Sensor Module GT511-C3
Dimensions 37mm X 17mm X 9.5mm 21mm x 21mm x 21mm
Power Supply 3.3V to 6V DC 3.6~6.0 V DC
Communication (Read and Write fingerprint/data) UART (Arduino library: http://wordpress.hawleyhosting.com/ramblings/?p=375)
Arduino library: https://raw.githubusercontent.com/SeeedDocument/Grove-Fingerprint_Sensor/master/res/Fingerprint_library.rar
Storage Capacity 200 fingerprints 162 templates
Datasheet http://cdn.sparkfun.com/datasheets/Sensors/Biometric/GT-511C3_datasheet_V1%201_20130411[4].pdf
http://www.mouser.com/catalog/specsheets/Seeed_101020057.pdf
What It Measures Fingerprints placed on the touch surface (compared to a stored list of fingerprints to determine a match)
Sample Home IoT Projects ● Secret Safe: Turn any cupboard or closet into a locked system that can only be opened by one fingerprint using a servo motor for the locking mechanism and the fingerprint sensor to scan users.
18
Flex Sensor
https://www.sparkfun.com/products/8606
Dimensions 4.5in X .25in
Resistance Range 10kΩ to 110kΩ
Active Length 3.75in
Datasheet https://cdn.sparkfun.com/datasheets/Sensors/ForceFlex/FLEXSENSORREVA1.pdf
Specs/Outputs/Communication Analog: Resistance changes proportionally with the flex (can be used to produce a proportional voltage) Sparkfun: Resistance in range 10kΩ to 110kΩ, 3.75in active length, Dimensions (4.5in X .25in)
What It Measures Flex of the sensor
Required Math in Control Software Voltage Analog-Digital conversion integer value must be calibrated (define zero-load integer value and max-load integer value)
19
Applications will require comparing the Analog-Digital conversion integer value to a threshold value Example: if (flex > threshold)
Sample Home IoT Projects ● Gesture glove: Control lights and electronics around the home remotely with finger and hand gestures while wearing a glove with multiple flex sensors
Gas Sensors (Carbon Monoxide, LPG, etc.)
https://www.sparkfun.com/products/9403
https://www.pololu.com/product/1480
Model Sparkfun Carbon Monoxide MQ-7 Pololu Flammable Gas and Smoke Sensor MQ-2
Power Supply 5V DC 5V
Concentration Detection Range 20ppm to 2000ppm 300ppm to 10000ppm
Datasheet https://cdn.sparkfun.com/datasheets/Sensors/Biometric/MQ-7%20Ver1.3%20-%20Manual.pdf
https://www.pololu.com/file/download/MQ2.pdf?file_id=0J309
Specs/Outputs/Communication Analog: Produces a voltage proportional to the concentration of gas particles The MQ-series of gas sensors contains many different models for measuring different types of gases (http://www.china-total.com/Product/meter/gas-sensor/Gas-sensor.htm)
What It Measures The concentration of carbon monoxide (CO) or other gases in the surrounding air
Required Math in Control Software Applications will require comparing the Analog-Digital conversion integer value to a threshold value
20
Example: if (gas_concentration > threshold)
Sample Home IoT Projects ● DIY carbon monoxide alarm: protect yourself against dangerous undetectable carbon monoxide leaks in your home/garage
● Gas leak notifier: detect gas leaks in the kitchen or in the garage and notify the user
Connecting Microcontrollers to Each Other and the Internet:
Module Features and Specs / Cost
XBee RF Modules
(http://www.mouser.com/ProductDetail/Digi-International/XB24-AWI-001/)
● 3.3V Vcc and logic ● Range: ~300ft ● Dimensions: 27.61mm by 24.38mm ● Requires breakout to be used with
breadboard/protoboard(http://www.robotshop.com/en/droids-xbee-simple-board.html)
● Can be programmed and configured with AT commands and with
the X-CTU software (https://www.digi.com/products/xbee-rf-solutions/xctu-software/xctu)
● UART communication with microcontroller ● Networks with other XBee modules in several networking modes
(https://xbee.wikispaces.com/MESH)
Arduino Ethernet Shields (for Arduino) ● 3.3V logic (5V tolerant) ● Http request abilities ● Can be used as a simple webserver ● Can be used as a webclient using DHCP and DNS lookup to submit
GET or POST requests to webpages
21
(https://www.adafruit.com/products/2971)
● More documentation on https://www.arduino.cc/en/Reference/Ethernet
○ The vendor may have their own custom Ethernet Shield library!
● Typically around $25-$35
Arduino WiFi Shields (for Arduino)
(https://www.adafruit.com/products/2891)
● Specs are same as Arduino Ethernet Shield, except a physical (ethernet cable) connection is not required to connect the Arduino to the internet
● Typically around $40-$50 ● More documentation on https://www.arduino.cc/en/Reference/WiFi
○ The vendor may have their own custom Ethernet Shield library!
ESP8266 Modules ● 3.3V logic (pairing the ESP8266 with Arduinos that run on 5V logic can damage the ESP8266!)
○ Logic level-shift required from 5V to 3.3V--can be done with a resistor voltage divider
● Usually powered directly from the power supply, not from the Arduino: the Arduino’s 3.3V output cannot handle the larger current draw from this device
● UART communication with microcontroller ● Controlled by AT commands
(https://www.itead.cc/wiki/ESP8266_Serial_WIFI_Module) ○ Different AT commands perform different operations such as
connecting to a network, submitting an HTTP request, and more
● Libraries to interface it with the Arduino do exist, but are less
22
(http://www.digikey.com/product-detail/en/WRL-13678/1568-1235-ND/5725944)
numerous. Sending AT commands through Serial UART is an option, but is more tedious.
● Wiring Diagram for the ESP8266:
● Typically costs around $3-$10
Image Credits: tested.com, arduino.cc , mouser.com, adafruit.com, dev.px4.io, sparkfun.com, robotshop.com, adafruit.com, element14.com, digikey.com, element14.com, and robotistan.com