2
\$\begingroup\$

WARNING: If you try to do something similar to this (using a non-isolated small power supply inside one of your home appliances in an attempt to provide power to "user-added" functionality like e.g. WiFi control or Arduino control inside the case of the appliance), or in any event if you even don't know what a non-isolated Power Supply is to begin with, then please have first a look at this very good read (and practice):

IMPORTANT: Good info on using non-isolated Power Supplies for your Arduino or small uC, low voltage projects

I've learnt myself a couple of two HIGHLY important things from that link. Thanks to all the people that commented down the road and in fact adviced me on further investigation before fully embarking on this project's quirks...

Anyway, let's go to the full story:


In the process of adding WiFi-activation capabilities to an express coffee machine, I've added an ESP01 which receives the coffee "commands/presets" plus (and because of the limited count of pins in the ESP01) a Tiny85 "algorithm microcontroller" which receives line in form of pulses from the ESP01's GPIO2 pin and executes all the control logic for the TRIACs activating the pump, heater element and also controls the machine's only visible LED.

This design works like a charm when e.g. I access the back-installed USB ports in order to program/ flash one (or both) of these devices.

But as soon as I try to use the design when getting power from the coffee machine's own 5V (well, 4.5) rail, it works right but as soon as the Tiny85 acts e.g. on the LED to activate it, ALL power goes into a kind of oscillation (0.5 secs period or such), in which all goes into blinking, the LED, the power to the 3.3v regulator (for the ESP) AND basically all the system.

No smoke, no "fried part" odor, just that, oscillation of power rails, I guess it's from the (whichever) regulator on the original coffee board (5v.reg) and my 3.3.reg (either internal to the Tiny, which i think there isn't any, or most probably the one I inserted for the ESP01), but curiously I can remember a "basic test" of my configuration in which even bypassing the 3.3v-reg (which is hazardous for the ESP01, so I just tried it for a couple seconds) it went also into oscillation!

(Just for the record, whenever I program the uCs I obviously connect this design to the USB port in my computer WITHOUT the machine being AC-powered.)

So I guess it's either a case of coupled oscillating of two regulators happening, or just a "lack of power" in the main regulator of the machine which causes it to shut down and then "reboot" and this goes on and on...

But thing is, I don't want to have a "secondary" battery feeding the ESP or Tiny separately, and this could case overheating of such batteries too, I'm afraid, so... what's my chances? How can I get rid of this oscillation? Tried to isolate each rail with its own Schottky diode (solution read elsewhere) but did not succceed.

Any ideas? Both for causes and remedies... Thanks for any input!

PS-(rough paper handmade "schematic" added) ALSO, ADDED SCHEMATICS OF ORIGINAL POWER SUPPLY SECTION. See last pictural below!

ROUGH SCHEMATIC

PS2- (picture of said/ original coffee machine board, the power supply section is located to the right edge... the electrolytic replaced by a 220uF was an SMD one, which was badly burnt due to a short circuit but otherwise machine is working good, only that as long as BOTH ESP and Tiny85 uCs are on, it seems the PS gets fully loaded and so the oscillations!)

ORIGINAL MACHINE'S PCB INCLUDING POWER SUPPLY AREA (TO THE RIGHT)

PS3- I measured the LED's current when ON and it's just about 3.42 mA, so I think current overload due to LED switching is not the real cause...

PS4- Some other scenario currents measured: here are the results. Based on these, I can mostly sure tell it's a textbook case of original PSU's underpower (it had originally just to power a small 16F Microchip uC, and a couple gate currents for the TRIACs). Any ideas on how can I deal with this? Just dropping out the original PSU is not a good solution to me, because it would involve translating all the TRIAC and isolation planes etc. out to another PCB which then would need a proper full PCB redesign for this, it now just being a "simple" add-on if you wish...

