0

I throw this highly important question, and refer you to my other threads in which I tackled this myself (learnt a WHOLE lot, and VERY important stuff indeed, could literally avoid you DYING from doing Arduino projects! ....)

  • (PS- many thanks to @ChrisStratton which pointed me out -as only good teachers can- in the right direction, motivating me to dig deeper into my original question and learn something about power supplies in the process...)

First thread

Second -related- thread

Please also have a look at this (very good read, and very good practice advice given there, too!):

Link you really SHOULD visit if you plan on powering inside-appliance Arduino or general uC low-Voltage project from the same applicance's supply

I wish you to comment all that you can (and we need) in order to clarify this important question.

I now know a couple of very GOOD reasons why you should be aware of such concrete kind of uC project, but am also pretty sure a couple of very much knowledgeable folks out there can answer this to full details and logic.

Thanks for any insight in advance!

mosagepa
  • 75
  • 4
  • What does the source to the non isolated power supply that you have in mind, come from? is it DC or AC direct from the wall? – user103776 Oct 05 '20 at 09:56
  • @AntonIngemarson Nice comment, of course we're talking mains AC coming in to the small domestic applicance here (think a coffee machine, as in my project, or maybe a LED controller AC to 24DC or whatever). These usually come with any kind of transformer-less Ac-Dc kind of e.g. using LinkSwitch(tm) switcher ICs. You actually have either the mains or the neutral going "direct" (well, just a 1mH typical inductance in the way) to your either GND or +5/+12 whatever, that's the risk of electrical shock if one doesn't know what doing... – mosagepa Oct 05 '20 at 10:16
  • My main problem here (after dealing with, and properly *understanding* both the PS schematic and electrical safety precautions), how could I add up another, reinforcement *isolated* power supply to the uC or uCs (a wall-wart if you wish) and make sure that attaching GNDs together we don't have a 230VAC frying your uC design thru "ground". Since most appliance hobbyist-designed "user add-ons" might deal with this concrete problem, namely: the ESP chips draw on a relative lot of power (350mA peak, while these non-isolated PSUs give usually only as much as say 80-200mA depending on the IC)... – mosagepa Oct 05 '20 at 10:26
  • 1
    There are plenty of questions and answers on this site about the care that must be exercised when using a non-isolated power supply connected to AC mains voltages. – Andy aka Oct 05 '20 at 10:37
  • This site is for short, concise questions that can have concise answers. Your reference to "threads" indicates you are trying to use it as a discussion forum, and that is not the purpose of this site. – Chris Stratton Oct 05 '20 at 12:37

3 Answers3

2

There is only one 'good' reason for using a non-isolated power supply - because you want to get the unit price down as low as possible for mass production.

But you are talking about using an Arduino / ESP01 / ESP32, which screams 'hobbyist project'. In this application it is likely not safe, as the hobbyist will probably want to tinker with the device while powered up, but probably won't be fully aware of the dangers involved. Also the hobbyist's design and constructions skills may not be good enough to produce a safe product.

Non-isolated power supplies are actually quite tricky to design properly, particularly when they need to produce significant power at low voltage. The ESP32 can draw up to 230 mA. Supply voltage over 3.6 V will kill it. Getting this low voltage and high current without a transformer is difficult.

Fully isolated supplies are so cheap now that making a non-isolated supply that is safe for both the load and the maker/user is probably not worth the small cost saving. Factor in design/debugging resources and likely destroyed devices, and it could easily end up being more expensive.

Bruce Abbott
  • 55,540
  • 1
  • 47
  • 89
  • Now *these* are the real, practically useful answers. Both insightful *and* technical. Thanks man. – mosagepa Oct 05 '20 at 18:09
  • And yeah surely unit cost was considered when they (the coffee machine designers) conceived this PCB. So that's the spark that ignited my interest to fit my (admittedly) hobbyist project into such. Maybe just for the fun of it, ok, which seems dangerous enough because, as you said and I myself am noticing fast, there are some quirks you DO have to take into account. We're so used to plug the wall-wart and feed the Arduinos and stuff thru the typical barrel DC jack that we leave AC concerns aside. This *non-isolated* AC-DC power one can then see as "readily available" when that's not the case. – mosagepa Oct 05 '20 at 18:13
2

Using a non isolated power supply just means that your entire device needs to be electrically isolated... tactile switch metal shields, screws holding the PCB... everything. And preferably any metal parts on the chasis to be electrically earthed (to a metal rod planted few feet deep into the earth outside your house). And no connectors (ISP headers, USB... etc) for access from outside, unless every single wire is also isolated with optocouplers or pulse transformers etc... Also, please have a mains fuse in your device.

I did not go through your previous questions properly, but it may be that the buck converter is drawing too much current at startup, and your coffee machine cannot provide that.

Indraneel
  • 2,117
  • 1
  • 17
  • 24
  • That was the case. Fortunately in my specific case, I already got the optoTRIACS and a new, reliable AC-DC PCB mounted +5V, 2A supply to which I should now connect my uCs. The optos will be isolating the "commands" from such to the TRIAC gates. I have yet to make sure with full study eveything will be safe. Btw, the original PCB power supply section (a non-isolated) does have a resistor fuse. If I supress/bypass that section, obviously I'll add some kind of convenient fuse to the new, isolated PCB. – mosagepa Oct 05 '20 at 18:18
2

Is a non-isolated power supply a good/safe option for “inside the case” Arduino / ESP01 / ESP32 / whatever control using the appliance's PS?

If you want to build thousands of units, then yeah.

If this is a hobby project, then no.

Isolating your microcontroller from mains requires an isolated supply, and probably optocouplers to talk to whatever non-isolated device you want to control. Realistically, you're looking at a BOM cost of... something like 5 bucks?

I'm not counting relays, since if you need a relay to switch something, you'll need it whether you want isolation or not.

This is definitely worth it for the ability to plug in a laptop directly to program/debug your microcontroller, use a scope, etc.

bobflux
  • 70,433
  • 3
  • 83
  • 203
  • 1
    If, as is my case, the AC switching (here TRIACS) are already in a PCB, and we rely on a separate module to power all the "hobby" mess (after fully study and consideration of concerns), and buy the relevant optotriacs (as you pointed out, too), then I think is doable so I really think my post can *both* warn users *and* serve as a guide to the issues that must be tackled. – mosagepa Oct 05 '20 at 18:16
  • 1
    You can bet if I end up finishing this, will be a pleasure to interact with this coffee appliance. As I said, it already has two back USB ports installed for that, *along* with a DB15 por direct signal diagnosing (e.g. of the sensing resistance from the temp gauge, for the LED status, and for the bits controlling the TRIAC gates -now the corresponding optoTRIACS). The algorithm in the ATTiny has been already providing me with fine creamy, variable algorithm-made coffee for a couple weeks now (still not WiFi-operated as adding the ESP is precisely what motivated my original post/s) – mosagepa Oct 05 '20 at 18:23
  • 1
    Then you don't wanna see the current "physical" status of the uC part... built on protoboard, soldered and that, even glued pieces in some parts... but I'll really leave the full availability of my schematics (and code) until I can properly finish a working prototype with the new PS. :) – mosagepa Oct 05 '20 at 18:29