you need to connect the serial interface to program them, DO NOT CONNECT mains side wiring, the serial is not isolated.
when you remove the pcb from the plastic boxing, the reset/mode push button is no longer constrained to just the z axis by the cover, suffice to say it’s flimsy in the x & y directions is an inadequate description.
stephen
https://www.itead.cc/wiki/Sonoff
the compact design on the pcb doesn’t look all that safe after all
i’m thinking perhaps we can ‘do a better job’ if we use stm32 and drive relays & design the pcb for better safety?
the only thing is that designing for mains voltages possibly take some skills/learning about it.
e.g. if mains is 220 v ac, that would be 310 v ac peak?
that said it would seem that many of the ‘commercial’ electronics running on mains aren’t that safe after all, despite its plastic enclosure
This makes it extremely dangerous to play with.
This sort of power supply method is very common in cheaper wireless mains controlled switches e.g. the WattsClever banded range use the same technique as do the generic 433Mhz wireless remote control switches.
However, they are designed as a consumer product and often have special screws to stop the, being taken apart, so that people don’t kill themselves.
Apart from being dangerous to work on, these transformer-less PSUs are very inefficient as they dissipate several watts of power all the time, and get quite warm.
I don’t think they are legally allowed to sell devices with this sort of PSU in Europe any more ( not sure when the laws take effect), but they gave rules about standby current on devices, and normally this sort of PSU greatly exceeds those limits
There are other technologies which provide low loss transformer-less solutions, ( I for the IC name but I have a few of them), but they are more costly and hence companies still use the old method.
Btw. In my experience these sorts of PSU have a high failure rate after a few years, as the heat stress tends to kill them, and also the stress on the capacitor is quite high and it can also fail.
… As you can tell, I am not a fan of these devices ![]()
and @roger, a quick google tells me the standby power of the sonoff is about 0.5W, seems reasonable?
A lot of my older wireless mains switches take 1 or even 2 W in standby
[RogerClark – Sat May 19, 2018 9:44 pm] –
Perhaps they have some hybrid circuit to reduce the standby powerA lot of my older wireless mains switches take 1 or even 2 W in standby
btw, isn’t the kind of powersupply in the sonoff identical to what is in smart bulbs (philips hue etc…). This kind of power supply is pretty standard for smart devices. And i assume they can be made quite efficient, otherwise they’d indeed quickly get into trouble with the european laws (or at least get a terrible energy rating). And indeed, it causes the circuit to be live when connected to mains, but it’s nicely put away in it’s box, and you don’t plug anything into it, so why is that a problem? When reprogramming, you disconnect them, and they’ve got a nice programming header that’s pretty much identical to the bluepill header (so including gnd & vcc).
I’m not going to say these are the highest quality devices, but they’ve got quite a good reputation (including that when people report safety issues, a new revision is quickly released), and just berating them without even bothering to check the facts/trying them for yourself doesn’t really add much to the discussion >_<.
They seem to have a transformer, so some parts of the circuit may be isolated, but they use 3 differnt symbols for ground and it’s hard to know if they are all connected together or not
It looks a bit like a switch mode PSU rather than a transformerless PSU, but doesn’t seem to use the normal opto isolated feedback system
Hence why it’s only taking half a watt in standby
So I stand corrected and should find and read a schematic before I talk rubbish..
i just don’t want to imagine the blue smoke when the laptop usb gets floated on the mains.
OTA does help though, one day i’ll figure out how to do OTA
srp
[zmemw16 – Sun May 20, 2018 10:09 am] –
their documentation has reams of DON’T connect mains warnings when programming throughout.
i just don’t want to imagine the blue smoke when the laptop usb gets floated on the mains.OTA does help though, one day i’ll figure out how to do OTA
![]()
srp
The problem is that its so easy to forget its turned on an accidentally connect the USB etc.
On several occasions I’ve been doing things with mains based units, thinking they were turned off or disconnected, only to find they are still connected and turned on.
In one case the device was turned off via its own mains switch, but I had the lid off (the HiFi amplifier in this case), and I learned my arm over the unit and touched my elbow onto the input to its mains switch – which was still plugged into the wall socket.
So I got a bit of a jolt, but nothing noteworthy!
I’m sure anyone who has done any work on mains based systems has similar stories.
slightly silly question – what’s australian / new zealand mains voltage ?
one difference between a basic sonoff and their pow series is the mains connectors, basic has terminal blocks with screws, the pow has push points to open (moves a shutter) to allow insertion.
i suspect i’ll be tinning any more connections i make.
stephen
srp
[zmemw16 – Sun May 20, 2018 12:24 pm] –
last time i got a belt was off the casing of a ceiling light![]()
slightly silly question – what’s australian / new zealand mains voltage?
stephen
Theoretically it’s 230V, but in practice it’s much higher for me most of the time.
I have been building STM32 based dimmer controls for a while, and regularly check the mains voltage, and it’s usually above 240V, and is often around 245V
I am not sure why my measurements, taken with a variety of meters, show mains voltages well above the spec.




