Home » ESP8266 Lab Kit and Workshop
Originally delivered at Open Source Hardware Camp 2015 (as part of Wuthering Bytes), Electrolama ESP8266 Workshop introduces attendees to the popular low-cost WiFi enabled ESP8266 platform and the Lua programming language and goes through a series of practical exercises focusing around a sensor device for the home. At the end of this workshop, attendees create a WiFi connected sensor node that reports several metrics to a cloud service and get a sense of how connected devices work in a typical IoT system.
To help with the code examples provided as part of this workshop, a small and low-cost lab kit was also designed and produced. Electrolama ESP8266 Lab kit ("ELK", in places) is a simple "breakout" for the NodeMCU board (which is in turn a breakout and the support circuitry for the ESP-12E module) that adds a couple of sensors and simple input/output devices to the base ESP8266 system. These are namely:
- HC-SR501 PIR Motion Sensor
- DHT11 Temperature/Humidity Sensor
- A light dependent resistor (LDR) to estimate ambient light level
- 2 LEDs, 3 in total with the built-in LED that ESP-12E has
- A push-button (SPNO) and a screw terminal for a magnetic door/window switch
- A small prototyping area for the enthusiastic hackers
The assembled ESP8266 Lab Kit looks a bit like this:
Notes about the NodeMCU board
NodeMCU is a great low-cost board to get started with ESP8266. It does, however, have a couple of "features" that you need to be aware of:
- D1, the protection diode that prevents an external battery or a power source (VDD5V, pin 15) to interfere with the 5V coming from the USB port (VDDUSB) causes enough of a voltage drop that some PIR sensors tested (rated Vmin of 5V) acted spuriously. To prevent this, D1 should be replaced with a 0R resistor or a simple wire link. With D1 removed, you should ensure that only one source of power is applied to the board at any given time
The ADC pin exposed on the NodeMCU board (A0) has a potential divider arrangement that is not ideal, the "reserved" pin right under A0 goes directly to the ADC pin on the ESP-12E module (and you can't avoid R14, a 100k pulldown, unless you pop it off)Turns out there is a reason for this -- ESP8266 datasheet states: "The input voltage range is 0 to 1.0 V when TOUT is connected to external circuit". ELK Revision B is the new fixed revision of the board that uses the "A0" pin exposed on the NodeMCU board rather than the reserved pin.
Have a look at the schematic of NodeMCU board and ELK to get a better understanding of how they work together.
Materials and resources
Everything related to this workshop can be found on Github under electrolama/esp8266-workshop
This repository contains:
- lab-manual: Self explanatory, it is intended to be a "grab a copy and you're good to go" kind of a document.
- code-examples: Code examples referenced in the lab manual
- tools: Copies of ESPlorer and esptool
- firmware: Copy of the NodeMCU firmware last used (and "known working") for the workshop
- hardware: Design files for the ELK and datasheets for sensors
- ELK and the workshop build on top of the NodeMCU project (both hardware and firmware), details of which can be found at nodemcu.com. Keep in mind that that are two versions of the NodeMCU board, ELK is designed for "nodemcu-devkit-v1.0", details of which can be found here.
- NodeMCU API documentation is pretty crucial.
- esp8266.co.uk has a pretty decent Lua programming language primer.
- ESPlorer is the GUI environment used in this workshop.
- esptool is a nifty tool for burning firmware.
License and Redistribution
- Electrolama ESP8266 Workshop Manual is released under the Creative Commons Attribution-ShareAlike 3.0 License.
- Electrolama ESP8266 Lab Kit is released under the Solderpad Hardware License.
What this boils down to is, as long as you retain attribution and previous references and share any modifications that you make under the same conditions, you are allowed to re-use all these materials for any workshops or other activities that you are running.
NodeMCU, ESPlorer and esptool all have their corresponding licenses, refer to the project pages for more details.