ESP8266 BASIC WiFi Thermostat is Child’s Play

If you’ve read any of our posts in the last couple years, you’ll have noted that our community is stoked about bringing the Internet to their devices on the cheap with the ESP8266 modules. Why? This forum post that details making a WiFi thermostat really brings the point home: it’s so easy and cheap to build Internet-enabled devices that you almost can’t resist.

When the ESP8266 first came out, there very little documentation, much less code support. Since then Espressif’s SDK has improved, the NodeMCU project brought Lua support, and there’s even Arduino support. Most recently, BASIC has been added to the ESP stable, and that really lowers the barriers to creating a simple WiFi widget, like the thermostat example here that uses a Dallas DS18B20 temperature sensor and an LED as a stand-in for the heater element.

The hardware for this project, a re-build of this demo code from the ESP8266 BASIC docs, is nothing more than a few off-the-shelf parts soldered together. No schematic required.

What makes the project work behind the scenes is some clever code-reuse by [Rotohammer] on the ESP8266 forums. Essentially, he wrapped the Arduino’s one-wire library, giving it simple BASIC bindings. Then all that’s left for the BASIC coder is to read the value and print it out to a webpage.

There’s all sorts of details swept under the rug here, and those of you out there who are used to bare-metal programming will surely huff and puff. But there’s a time for building your own injection-molder to make DIY Lego bricks, and there’s a time to just put blocks together. This project, and the BASIC interpreter that made it possible, demonstrate how much joy someone can get from just putting the parts together.

Absurd Clock uses Twelve ESP8266 Modules

Quick quiz: How many ESP8266 modules do you need to make an LED clock? Hint: a clock displays 12 hours.

Nope! Twelve is not the answer. But that didn’t stop user [tamberg] from building a 12-ESP clock during the Bilbao, Spain Maker Faire. The “advantage” of using so many ESP8266s is that each one can independently control one hour LED and its associated slice of five minute-marker LEDs. Each ESP fetches the time over the Internet, but only lights up when it’s time.

It’s like parallel processing or something. Or maybe it’s redundant and failsafe. Or maybe it’s just an attempt to put the maximum Internet into one Thing. Maybe they had a team of twelve people and wanted to split up the load evenly. (We couldn’t think of a real reason you’d want to do this.)

All snark aside, the project looks great as you can see in this Flickr gallery, and all of the design files are available if you’d like to re-use any parts of this project. We’re thinking that the clock face is pretty cool.

Continue reading “Absurd Clock uses Twelve ESP8266 Modules”

Hackaday Links: November 22, 2015

There’s a new documentary series on Al Jazeera called Rebel Geeks that looks at the people who make the stuff everyone uses. The latest 25-minute part of the series is with [Massimo], chief of the camp. Upcoming episodes include Twitter co-creator [Evan Henshaw-Plath] and people in the Madrid government who are trying to build a direct democracy for the city on the Internet.

Despite being a WiFi device, the ESP8266 is surprisingly great at being an Internet of Thing. The only problem is the range. No worries; you can use the ESP as a WiFi repeater that will get you about 0.5km further for each additional repeater node. Power is of course required, but you can stuff everything inside a cell phone charger.

I’ve said it before and I’ll say it again: the most common use for the Raspberry Pi is a vintage console emulator. Now there’s a Kickstarter for a dedicated tabletop Raspi emulation case that actually looks good.

Pogo pins are the go-to solution for putting firmware on hundreds of boards. These tiny spring-loaded pins give you a programming rig that’s easy to attach and detach without any soldering whatsoever. [Tom] needed to program a few dozen boards in a short amount of time, didn’t have any pogo pins, and didn’t want to solder a header to each board. The solution? Pull the pins out of a female header. It works in a pinch, but you probably want a better solution for a more permanent setup.

Half of building a PCB is getting parts and pinouts right. [Josef] is working on a tool to at least semi-automate the importing of pinout tables from datasheets into KiCad. This is a very, very hard problem, and if it’s half right half the time, that’s a tremendous accomplishment.

