I bought an ESP8266 NodeMCU module for £7 just to have a play and see what everyone is talking about.
dx.com is one supplier (£6.57). It has a 80MHz or 160MHz CPU. And is very small (few cm x few cm).

The SDK including GCC is free, and it has Wifi on board plus GPIO and one ADC.
Add a breadboard for all of £1.50 ish (then saw it in half to fit the NodeMCU’s wide leg spacing). Job done.

Now grab a photoresisitor, some nicely trimmed connecting wires and a 10K resistor (see dx.com). In the old days we used to have to strip our own wires…blah blah..

Here’s what the rig looks like. Just connect to USB and you’re good to go. ESP8266 logging

Next is to load the firmware and create a lua script. I am not going to go into it here, other that to give a list of useful links:
Firmware loader and NodeMCU Lua flash binary.
How-to guide.

Now hook up the photoresistor to the ADC + Vdd with a 10K pull-down. Craft a nice lua script to read the ADC value, then post it to a php API. Add in a database to store the data, then use dygraphs javascript charting library and some more mySQL/php to view the data.

I left it running for 2 days sampling light levels by a window every 3 seconds. Worked like a charm (see the frame below, though only tested on Chrome, it exceeds the browser stack size on Safari – work in progress).

Next step is to ad a Wacom GSM modem I have lying around and make it a truly go-anywhere logger for next to no money per unit.

Note the chart below overflows the Javascript stack on Chrome. Works fine in Safari and Firefox. Might fix it one day.

By | June 26th, 2015|Technology consultancy|Comments Off on ESP8266 for some really low cost monitoring