RFM69 to MQTT Gateway on the Super-Cheap

[Martin] is working on a RFM69-to-MQTT bridge device. If you’re at all interested in DIY home automation, this is going to be worth following. Why? When your home automation network gets big enough, you’re going to have to think seriously about how the different parts talk to each other. There are a number of ways to handle this messaging problem, but MQTT is certainly a contender.

MQTT is a “lightweight” publish-subscribe framework that’s aimed at machine-to-machine data sharing, and runs on top of a normal TCP/IP network. IBM has been a mover behind MQTT since the beginning, and now Amazon is using it too.

But most MQTT servers need a TCP/IP network, which pretty much means WiFi, and this can be a killer for remote sensors that you’d like to run on battery power, or with limited processing power. For these use cases, a low-power, simple sub-gigahertz radio module is a better choice than WiFi. But then how to do you get your low-power radios to speak to your MQTT devices?

That’s the point of [Martin]’s MQTT bridge. Previously he had built a sub-gig radio add-on for a Raspberry Pi, and let the Pi handle the networking. But it looks like there’s enough processing power in a lowly ESP8266 to handle the MQTT side of things (over WiFi, naturally). Which means that you could now connect your 868 MHz radio devices to MQTT for less than the cost of two pumpkin spice, double-pump lattes.

On the firmware side, [Martin] has enlisted the help of [Felix], who developed the Arduino-plus-RFM69 project, the Moteino. [Felix] has apparently ported his RFM69 library to the ESP8266. We’re dying to see this working.

For now, we’ve got some suggestive screenshots which hint at some LAN-exposed configuration screens. We’re especially interested in the RFM + MQTT debug console window, which should really help in figuring out what’s gone wrong in a system that spans two radio protocols.

The bottom line of all of this? Super-cheap, power-efficient RFM69-based radio nodes can talk with your sophisticated MQTT network. Keep your eyes on this project.

IoT Enabled Thomas The Tank Engine

This month the popular “Thomas the Tank Engine” toy celebrated its 70 anniversary. As a fun project, [tinkermax] wanted to bring this traditional toy into the age of IoT, while preserving its physical appearance and simple charm.

He used a model called the “Diesel” which seemed big enough to house the electronics, but proved otherwise once he inspected the innards. He needed to fit in an ESP8266 module, an accelerometer breakout, some discrete parts, a nifty analog multiplexer, and a 14500 3.7V LiPo. Once done, he was able to control its speed remotely over WiFi, with an auto “throttle-boost” that kicks in when the accelerometer senses that the train is going uphill, and has remote monitoring of battery state, engine load, inclination and track vibration – all in real-time using MQTT over WiFi. It’s quite a demonstration of the power of these super-cheap WiFi modules that are powering the current wave of IoT innovation.

The train motor works off a single 1.5V battery, so [tinkermax] tried a couple of boost converters to get the ESP-12 to work. But the modules were a tad bigger, and couldn’t provide the high peak current needed by the ESP-12. So he used a 14500 3.7V LiPo battery instead. A series diode drops the LiPo voltage to a circuit friendly 2.9V ~ 3.6V range. The ADXL345 accelerometer is used to measure “pitch” to detect going up and down a hill, “roll” to check for tilt or tip over and vibration to identify track defects. It communicates with the ESP-12 using a special Lite-SPI library that he wrote.

Two analog measurements are performed. One uses a resistor in series with the PWM driven motor to measure its current, with a low pass filter to smooth out PWM noise. The other is a resistor divider network used to monitor battery voltage. But the ESP-12 has just one ADC channel. Instead of adding another ADC module, [tinkermax] used a neat device – the FSA3157 – which allows two analog inputs to be channeled to a single output much like a SPDT switch. One PWM output is used to control motor speed and a second one to pulse a LED.

The sensor data is streamed 5 times a second over the MQTT protocol to a Raspberry Pi based MQTT broker. Finally, a JavaScript webpage receives the MQTT messages and plots the data graphically. One upgrade he would like to implement is speed measurement, to allow constant speed drive. If you have any ideas on how to extract that information from an accelerometer, chip in with your comments below. Check out his build log in the short video below. And if you’d like to see how all of this can be used in the real world, check this other video where [tinkermax]’s colleague gives a run down about a commercial enterprise IoT cloud platform hooked up to Thomas the Tank Engine.

