Hacker News new | ask | show | jobs
by stavros 1808 days ago
This is a nice hack, but I'm always very wary of playing with large voltages because it's too easy for things to go wrong. Instead, for controlling mains devices, I recommend a Sonoff S20:

https://esphome.io/devices/sonoff_s20.html

I usually flash ESPurna onto it (Tasmota and ESPhome are also good choices), it's very easy to do and it's extremely reliable and hopefully has a lower chance of fire than anything I'd make.

6 comments

For just turning something on or off I've been happy with the "IoT Relay" from Digital Loggers [1][2][3]. It is essentially a power strip with 4 outlets and a control connection. The control connection can take either a DC signal from 3-60 V or an AC signal from 12-120 V.

One of the outlets is always on, and the other three are controlled by the control signal. Two of those are normally off and turn on when the control signal is present, and the third is normally on and turns off when the control signal is present.

I'm using it to control a space heater with a Raspberry Pi. The GPIO pins on most microcontrollers commonly used in DIY projects will work directly to control the relay.

[1] https://dlidirect.com/products/iot-power-relay

[2] https://www.sparkfun.com/products/14236

[3] https://www.amazon.com/Iot-Relay-Enclosed-High-Power-Raspber...

I'm looking for something similar: a power strip with all the outlets individually switchable. At least 4. So like a mix between that and a Sonoff S20.

Having three instead of four switchable outlets, and different "normally on" and "normally off" setting threw me off a bit.

The issue here is that these fancy tower fans don't have a mechanical on/off switch. So just switching the mains voltage does exactly crap.

...well not crap, mine beeps a few times when the power turns on =)

The ESP32 fiddling is required to fake button presses on the touch sensitive buttons to make it actually start.

Good Lorde how I hate capacitive touch buttons on appliances and such. I regularly brush by my icemaker (it's a tight corridor/passage), and cause the water dispenser to splash everywhere. I have a 3D-modelled overlay (basically a custom mesh) queued for 3D printing, to stop it from happening. The moment the warranty ends, I'm ripping into it, and putting physical switches.

Well, I already opened it to solder a beeper bypass switch [aka "mute button], 'cause the thing was (multi-)beeping constantly, on every action and every result! But that mod is reversible without any visible changes... which reminds me, have to do the same to the bread machine. To my detriment, appliance makers these day are extremely beeper-happy.

He's not playing with mains voltage (except to wire in the USB power supply) - the button's he's "pressing" with his relay are part of a low voltage control circuit.
But that just gives you on/off controls and maybe energy consumption, doesn't it? It won't let you play with the fan speed, which is probably something I'd want first and foremost.

I've used some TP-Link's equivalent up until the point when TP-Link decided to effectively brick it for me by disallowing control via local network because "security". I'm very concerned about someone on my WiFi turning on my kettle and boiling me some water. :)

OP uses an off the shelf USB 'wall wart' for power, everything else is <= the 5v that that provides. It's not really any more involved/risky/'playing with large voltages' than say changing the plug on a power cable, or using one of the terminal-block-style Sonoff devices.
220V are not large voltages. It's within capabilities of a properly taught highschooler to make sound circuits for mains.

It's when you get above 400V+, then the physics of electricity gets tricky.

220v is still a lethal voltage, and 220V at 10A is enough to sustain a nasty arc in the right circumstances.

An arc can have the temperature of four times the surface of the sun and will not neccesarily trip a noormal protective device due to its impedance.

Just for interest, vaporised copper has 67,000 times the volume of solid copper, this is why it makes quite a big bang.

I am an electrical engineer, most people do not fully understand the dangers of electricity and the lottery they play even at 110VAC.

The "physics" of electricty are tricky at all voltages, there are recorded cases of people dying from electric shock from a 24VDC truck battery.

>The "physics" of electricty are tricky at all voltages, there are recorded cases of people dying from electric shock from a 24VDC truck battery.

yes, that's because lethality is a combination of voltage, current and the location where those are applied to the body. Apply one charge to your foot? No problem. Apply the same charge to your chest right above your heart or in some configuration where the current flows through your heart? You are probably going to have a bad day :p

> properly taught

Key words the author did not write. While electrocution might be the first thing to come to mind, the ongoing risk of house fire might be the risk that best guides the (mis)use of hardware certified to perform a task.