ESP8266 - mozilla/project_haiku.iot GitHub Wiki

#ESP8266

Using Sparkfun ESP8266 Dev Thing development board

ESP8266 Dev Thing is Wi-Fi enabled micro controller that can be programmed with Ardunio IDE which make it super easy to program for someone just getting started. ESP8266 Dev Thing hookup guide gives hardware overview and how this dev board can be programmed using Ardunio IDE version 1.6.4 and up.

We have couple of use cases that needs client server interface. We decided to explore and use ESP8266 as Access Point web server that can set up a network of its own, allowing other clients to connect directly to it.

Example sketches of two ESP8266 communicating using WiFi network with SSID hardcoded as 'ESP8266', Below sketches are using two push buttons on client ESP8266 to trigger on/off on server.

https://github.com/mozilla/smarthome.iot/tree/master/ESP8266/Client-Server/ESP8266_Switch_Client

https://github.com/mozilla/smarthome.iot/tree/master/ESP8266/Client-Server/ESP8266_AP_Server

Demo Video here shows it running.

Range: Example sketch above is tested with two ESP8266 communicating at a distance range of ~70-80 ft.

Next, we used [VCNL4010 Proximity sensor] (https://www.adafruit.com/products/466 ) on client ESP8266. On server side, [NeoPixel ring] (https://www.adafruit.com/product/1643 ) or [Neo Pixel 60 leds strip] (https://www.adafruit.com/products/1138 ) was used as ambient indicator.

ESP8266 Proximity_Sensor_Client handles proximity sensor and if VCNL4010 senses proximity is more than threshold 3000, it sends HTTP request to web server to turn on NeoPixel ambient indicator. When proximity values drops below 3000 it turns off the indicator. This interface can be used for mailbox use-case. Place client ESP8266 inside your mailbox. It turns on 'You have got mail' ambient indicator light inside the house when you receive mail. After collecting mails, it will turn off the ambient indicator.

Example sketch:

https://github.com/mozilla/smarthome.iot/tree/master/ESP8266/Client-Server/Proximity_Sensor_Client

https://github.com/mozilla/smarthome.iot/tree/master/ESP8266/Client-Server/Neo_Pixel_Server

Demo Videos

With NeoPixel ring as ambient indicator

With NeoPixel 60 LEDs strip as ambient indicator

Power Supply: For above example sketches, we used USB as power source to supply 3.3 - 5V in to the board. Alternatively, you can solder a variety of connectors into the VIN position to run the board on some other power supply. For example, you could solder a 2-pin JST connector and mate the board with a 2xAA Battery Holder to power your project.

A NeoPixel 60 LEDS strip draws ~0.68A when turned on and ~ 0.07A when turned off. A NeoPixel ring draws ~0.33A when on and ~0.07 A when turned off. The power LED on ESP8266 will normally pull about 7mA which can be saved by disabling the power LED using PWR-LED jumper. A pair of jumpers on the back of the board can be used to help reduce the Thing’s power consumption and brings it down to microAmp in sleep mode. For example, we could put both the client and server boards to sleep outside the hours we expect mail. It may also be possible to have the Proximity sensor trigger an interrupt to bring the client out of sleep and only connect to Wifi when needed to save further power. Waking up every minute or so to check the sensor value would have a similar benefit.

Power Supply and Range is the biggest factor for the integrated product to be successfully and reliably used for a longer period of time.