What’s Behind the Door? An IoT Light Switch

We’re not sure who designed [Max Glenister]’s place, but they had some strange ideas about interior door positioning. The door to his office is right next to a corner, yet it opens into the room instead of toward the wall. Well, that issue’s been taken care of. But the architect and the electrician got the last laugh, because now the light switch is blocked by the open door.

Folks, this is the stuff that IoT is made for. [Max] here solved one problem, and another sprang up in its place. What better reason for your maiden voyage into the cloud than a terrible inconvenience? He studied up on IoT servo-controlled light switching, but found that most of the precedent deals with protruding American switches rather than the rockers that light up the UK. [Max] got what he needed, though. Now he controls the light with a simple software slider on his phone. It uses the Blynk platform to send servo rotation commands to a NodeMCU, which moves the servo horn enough to work the switch. It’s simple, non-intrusive, and it doesn’t involve messing with mains electricity.

His plan was to design a new light switch cover with mounting brackets for the board and servo that screws into the existing holes. That worked out pretty well, but the weight of the beefy servo forced [Max] to use a bit of Gorilla tape for support. He’s currently dreaming up ways to make the next version easily detachable.

Got those protruding American switches? [Suyash] shed light on that problem a while back.

ESP8266 Internet Controlled LED Dimmer

There’s no shortage of debate about the “Internet of Things”, largely centered on security and questions about how much anyone really needs to be able to turn on their porch light from the other side of the planet. But while many of us are still wrestling with the realistic application of IoT gadgets, there’s undoubtedly those among us who have found ways to put this technology to work for them.

One such IoT devotee is [Sasa Karanovic], who writes in to tell us about his very impressive custom IoT LED dimmer based on the ESP8266. Rather than rely on a commercial lighting controller, he’s designed his own hardware and software to meet his specific needs. With the LED strips now controllable by any device on his network, he’s started working on Python scripts which can detect what he’s doing on his computer and react accordingly. For example, if he’s watching a movie the lights will automatically dim, and come back up when he’s done.

[Sasa] has provided all the files necessary to follow in his footsteps, from the Gerber files for his PCB to the Arduino code he’s running on the ESP. The source code is especially worth checking out, as he’s worked in a lot of niceties that we don’t always see with DIY projects. From making sure the ESP8266 gets a resolvable DNS hostname on the network to using websockets which update all connected clients with status info in real-time, he’s really put a lot of work into making the experience as complete as possible.

He’s explains in his blog post what needs to be edited to put this code to work in your own environment, and there’s even some descriptive comments in the code and a helpful debug mode so you can see how everything works. It’s always a good idea to consider that somebody else down the road might be using your code; taking a few minutes to make things clear can save them hours of stumbling around in the dark.

If you need more inspiration for your ESP8266 lighting project, check out this ambient lighting controller for a kid’s room, or this professional under-cabinet lighting controller.

IoT Solar Pool Heating

A backyard swimming pool can be a great place to take a refreshing dip on a summer’s day. It can also be a place to freeze your giblets off if the sun has been hiding for even a few hours. That can make pools an iffy proposition unless they’re heated, and that starts to get really expensive in terms of upfront costs and ongoing charges for fuel or power. Unless you put the sun and the IoT to work for pool-heating needs.

Preferences vary, of course, but [Martin Harizanov] and his family clearly like their swims on the warm side. With nobody using the pool when it was below 25°C (77°F), [Martin] picked up a few bits to harness the sun to warm the water. Loops of PVC lawn irrigation tubing were tossed onto a shed roof with a favorable solar aspect and connected to the pool with a length of garden hose. The black thin-wall tubing is perfect for capturing the sun’s energy, and 200 meters of the stuff can really heat things up fast. A small pump is controlled by a microcontroller — it’s not explicitly stated but we suspect it’s a Raspberry Pi — with a pair of temperature sensors to sample the water in the pool and in the heating loop. Metrics are gathered and logged by Emoncms, an open source energy monitoring app. [Martin] says he’s harvesting about 10 kW from the sun on a good day, and that the pool water in the heating loop has gotten up to a steamy 55°C (131°F) without any other energy inputs other than the pump.

Plenty of others have made the leap to solar for pool season extension, with designs from the simple to the more complex. And if you live where the sun doesn’t shine, there’s always a compost water heater.

Give the Clapper a Hand

While “The Clapper” probably first conjures images of low-budget commercials, it was still a useful way to remotely switch lights and other things around the house. But if the lights you want to switch weren’t plugged into the wall, like a ceiling fan, for example, The Clapper was not going to help you. To add some functionality to this infamous device, [Robin] built one from scratch that has all the extra features built in that you could ever want.

First, the new Clapper attaches to the light switch directly, favoring mechanical action of the switch itself rather than an electromechanical relay which requires wiring. With this setup, it would be easy to install even if you rent an apartment and can’t do things like rewire outlets and it has the advantage of being able to switch any device, even if it doesn’t plug into the wall. There’s also a built-in microphone to listen for claps, but since it’s open-source you could program it to actuate the switch when it hears any sound. It also includes the ability to be wired in to a home automation system as well.

