Community
OpenEnergyMonitor

OpenEnergyMonitor Community

ESP8266 WIFI developments

Glyn and I have been doing quite a bit of development recently on using the ESP8266 WiFi board with OpenEnergyMonitor kit, we are quite excited about the potential of this module to both reduce the cost of the system and simplify setup and installation especially for applications that primarily post to a remote emoncms server such as emoncms.org.

Note: we have no plans to discontinue developments and support for Raspberry Pi based systems e.g. emonPi / emonBase. Quite the opposite: the local storage and processing of a Raspberry Pi based system has many advantages particularly for systems requiring more flexibility and customisation e.g Local Emoncms storage. MQTT, openHAB & nodeRED integration. The ESP developments will be ran in parallel, in fact ESP could be configured to post to an emonPi / emonBase via MQTT for local on-site storage and integration.

We are at the moment working on three initial uses of the ESP8266:

1. EmonTx V3 + ESP8266 module

We are initially using the Adafruit HUZZAH ESP8266 module as a development platform, which is available for around £10.50. For anyone keen to get going with the ESP8266 Huzzah module it is available from a number of places such as adafruit (USA) and Pimoroni (UK). Any ESP8266 with ESP-12 module should work the same. See lower in the post for EmonESP firmware dev.

See post detailing how to use this module with the EmonTx v3
Using the EmonTx v3 with the ESP8266 Huzzah WIFI module guide

2. Heatpump/Energy Monitor

Heatpump / energy monitor through-hole development board, essentially and EmonTx v2 with additional features for interfacing with heat meters and multiple DS18B20 temperature sensors as well as an integrated ESP8266 WIFI module.

The heatpump monitor board currently supports:

  • 3x CT + ACAC Channels
  • Elster A100C Irda meter reader (watt hours)
  • Pulse Counting
  • Supports MBUS heat meters (Kamstrup 402)
  • Supports SIKA flow meters
  • 4x DS18B20 Temperature Sensors
  • Miniature solid state relay for heating control (not yet tested)
  • ESP8266 Low cost Wifi
  • RFM69 option
  • Raspberry PI connector option
  • A Through-hole ESP Wifi development platform
  • Fits in the EmonTx V3 Aluminum case

Guide cost ~£50 (ex VAT) for full heatpump monitor kit with case, ~£30 for cut down WIFI energy monitor only kit without case… To be finalised.

See Heatpump monitor development repo

3. ESP8266 based WIFI Pixel Energy Display,

This is an idea thanks to David Hunninsett (@m0untainpenguin) with hardware being developed by Protoneer. It fits into a project we are more recently part of here in North Wales called CydYnni by EnergyLocal where 100 households within the boundary of the substation get cheap electricity when a local community hydro is running. David Hunninsett is one of the households on the project and he is keen to have a display that shows when it’s a good time to use electricity among other uses. The wifi pixel could become a nice platform for a ambient home energy indicator.

See software development repo on

EmonESP, easier setup and installation

One of the really nice things about using the ESP module is that it can really simplify setup for installations that only need to post to a remote emoncms server. The wifi module starts by broadcasting a hotspot that you connect to directly, you can then scan for wifi networks, select the network, get the ip address of the monitor on the network (which saves using fing or accessing your router device list), enter your emoncms.org apikey to connect to an emoncms.org account (to be replaced with username and passowrd login + ability to register and link the monitor to a emoncms account in one step).

We plan to extend EmonESP to also support MQTT.

The EmonESP software is based on work by Chris Howel of OpenEVSE which is a really nice open hardware electric vehicle charging station, it’s been really nice to find a common development like this that can be beneficial to two open hardware and software projects. OpenEVSE already use Emoncms for logging and graphing.

EmonESP firmware developments can be found on github

Over the air firmware upload

Glyn has been doing a lot of work on how we can do over the air updates to ESP8266 based units. Being able to do this will make it a lot easier to maintain and keep the firmware on these updated especially as the software goes through the larger number of iterations in initial development. Check out his blog posts here to follow the development:

Part 1/3: PlatformIO open-source embedded development ecosystem
Part 2/3: Firmware Continuous Test & Build
3/3: Continuous Deployment (OTA to ESP8266) …In the making!

4 Likes

Here’s the accompanying Using the EmonTx v3 with the ESP8266 Huzzah WIFI module guide

1 Like

On the old Forum there was this post about an ESP8266 battery powered solution https://openenergymonitor.org/emon/node/11880. I’m sure I have come across someone using a button battery as well but I can’t find it.

If this really was a workable solution (replace the TH), moving away from the RFM communication and using MQTT for all comms would, it seems to me, make getting started simpler (no need for a base at all), solve some range issues and be a neater solution. I’d favour a built in rechargeable battery rather than AAs though.

Edit - I also came across these guys (US based) who have all sorts of ESP8266 modules - The website is not overly informative though - a PDF product guide. Doh!

Edit 2, found the battery powered ESP8266 item. It was on YouTube https://youtu.be/IYuYTfO6iOs

1 Like

Thanks Brian, I havent really looked into battery powered operation yet but yes agree that a WIFI emonth if possible would be great, it would be very cost effective for projects that just want to measure the temperature & humidity of a room without additional monitoring.

The heatpump monitor design has a RFM69 option on there and I’ve hardcoded the ability to receive data from EmonTH nodes into the firmware.

ESP8266 uses an order of magnitude more power than Atmega, true we could put it to sleep for long periods but it will be difficult to achieve long battery life using power hungry Wifi. Maybe a 5V dc powered temperature sensor is not bad thing though…I find it a pain to have to change batteries even if it’s only once per year! Installing a powered temperature sensor would require the little bit of extra effort but then it would be fit-and-forget forever. Also, disposable batteries are not great for the environment.

We have not made any decision on this, there are no plans to replace the emonTH, I’m just thinking out loud at the moment!

You’d have to be pretty cute to beat the sonoff in line switch which uses the esp8266 and is easily reprogrammed (there are plenty of examples as to how to do this) and it’s very easy to connect a ds18b20 to the connections on the board.

So for a few dollars and a bit of hacking you have a WiFi temperature sensor that can also switch loads.

So I can now forget about turning off the water supply in the shed. Sonoff hacked to read temperature, small fan heater which is turned on if the temperature gets below say 4C and off again at 5C and the temperatures sent to my emoncms system via MQTT and a node-red alarm if things get below say 3C.

And including the fan heater that’s about £10 and a bit of my time. Result!

1 Like

Not come across the Sonoff. Any good pointers to guides? Seem readily available on eBay. Can you hook it up through node-red, openhab or home automation?

Check out Pete Scargill’s blog, for example here http://tech.scargill.net/cheapest-iot-on-the-planet/

He’s documented how to hack these really cheap devices.

2 Likes