CURRENTS MEASURED SO FAR:

  • LED on consumption: 3.4mA
  • With Tiny85 "algorithm" uC powered (still w/out ESP01 being fed): Boot: 17mA Idle: 23mA When LED on: 19.6mA
  • With Tiny85 AND the LM2596 DC-DC 5 to 3.3V conv, (but w/out a load): Boot: 31.3mA Idle: 36.8mA When LED on: 33.8mA
  • With just the LM2596 Dc-dc module on (this time do feeds the ESP01 subboard): sustains 80-85 mA without PS oscillation, but a bit quirk behaviour i.e. some current ripple in the neighborhoods of 80-90 mA.

-Confirmed that could about the current limit of the original PSU, since: with BOTH uC's connected, goes on OSCILLATING (0.5secs on.off current behavior): goes from 0-20mA briefly uo to 90-110 mA, then cycles.

Notice that I added up a 470uF "reservoir" cap to the 5V rail upon entering the LM2596 (think it's redundant now, since the LM2596 module has its own SMD electrolytics onboard), and a 22uF is in the 5V rail at original PCB level (just before going out the two cables leading to my "addon").

PS5- My first (partly wrong) draft of original Power Supply schematic

MACHINE’S ORIGINAL POWER SUPPLY SECTION SCHEMATIC

PS6- I corrected the schematic (posted new version), also posted a capture showing the "Application" which the Datasheet for the Switcher IC illustrates, which is mostly identical to my own case, although for 12V output, not 5V.

(CORRECTED) MACHINE'S ORIGINAL POWER SUPPLY SECTION SCHEMATIC

APPLICATION IN THE DATASHEET, WITH A POWER SUPPLY MOST SIMILAR TO MY CASE (BUT 12V, NOT 5V)

\$\endgroup\$
44
  • 1
    \$\begingroup\$ In regards to figuring out a single power source of my own, not really practical, because remember there's already a PCB here in the machine which all the TRIACS and stuff there... I'll try to guess which regulator this is using for the 5V, since it originally had just a PIC 16F15325 I guess it was designed with only some dozens of mA capability. \$\endgroup\$
    – mosagepa
    Sep 29, 2020 at 12:27
  • 1
    \$\begingroup\$ @ChrisStratton thanks for this, but as I just typed in my edits, my concern is, having to replace the PSU entirely involves getting the TRIAC stuff out the original board and then I'd need to figure out by myself a proper full PCB replacement. There might be an easier path, or I'd need some advice on how to maybe leave the TRIACS there and try to "feed" them from my "add-on" which would need to be properly fed by external PSU. In any case I'd need to figure out how NOT to have the "addon" PSU interfering with the original i.e. I've seen that two regulators in parallel are not good are they? \$\endgroup\$
    – mosagepa
    Oct 2, 2020 at 17:09
  • 1
    \$\begingroup\$ @ChrisStratton I get the GND tying, but I was worried if I feed all my "logic" (the two uCs) from another say brick PSU, at 5 volts, how to avoid any rail differences going bad? The TRIAC control shouldn't be a problem, should it? It's not pleasant to have a brick module (it does not fit in the insides anyway). And, take into account, when I tried to have the uC connected to USB and then turn on the coffee machine, AC protection at home went down (no smoke or anything, just it shunted off). That's why i did not insist on separate PS even with batteries. So I guess isolation is an issue here? \$\endgroup\$
    – mosagepa
    Oct 2, 2020 at 17:26
  • 1
    \$\begingroup\$ @ChrisStratton The TRIAC circuitry I got figured out a kind of schematic, the Power Supply section you can see from the picture, that it's not very complex, you can see a varistor, a couple inductances there, a couple common chips in there, can't see even a transformer, so I guess it's not a SMPS after all? Then not insufficient for the original design (100mA max. from my guessing). When you refer to "opto" activating the TRIACs, would an optoisolator such as 6N138 work to activate the TRIAC gates? (these gates I have in separate cables already). Any other concern regarding isolation? \$\endgroup\$
    – mosagepa
    Oct 2, 2020 at 17:32
  • 1
    \$\begingroup\$ The design as crude as it may look, it's a nice one, I had hopes of getting it to work. It ACTUALLY works in regards to the uC and WiFi logic, I've tried actually sending "short coffee" or"long coffee" commands. I've also used already the "algorithm" (offline mode, no ESP) programmed in the Tiny85 to actually make myself coffee for some days now. I wouldn't mind external "ugly" black power brick if it needs, what makes me mad is this power issue, apart from that and from isolation concerns, I'm proud of my algorithm and I can get around my uC chops quite a bit, believe me (just not PS savvy). \$\endgroup\$
    – mosagepa
    Oct 2, 2020 at 17:34

1 Answer 1

2
\$\begingroup\$

First, if your "LM2596" is the usual $1 module from aliexpress which has counterfeit LM2596, "cost-optimized" inductor which saturates on every peak, and no-name general purpose caps totally unsuitable for switching supplies, place it where it belongs: in the recycling bin. As an alternate solution you can run it at rated current until the capacitors die, but make sure it doesn't power anything expensive. Output ripple on these things is just ridiculous.

An offline 3.3V supply for your ESP like this small PCB mount Meanwell IRM-02-3.3 costs 5 € which is much cheaper than the time you'll spend reverse engineering and debugging your current setup. Plus it won't start a fire or electrocute you, which is always a good thing.

enter image description here

If you want a replacement for your "LM2596" there are many PCB mount DC-DC modules available, like these from CUI. Plenty of choice available on the digikey/mouser/farnell search engine. At 2€ each, for one-off projects, it isn't worth the time designing a DC-DC and reading all these datasheets. Plus they're tiny and efficient.

enter image description here

For your project I'd use the offline isolated supply, and an opto to isolate the coffee machine from your ESP circuit. Then the whole project is isolated from mains and safe, and you can use the programming/debug probe.

Isolated triac drive can be done with an opto-triac like MOC3041. Here's a random example from the net:

enter image description here

\$\endgroup\$
15
  • \$\begingroup\$ I gave thought already to some of your helpful suggestions, really. The "LM2596" might not be entirely reliable this I know from the beginning, but then it had delivered 3.30 Volts exact up to the last digit (at least according to my DMM which could be wobbly itself but not up to consistently cancel the difference.) In any case, if I go along your plan, how will I power the TRIACs? Remember, these have to supply mains to the heater and pump, and I want them to operate in the same original PCB as they're currently seated. Just need to "bypass" uC power here, with its own wall wart, I guess? \$\endgroup\$
    – mosagepa
    Oct 5, 2020 at 10:52
  • \$\begingroup\$ Remember, the problem here is that I initially wished the appliance's onboard PSU (off-line one, 80-90mA max.) would be able to power my uC add-on. But since the add-on includes an ESP01, 80mA do not suffice (so the oscillation, which upon investigation I found caused by the LNK3202 "auto-restart" function on overcurrent). My LM2596 is not a direct Chinese clone (sourced by AZ Delivery, good and known German dealer) and is giving me 3.30 to the point up to now (current measurements given in my orig. post). Problem is how to wire up another (and isolated) PSU along with the existing PCB's \$\endgroup\$
    – mosagepa
    Oct 5, 2020 at 11:03
  • \$\begingroup\$ You can use MOC3041 opto triac as an isolated triac driver... \$\endgroup\$
    – bobflux
    Oct 5, 2020 at 11:13
  • \$\begingroup\$ Good answer but there's no description of your solution, only a link. Links can become broken over time, rendering your answer useless. Please edit it to add text in it and I'll upvote. \$\endgroup\$
    – TonyM
    Oct 5, 2020 at 11:22
  • \$\begingroup\$ @bobflux Thanks so much, so far you've been the only one providing some practical way out of my stomping blocks with this design! :) Let me see whether I get the idea: I guess I can: 1) Calculate max. total DC current envisioned here, 2) Buy one of those non-isolated "brick" power supply you advice, 3) feed new brick from the mains (in parallel to the old PCB, remember this is needed to feed the TRIACS onboard), 4) somehow insert the "new" +5V line into appropriate point in the old PCB (bypassing maybe some diode/s so the old PS components do not interfere with this new, powerful enough +5? \$\endgroup\$
    – mosagepa
    Oct 5, 2020 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.