Power supply causing havoc with cirquit - Page 1
Forum section: electronics / beginners

author: laus
author_rank: Contributor
timestamp: June 14, 2020, 09:43:08 pm
content: I'm building a control circuit for a pump control that will pump water out of a container. In my case empty a dehumidifier reservoir.I designed and build the following circuit:The circuit works perfect as long as I power it via my bench power supply or batteries. However my plan was to use a small switching power supply / buck converter (this one). I noticed that the pump LED glowed very dimly. Also when timed right the lower water level switch could turn the pump on. If I touched the switch wire that connects to the Base of the C1740 NPN transistor the relay rapidly opened and closed.Debugging this circuit is a pain since as soon as I hooked up the oscilloscope the circuit worked much better. I did measure once the voltage of the C1740 NPN transistor's Base without hooking up the oscilloscope to the negative terminal of the power supply. This allowed me to observe a 16v wave form shown here.Attaching the low power ground to mains earth (not neutral) seems to be a huge improvement. I don't get the 16v wave form and very rarely can I create a false trigger. But it still doesn't seem to be perfect.My questions:* What causes this strange behavior using this power supply?* Is there anything I can do to utilize this power supply?

author: TimFox
author_rank: Super Contributor
timestamp: June 14, 2020, 10:51:35 pm
content: Have you tried a bypass/reservoir capacitor from the positive power supply to common, mounted near the MOSFET? Maybe 1 uF?

author: xavier60
author_rank: Super Contributor
timestamp: June 14, 2020, 11:15:40 pm
content: It also needs a capacitor between B-E of the BJT and a bleed resistor so stop it from responding to noise and leakage.The bleeder on the MOSFET should be something smaller like 10K.EDIT: Also the power supply needs to be isolated from ground.

author: laus
author_rank: Contributor
timestamp: June 14, 2020, 11:50:08 pm
content: Quote from: TimFox on June 14, 2020, 10:51:35 pmI did try capacitors between the 5V out and its corresponding ground. But that didn't help.

author: laus
author_rank: Contributor
timestamp: June 14, 2020, 11:57:07 pm
content: Quote from: xavier60 on June 14, 2020, 11:15:40 pmWhere would you put the bleeder resistor on the transistor?The resistor on the mosfet (gate to source) is a pull up resistor if I understand it right. Are you saying that should be 10k?

author: xavier60
author_rank: Super Contributor
timestamp: June 15, 2020, 12:04:47 am
content: Quote from: laus on June 14, 2020, 11:57:07 pmPut the bleeder resistor between B-E. It's value can be adjusted to set probe sensitivity.Changing the Gate to Source resistor is optional. It wont solve the problem you have now. It will make the circuit less sensitive to leakage currents that might develop later.

author: eblc1388
author_rank: Frequent Contributor
timestamp: June 15, 2020, 02:21:35 am
content: For a supply of 5V, the value of 100K is too high and might result in unreliable circuit operation. I would suggest to change all of them into 10K instead.The following circuit is for your consideration.Circuit Operation:Upper water sensor contacts closes when water level is highLower water sensor contacts opens when water level is low1. Assume water level below lower water level, relay not energized, lower water sensor contacts remains open. 1740(NPN) base is shunted by 10K and capacitor to 0V so NPN is off, thus 6020(PMOS) also off.2. When water level rises to the lower water level sensor, its contacts closed, connecting NPN base to relay coil. But as PMOS is still off, there is no voltage on the relay coil. NPN thus remains Off.3. Water level rises until upper water sensor contacts closes. This provide sufficient base drive to turn NPN on. This then turns on PMOS and the relay. Pump starts and water level going down.4. Upper water level contacts opens as water level drops but NPN is maintain in conduction via the 10K resistor and lower water sensor contacts(closed). Pump keeps running.5. Water level drops below lower sensor and its contact opens. NPN loses its base drive and turns off, along with PMOS. Relay de-energised and pump stopped.6. Circuit arrangement ensures there is no relay chattering upon reaching either levels.

author: xavier60
author_rank: Super Contributor
timestamp: June 15, 2020, 02:33:51 am
content: Better,

author: laus
author_rank: Contributor
timestamp: June 15, 2020, 03:31:48 am
content: Quote from: eblc1388 on June 15, 2020, 02:21:35 amGood catch on the missing diode across the relay.I added a 0.1 uF capacitor and that did the trick. No more flakiness.When I added a 330 Ohm resistor in parallel things didn't work anymore. Looking at the simulator now I noticed that the resistor needs to be the same value as the other ones. Obviously the voltage drop across the 330 resistor is to low so the trigger voltage of the transistor was never reached. Also looking at the simulation I noticed that without the resistor the voltage on the transistor base goes up, extremely slow but constantly. I assume eventually the voltage gets large enough that the transistor gets triggered. Which isn't desired and why a parallel resistor is needed, to avoid the charging of the capacitor. But from where is the capacitor getting charged? Are transistors bleeding current from collector to base?Also, I still don't get why the capacitor-transistor pair is needed and why things worked fine with the bench power supply and battery. I'd really like to know this as well.

author: laus
author_rank: Contributor
timestamp: June 15, 2020, 03:53:17 am
content: Quote from: xavier60 on June 14, 2020, 11:15:40 pmOh, right there you told me that the transistor leaks. Thanks!

author: xavier60
author_rank: Super Contributor
timestamp: June 15, 2020, 04:04:30 am
content: Quote from: laus on June 15, 2020, 03:31:48 amThere are too many unknowns to say exactly why.Generally, from a mains powered supply, there is some return path to earth, and also from switch mode types, plus likely common mode noise signals.At the other end, because water is involved, there are likely DC leakage paths to earth.When either or both of these things reach the base of the BJT, it gets turned on.There can then be further interactions leading to an oscillating action.The capacitor short circuits or bypasses AC noise and the resistor bleeds away small mainly DC leakage currents.There can also be leakage in the circuit itself cause by solder flux residue, moisture and other contamination buildup.

author: laus
author_rank: Contributor
timestamp: June 15, 2020, 04:56:04 am
content: In my case the trigger was touching the wire that connects to the transistor base. Even just clipping a very long wire, not connected to anything else, did it. Probably an antenna effect that picks up RF power.I created asimulationof the effect the to the circuit in case someone else wants to play with it. It helped me visualize what we were discussing in this thread.Thanks xavier60 and eblc1388 for your patience, help and explanations.Tomorrow, I'll swap out the 100k resistors and add the drain resistor.Edit: Updated simulation to include diode across relay.

author: eblc1388
author_rank: Frequent Contributor
timestamp: June 16, 2020, 12:52:27 am
content: I have added the circuit operation info to my previous post.