Voltmeter Speaks MQTT Without Libraries

[Emilio Ficara] [built himself an Internet-connected MQTT multimeter](http://ficara.altervista.org/) (translated from Italian by robots). Or maybe we should say that [Emilio Ficara] undertook a long string of cool hacks that ended up in a WiFi-enabled multimeter, because the destination isn’t nearly as interesting as the voyage.

The multimeter, a DT-4000ZC, has a serial output but instead of transferring the data directly, it sends which cells on the LCD screen need to be activated. For testing along the way, [Emilio] used his own USB-serial-to-ESP01 dongle, which sounds like a useful tool to have around if you’re debugging an AT command session. He made a cute AVR SPI-port debugging aid with a reset button and diagnostic LEDs that we’re going to copy right now. Other home-made tools, like a 3.7V Li-ion battery manager and a serial data snooper make this project worth a look.

But the bit we really like is [Emilio]’s absolutely minimalistic approach to sending data over WiFi using the ESP-01’s AT command set and simply writing the necessary bytes. Of course, he had help, in the form of the fairly clearly written MQTT standard. But if you want to shoe-horn some great functionality into a small flash memory space, hand-writing the MQTT transactions turns out to be a good alternative.

Unfortunately, [Emilio]’s code is only downloadable in compiled form. We’d love to have a look at the source, at least for the AVR. But there’s more than enough visible in the inline images to get you started. And if you’re not already using MQTT as the backbone of your home data network, have a look at our four-part series on doing so. As [Emilio] demonstrated, MQTT is lightweight enough to be bit-banged, but it’s also easy enough to use in more fancy devices where you do have the memory. It’s our data-shuttling protocol of choice, and it’s a natural companion for the ESPs.

Hmmm. This is a really detailed write up and in my opinion it doesn’t look minimalistic at all. There is a way to do all that with only the ESP board, with MQTT libraries of course, running on the ESP. But it seems as if the Atmega has to be in there for some reason (IO?) – but he needs 2 UARTs on the Atmega to convert the incoming multimeter data to MQTT and send it over the secound UART.

Honestly, I think the ATmega is there because he had a board kicking around with one on it. This has a lot of the flavor of a junk-box build more than a top-down engineering application. I’m sure he could do everything on the ESP.

As for whether simply tacking on the cheesiest of all ESP modules (the ESP-01) and using the pre-built AT command set is minimal or not… I won’t argue. :)