Last summer, [Voja] wrote something for the blog on building enclosures from FR4. Over on he’s working on a project, and it’s time for that project to get an enclosure. The results are amazing and leave us wondering why we don’t see this technique more often.

A Networked Analog Clock

Even in the face of an Internet of Things grasping for a useful use case, an Internet-connected clock is actually a great idea. With a cheap WiFi module and a connection to an NTP server, any clock can become an atomic clock. [Jim] decided to experiment with the ESP8266 to turn a cheap analog clock into something that will display network time using a bunch of gears and motors.

The clock [Jim] chose for this build is an extremely cheap clock pulled right from the shelves of WalMart. This clock uses a standard quartz clock mechanism, powered by a single AA cell. The coils in these quartz movements can be easily controlled by pulsing current through them, and with a few a few transistors and diodes set up in an h-bridge, an ESP8266 is quite good at setting the time on this clock.

The software for this clock first connects to the WiFi network, then checks an NTP server for the true time. Once the ESP8266 gets the time, it starts hammering the coil in the clock movement until the hands are where they should be.

[Jim] says the project needs a bit of work – there is no feedback on the clock to determine the position of the hands. Instead, the time is just set assuming the clock hands started off at 12:00. Still, even with that small fault, it’s a great build and a great exploit of what can be done with a cheap quarts clock movement.

If you’d like to go to the opposite extreme of cost and complexity, how about a DIY retro atomic clock?  Or if you’re in need of a wakeup, we’ve seen a ton of alarm clock posts in the past few weeks.

Audio-coupled Smoke Alarm Interface Sends Texts, Emails

The Internet of Things is getting to be a big business. Google’s Nest brand is part of the trend, and they’re building a product line that fills niches and looks good doing it, including the Nest Protect smoke and CO detector. It’s nice to get texts and emails if your smoke alarm goes off, but if you’d rather not spend $99USD for the privilege, take a look at this $10 DIY smoke alarm interface.

The secret to keeping the cost of [Team SimpleIOThings’] interface at a minimum is leveraging both the dirt-cheap ESP8266 platform and the functionality available on If This Then That. And to keep the circuit as simple and universal as possible, the ESP2866 dev board is interfaced to an existing smoke detector with a simple microphone sensor. From what we can see it’s just a sound level sensor, and that should work fine with the mic close to the smoke detector. But with high noise levels in your house, like those that come with kids and dogs, false alarms might be an issue. In that case, we bet the software could be modified to listen for the Temporal-Three pattern used by most modern smoke detectors. You could probably even add code to send a separate message for a CO detector sounding a Temporal-Four pattern.

Interfacing to a smoke detector is nothing new, as this pre-ESP2866 project proves. But the versatile WiFi SoC makes interfaces like this quick and easy projects.

Continue reading “Audio-coupled Smoke Alarm Interface Sends Texts, Emails”

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.

The Latest, Best WiFi Module Has Been Announced

A little more than a year ago, a new product was released onto the vast, vast marketplace of cheap electronics. It was the ESP8266, and this tiny and cheap WiFi module has since taken over the space of hobbyist electronics and become the de facto standard for connecting tiny microcontrollers to the Internet.

Now there’s an upgrade on the horizon. [John Lee], the public face of Espressif, the makers of the ESP8266, has announced the next product they’re working on. It’s called the ESP32, and if the specs given are correct, it looks to be the next great thing for the Internet of Things.

The ESP32 will now contain two Tensilica processors running at 160MHz, compared to the ‘8266’s one processor running at 80 MHz. The amount of RAM has been increased to 400 kB, Bluetooth LE has been added, WiFi is faster, and there are even more peripherals tucked away in this tiny piece of silicon.

The new ESP32 includes new, simplified APIs and unlike when the ESP8266 was announced, documentation in English.

Right now, Espressif is beta testing the ESP32, with about 200 boards manufactured so far. If you’re one of the few lucky people who have one of these boards on your workbench, we’d love to see your take on it.