I bought a cheap ESP32 board on a whim a few weeks back – it has WiFi and Bluetooth so I thought I’d better test it out by making some kind of IoT device!
After updating my Arduino IDE I to work with the ESP32 I looked for an appropriate example from the Adafruit IO library to start me off, choosing the Servo sketch . This sketch updates the position of a servo based on a value passed to an Adafruit IO feed – so for example if the feed is passed the value “90” then the servo will move to a mid-range point, the upper and lower limits being 0 and 180.
After connecting my servo to the board (VIN, GND and Pin 2) I poked it through the centre of an old clock and secured it with blu-tack, making a “pointer” by gluing a wooden drink stirrer to a servo arm.
Next I uploaded the sketch to the board, having added in my wifi details and specified the name of the “feed” that would do the controlling.
Amazingly it worked first time, the pointer moved instantly when I edited the feed values on the Adafruit IO website. Next I popped over to IFTTT and set up three new Weather Underground “applets”…
…so that depending on the weather conditions at my location, either the value 0, 90 or 180 would be forwarded to the Adafruit feed.
Lastly I grabbed some vintage BBC weather icons and printed them out, sticking them on the clock to match the three pointer locations.
This was a great bit of fun and took just over half an hour, not including the icons. It really shows how accessible the ESP32 ecosystem can be, and the weather clock has been running reliably for several weeks now.
Quite often I’ll use a Raspberry Pi for a project and people will comment “you should have used an Arduino or ESP32” – I’m certainly guilty of sticking to what I’m comfortable with, but also practically I have a cupboard full of old Raspberry Pis (2s mostly) that I want to make use of! This was an enjoyable first outing into the world of ESP32 though, and I’m certain I’ll find the ideal project for one of these nifty little boards in the very near future.