Workshop materials for the IoT hand-on training. The training is based on the ESP8266 chip and Arduino framework. The training was first done at the TWF 2016 Conference.
The idea behind the workshop is to have a step-by-step tutorial on building Internet of Things (IoT) solutions. The initial exercises are simple and evolve over time.
If any questions please email me.
- ESP8266 Community Forum
- Arduino core for ESP8266 WiFi chip
- Arduino Reference
- esp8266-wiki
- Arduino Tutorials
Ensure you have installed:
- PlatformIO IDE (for the IoT device)
- Download from: http://platformio.org/platformio-ide
- Also follow the installation guide
- Ensure you install clang to have code completion.
- Ensure you install Python.
- Visual Studio 2015 Community IDE (for the control app)
Windows PC is required.
The training requires parts:
- Chip
- Module WiFi ESP-12E ESP8266 Black - 11 GPIO, ADC, PCB antenna
- Adapter board ESP8266 ESP-12 / 12E / 12F / 07
- USB-UART (flasher)
- Converter USB-UART PL2303 - microUSB slot
- MicroUSB cable B-A
- Sensors
- Motion detector PIR HC-SR501
- Transmitter IR 5mm 940nm (TSAL6400)
- Infrared Receiver 38 kHz (TSOP4838)
- Humidity detector DHT22 AM2302
- Module with 2 relays (photo-optic isolation)
- Power
- Stabilizer LDO 3.3V LF33CV - THT TO220
- Power adapter 5V/2A DC
- Other stuff
- Breadboard
- Male wires
- 3x LEDs (red, yellow, green)
- 4x 220Ω resistor
- 1x 100Ω resistor
- Computer (PC, MAC?)
Most important commands in PlatformIO:
- Serial Monitor
- PlatformIO > Serial Monitor
- Shortcut: Alt+Shift+M
- Build
- PlatformIO > Build
- Shortcut: Alt+Ctrl+B
- Upload
- PlatformIO > Upload
- Shortcut: Alt+Ctrl+U
Whenever the ESP is reset or powered on it checks the state of three GPIO pins to enter one of the boot modes:
GPIO15 | GPIO0 | GPIO2 | Mode |
---|---|---|---|
LOW | LOW | HIGH | UART Bootloader |
LOW | HIGH | HIGH | Boot sketch |
HIGH | x | x | SDIO mode (not used for Arduino) |
- LOW = connected to GND
- HIGH = connected to 3.3V
The UART Bootloader mode is used to upload our program. The Boot sketch mode is used to execute our program (normal mode).
At startup ESP prints out the current boot mode:
rst cause:2, boot mode:(3,6)
More details are provided on the ESP Arduino wiki.
The ESP8266 12E looks like this:
During the workshop we are sing a breadboard adapter:
- 01_Blink
- 02_Blink_SOS
- 03_Blink_3LED
- 04_WiFi
- 05_RemoteControl
- 06_JSON_2Relay
- 07_JSON_2Relay_Exercise
- 08_Temp_Motion
- 09_Temp_Motion_Exercise
- 10_MQTT
- 11_MQTT_Exercise
- 12_IR
- 13_IR_Exercise
- Eclipse SmartHome project
- Eclipse IoT technology hub
- Schematics are prepared using Fritzing.
TBD
- This material is provided as is.
- The author is not responsible for any damage this might cause ;-)