Continue reading “IoT Enabled Thomas The Tank Engine”

Controlling Central Heating Via Wi-Fi

If you’ve ever lived in a building with manually controlled central heating, you’ll probably understand [Martin]’s motivation for this hack. These heating systems often have old fashioned valves to control the radiator. No Nest support, no thermostat, just a knob you turn.

To solve this problem, [Martin] built a Wi-Fi enabled thermostat. This impressive build brings together a custom PCB based on the ESP8266 Wi-Fi microcontroller and a mobile-friendly web UI based on the Open Thermostat Scheduler. The project’s web server is fully self-contained on the ESP8266.

To replace that manual value, [Martin] used a thermoelectric actuator from a Swiss company called HERZ. This is driven by a relay, which is controlled by the ESP8266 microcontroller. Based on the schedule and the measured temperature, the actuator lets fluid flow through the radiator and heat the room.

As a bonus, the device supports NTP for getting the time, MQTT for publishing real-time data, and ThingSpeak for logging and graphing historic data. The source code and design files are available under a Creative Commons license.

Electricity Monitoring with a Light-to-Voltage Sensor, MQTT and some Duct Tape


When it comes down to energy management, having real-time data is key. But rarely is up-to-the-minute kilowatt hour information given out freely by a Utility company, which makes it extremely hard to adjust spending habits during the billing cycle. So when we heard about [Jon]’s project to translate light signals radiating out of his meter, we had to check it out.

From the looks of it, his hardware configuration is relatively simple. All it uses is a TSL261 Light-to-Voltage sensor connected to an Arduino with an Ethernet shield attached. The sensor is then taped above the meter’s flashing LED, which flickers whenever a pulse is sent out indicating every time a watt of electricity is used. His configuration is specific to the type of meter that was installed by his Utility, and there is no guarantee that all the meters deployed by that company are the same. But it is a good start towards a better energy monitoring solution.

And the entire process is documented on [Jon]’s website, allowing for more energy-curious people to see what it took to get it all hooked up. In it, he describes how to get started with MQTT, which is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol, to produce a real-time graph, streaming data in from a live feed.

Continue reading “Electricity Monitoring with a Light-to-Voltage Sensor, MQTT and some Duct Tape”

Long Range Wireless Sensors for the Home-Area-Network

7785441404784533190 In the near future, we will all reside in households that contain hundreds of little devices intertwingled together with an easily connectable and controllable network of sensors. For years, projects have been appearing all around the world, like this wireless sensor system that anyone can build.

[Eric] hopes his work will help bring the truly expansive Home-Area-Network (HAN) into fruition by letting developers build cheap, battery-powered, long-range wireless sensors. His method integrates with the pluggable OSGI architecture and home automation platform openHAB along with using an Arduino as the lower power, sensor node that is capable of utilizing many types of cheap sensors found online.

[Eric]’s tutorial depicts a few examples of the possibilities of these open-source platforms. For instance, he shows what he calls a ‘Mailbox Sentinel’ which is a battery-powered mail monitoring device that uses a Raspberry Pi to play the infamous, and ancient AOL sound bite “you’ve got mail.” It will also send an email once the postman cometh.

In addition, he lists other ideas such as a baby monitoring sentinel, a washer/dryer notification system, water leak detectors, and security implementations that blast a loud alarm if someone tries to break in. All of this potential for just around $20.

The key to making this project work, as [Eric] states, is the MQTT binding that ties together the Ardiuno and openHAB platform. This allows for simple messages to be sent over the Ethernet connection which is often found in IoT devices.

So all you developers out there go home and start thinking of what could be connected next! Because with this system, all you need is a couple of ten-spots and an internet plug, and you have yourself a strong foundation to build on top of. The rest is up to you.

This open, connected device is [Eric’s] entry for The Hackaday Prize. You can see his video demo after the break. We hope this inspires you to submit your own project to the contest!

Continue reading “Long Range Wireless Sensors for the Home-Area-Network”