esp8266-01-thermometer.jpg 29.28K 17 downloads
The foreground shows my first iteration design for a remote thermometer. You can see the WiFi aerial on the top daughter-board. It is powered by the plug to its right and my Sony USB-stick MP3 player behind is shown to give you an idea of scale. The whole build cost is less than a tenner. Working from right to left:
- USB power connector. This is a bit of a botch cannibalised from a USB cable, since the proper part is still on its way from China (it's also on the wrong side -- the WiFi aerial should be facing out from the wall.)
- USB power connector header. Not sure why I put this on.
- 5v to 3.3V step-down daughter board. The USB plug produces 5V but the electronics run at 3.3V. (Behind this is a jumper to put the board into Firmware flash mode, but I will probably drop this, as its just easier to plug the processor into a dedicated flasher board.
- Header for the ESP 8266 ESP-01 chip (with processor in place). This is the processor, memory and WiFi on a single tiny daughter board.
- 4 x one-wire headers. This is where I plug in my remote digital thermometer (DS18B20) chips. A simpler version of this board would just have one mounted thermometer.
- 3.3V serial header. This is used to flash the firmware or when programming the chip. I use a standard USB-to-serial chip to connect to this from my laptop. It's not connected for normal running.
This version supports firmware flashing, SW development over USB as well as 4 thermometers. I might want one or two for a "production" version, but I decided to put in headers for four as I want to get a handle on how accurate they are.
Out of the box, this ESP-01 board comes with firmware to provide an modem-style AT interface over TTL serial so that you can use it with an Arduino or the the likes. However, I have reflashed it with a Lua environment, developed by NodeMCU, and which is basically a straight port of the eLua environment to the microprocessor which is embedded in the main chip on the board. This enable me to program the board in an efficient late-bound (like Python) language, but with cut-down more C-like syntax. It uses standard modules (coded in C) to do all of the grunt work. These include pretty much everything that you'd want for a device like this:
- External hardware interfacing: ADC, I²C, one-wire, SPI, PWM, UART, WS2812, U8G graphics
- Communications: Net, Wifi, MQTT, CoAP, CJSON
- Other low-level support: GPIO, BIT manipulation, File I/O, Timer
My previous "project" was working on the internals of the PHP (the language that most of the web is written in) compiler and runtime system, so I am used to crawling around inside this sort of software. The tl;dr summary is that I am impressed, and the deeper that I dig I continue to get more impressed. I could go on, but I pause for other comments.
Edited by TerryE, 23 March 2015 - 01:27 PM.