If the reason you’ve stayed out of the home automation game is that you live in a rental and can’t make the necessary modifications to your home, [Robin]’s Clapper might be just the thing you need to finally automate your living space. All the files are available on the project site, including the 3D printing plans and the project code. Once you get started in home automation, though, there’s a lot more you can do with it.

Continue reading “Give the Clapper a Hand”

Shoehorning A Slick Spotify Remote Into An ESP8266

In 2017 Spotify finally deprecated their public vanilla C SDK library,  libspotify, and officially replaced it with dedicated SDKs for iOS and Android and this new-fangled web thing we’ve all heard so much about. This is probably great for their maintainability but makes writing a native application for a Linux or a hardware device significantly harder, at least without an application process and NDA. Or is it? Instead of using that boring slab of glass and metal in their pocket [Dani] wanted to build a handy “now playing” display and remote control interface but was constrained by the aforementioned SDK limitations. So they came up with a series of clever optimizations resulting in the clearly-named ESP8266 Spotify Remote Control.

The Spotify Remote Control has a color LCD with a touchscreen. Once attached to a Spotify account it will show the album art of the currently playing track (with a loading indicator!) and let you play/pause/skip tracks from its touch screen, all with impressively low latency. To get here [Dani] faced two major challenges: authorizing the ESP to interact with a user’s Spotify account, and low latency LCD drawing.

2 Bit Cover Art

If you’re not on iOS or Android, the Spotify web API is the remaining non-NDA’d interface available. But it’s really designed to be used on relatively rich platforms such as fully featured web browsers, not an embedded device. To that end, gone are the days of asking a user to enter their username and password in a static login box, the newer (better) way is to negotiate for a per-user token (which is individually authorized per application), then to use that to authenticate your interaction. With this regime 3rd party applications (in this case an ESP8266) never see a user’s password. One codified and very common version of this process is called OAuth and the token dance is called a “workflow”. [Dani] has a pretty good writeup of the process in their post if you want more detail about the theory. After banging out the web requests and exception handling (user declines to authorize the device, etc) the final magic ended up being using mDNS to get the user’s browser to redirect itself to the ESP’s local web server without looking up an IP first. So the setup process is this: the ESP boots and displays a URL to go to, the user navigates there on a WiFi connected device and operates the authorization workflow, then tokens are exchanged and the Remote Control is authorized.

The second problem was smooth drawing. By the ESP’s standards the album art for a given track at full color depth is pretty storage-large, meaning slow transfers to the display and large memory requirements. [Dani] used a few tricks here. The first was to try 2 bit color depth which turned out atrociously (see image above). Eventually the solution became to decompress and draw the album art directly to the screen (instead of a frame buffer) only when the track changed, then redraw the transport controls quickly with 2 bit color. The final problem was that network transfers were also slow, requiring manual timesharing between the download code and the display drawing routing to ensure everything was redrawn frequently.

Check out [Dani]’s video after the break, and take a peek at the sources to try building a Spotify Remote Control yourself.

Continue reading “Shoehorning A Slick Spotify Remote Into An ESP8266”

Literary Camouflage For Your Router

What is suspicious about the books in the image above? Is it that there is no bookend? How about the radio waves pouring out of them? [Clay Weiland] does not like the way a bare router looks in the living room, but he appreciates the coverage gained by putting it in the middle of his house. He added a layer of home decorating camouflage in the form of some second-hand book covers to hide the unsightly bit of tech.

There isn’t a blog post or video about this particular build anywhere. The photos were submitted to our tip line as-is with the note that a table-saw is involved. We can safely infer that book covers are stripped of their pages and filled with wooden blanks painted white and stuck together to look like a cluster of literature. The takeaway from this example is that our tech does not have to be hidden away like a secret, or disrupt the decor, it can be placed as functionally as possible without sacrificing Feng Shui.

If hiding behind books piques your interest, try a full-fledged version, or this smooth operator.

Thank you, [George Graves], for encouraging people to use our tip line.

Never Go To The Office Breakroom Again

If you’re tired of having to make small talk with random people in the office break room every time you need a cup of coffee, or simply don’t have the time to get up to pour yourself some more, it would be nice if there was a way you could have your cup filled for you, right at your desk. With this new drink dispenser, you won’t have to get up or even pour your drinks yourself!

We’ve certainly seen plenty of automatic drink makers, but those are more suited to parties and complicated drink mixing. This beverage dispenser is more for the person who knows their tastes and simply wants to save some time. It’s also much simpler, using a peristaltic pump for serving a single liquid from a large bottle into a glass, and using a load cell to know when to stop filling. The peristaltic pump is a little slow though, so it’s best to set the glass back in the dispenser and let it top you off each time.

We’re a big fan of time savers around here, especially when it comes to improving workflow. Of course, the best time saver is a clean, well-organized shop which will help you out whether you’re building a drink dispenser or anything else.

Continue reading “Never Go To The Office Breakroom Again”