Putting everything on the Internet is getting easier and easier, what with the profusion of Internet-ready appliances as well as cheap and plentiful IoT modules to integrate legacy devices. Think IoT light bulbs, refrigerators and dishwashers that can be controlled from a smartphone, and the ubiquitous Sonoff modules. But once these things are on the net, what are they talking about? Are they saying things behind your back? Are they shipping data about your fridge contents off to some foreign land, to be monetized against your will?
Maybe, maybe not, but short of a tinfoil helmet the only way to protect yourself is to build your own system. This IoT control for ceiling fans is a good example, with the added benefit that most wireless ceiling fan remotes are kind of lousy. [microentropie] didn’t like the idea of going the Sonoff route, so his custom controller is based on that IoT workhorse, the ESP8266. There are two versions, one switching the light and fan loads with relays, and one with triacs. The ESP serves up its own web page for control rather than using a cloud service, and is capable of setting up the fan to turn on and off automatically at preset times or temperatures. Everything sits in an unobtrusive box on the ceiling near the fan, but we bet this could be miniaturized enough to fit right inside the fan housing.
If some of [microentropie]’s code looks familiar, it might be because he borrowed it from his IoT rice cooker project.
While nobody is exactly sure on the exact etymology of the term, Thomas Edison mentioned some of his inventions being riddled with “bugs” in a letter he wrote all the way back to 1878. In the context of computers, any loyal Hackaday reader should know Grace Hopper’s infamous account of a moth being caught in an early electromechanical computer’s relays. To this pantheon of troublesome insects, we would humbly summit the story of a Sonoff TH16 switch being destroyed by a lowly ant.
According to [CNX Software], the Sonoff TH16 had been working perfectly for a year and a half before the first signs of trouble. One day the switch wouldn’t respond to commands, and a power cycle didn’t seem to clear the issue. Upon opening up the device to see what had gone amiss, it was clearly apparent something had burned up. But upon closer inspection, it wasn’t a fault with the design or even a shoddy component. It was the product of an overly curious ant who got a lot more than he bargained for.
Consulting the wiring diagram of the Sonoff, it appears this poor ant had the terrible misfortune of touching the pins of a through hole capacitor on the opposite side of the board. Bridging this connection not only gave him a lethal jolt, but apparently caused enough current to surge through a nearby resistor that it went up in smoke.
Now, some might wonder (reasonably so) about the conditions in which this switch was operating. If bugs could climb into it, it’s not unreasonable to assume it wasn’t well protected from the elements. Perhaps damp conditions were to blame for the failure, and the image of the ant “riding the lighting” is nothing more than a coincidence. Maybe. But sometimes you just gotta believe.
No matter what your experience level with troubleshooting, there’s always at least a little apprehension when you have to start poking through a mains powered device. A little fear is a good thing; it keeps you focused. For some, though, the aversion to playing with high voltage is too much, which can cause problems when something fails. So what do you do when you’re reluctant to even open the case? Easy — diagnose the problem with an infrared camera.
[Bald Engineer]’s electrophobia started early, with some ill-advised experiments in transcutaneous conduction. So when his new Sonoff WiFi switch failed soon after deploying it to control a lamp in his studio, popping the top while it was powered up was out of the question. The piquant aroma of hot plastic was his first clue to the problem, so he whipped out his Flir One Thermal Camera and watched the device as it powered up. The GIF nearby shows that there was clearly a problem, with a bloom of heat quickly spreading out from the center of the unit. A few IR images of the top and bottom gave him some clues as to the culprits, but probing the board in those areas once power was removed revealed no obviously damaged components.
[Bald Engineer] hasn’t yet gotten to the bottom of this, but his current thinking is that the NCP1117 regulator might be bad, since it rapidly spikes to 115°C. Still, we think this is a nifty diagnostic technique to add to our toolkit, and a great excuse to buy an IR camera. Or, we could go with an open-source thermal camera instead.
The ESP8266 platform has become so popular that it isn’t just being used in hobby and one-off projects anymore. Companies like Sonoff are basing entire home automation product lines around the inexpensive WiFi card. What this means for most of us is that there’s now an easily hackable and readily available product on the market that’s easily reprogrammed and used with tools that we’ve known about for years now, as [Dan] shows in his latest project.
[Dan] has an aquaponics setup in his home, and needs some automation to run the lights. Reaching for a Sonoff was an easy way to get this done, but the out-of-the-box device can only be programmed in the simplest of ways. To get more control over the unit, he wired a USB-to-Serial UART to the female headers on the board and got to programming it.
The upgraded devices are fully programmable and customizable now, and this would be a great hack for anyone looking to get more out of a Sonoff switch. A lot of the work is already done, like building a safe enclosure, wiring it, and getting it to look halfway decent. All that needs to be done is a little bit of programming. Of course, if you’d like to roll out your own home automation setup from scratch that can do everything from opening the garage door to alerting you when your dog barks, that’s doable too. You’ll just need a little more hardware.
If you are the kind of person who won’t use cheap Sonoff modules to control AC powered devices, we don’t blame you and you should probably stop reading now. However, if you don’t mind a little exposed AC wiring and you have a 3D printer, you might be interested in the second generation of [530 Project’s] in-wall light switch.
The 3D printed switch fits a standard box and uses the guts of a Sonoff controller. These work with all the popular ecosystems such as Alexa and Google Home. And they are cheap. Like, really cheap. If you already have a 3D printer, even counting the cost of the filament these are going to be a small fraction of the cost of a commercial switch. You can see a video about the device, below.
Judging by the popularity of “How It’s Made” and other shows of the genre, watching stuff being made is a real crowd pleaser. [Jonathan Oxer] from SuperHouse is not immune to the charms of a factory tour, so he went all the way to China to visit the factory where Sonoff IoT devices are made, and his video reveals a lot about the state of electronics manufacturing.
For those interested only in how Sonoff devices are manufactured, skip ahead to about the 7:30 mark. But fair warning — you’ll miss a fascinating discussion of how Shenzhen rose from a sleepy fishing village of 25,000 people to the booming electronics mecca of 25 million that it is today. With growth supercharged by its designation as a Special Economic Zone in the 1980s, Shenzhen is now home to thousands of electronics concerns, including ITEAD, the manufacturers of the Sonoff brand. [Jonathan]’s tour of Shenzhen includes a trip through the famed electronics markets where literally everything needed to build anything can be found.
At the ITEAD factory, [Jonathan] walks the Sonoff assembly line showing off an amazingly low-tech process. Aside from the army of pick and places robots and the reflow and wave soldering lines, Sonoff devices are basically handmade by a small army of workers. We lost count of the people working on final assembly, testing, and packaging, but suffice it to say that it’ll be a while before robots displace human workers in electronic assembly, at least in China.
The Internet of Things is developing at a rapid pace, as hobbyists and companies rush to develop the latest and greatest home automation gear. One area of particular interest to some is lighting – yes, even the humble lightbulb now comes with a brain and is ripe for the hacking.
[Tinkerman] starts by doing a full disassembly of the Sonoff B1 lightbulb. It’s a popular device, and available for less than $20 on eBay. Rated at 6 watts, the bulb has a heatsink that is seemingly far larger than necessary. Inside is the usual AC/DC converter, LED driver and an ESP8285 running the show. While this is a slightly different part to the usual ESP8266, it can be programmed in the same way by selecting the correct programming mode.
This is where it gets interesting – [Tinkerman] flashes the device with a custom firmware known as ESPurna. This firmware enables greater control over the function of the bulb, from colour choice, to speaking to the bulb over MQTT.
[Tinkerman] does a great job of walking through the exact steps needed to disassemble and reprogram the bulb, and touches upon the added flexibility given by the custom firmware. We love to see projects like this one, that give greater control over IoT devices and enable users to better integrate them with other systems.
By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more