Following a question I posted here a few months ago Using P-Channel mosfet with arduino I'm using pchannel MOSFET for activating a CR02 valve like this one https://es.aliexpress.com/item/1938516987.html?spm=a219c.search0302.3.30.33c06d8djwoxkt&ws_ab_test=searchweb0_0,searchweb201602_0,searchweb201603_0,ppcSwitch_0&algo_pvid=42bb562b-db52-4060-8454-5a31a442a8ec&algo_expid=42bb562b-db52-4060-8454-5a31a442a8ec-4
This valve has 3 wires, one goes to +12V the other goes to GND and the remaning one is used to open/close the valve, if this wire is conected to +12V it opens the valve and if it's unconnected it closes the valve. I'm using the following circuit to operate this valve
VIN = +12V
QD = Arduino PIN
QDV = Valve control wire
It kind of works, I can open and close the valve but once every 6 or 7 times opening or closing it causes the arduino to reset and I don't know why. I'm using a 2A power supply and the specifications of the valve says it consumes 100mA so it should be enough, I'm also using a diode to protect from the spike of voltage when the motor is turned off, any idea what can be causing the problem?
-
\$\begingroup\$ Might be a 'ground loop'. Can you show us a photo of the wiring? \$\endgroup\$Bruce Abbott– Bruce Abbott2020年09月29日 08:11:16 +00:00Commented Sep 29, 2020 at 8:11
-
1\$\begingroup\$ 1n4001 could be a little slow. \$\endgroup\$Marko Buršič– Marko Buršič2020年09月29日 08:15:48 +00:00Commented Sep 29, 2020 at 8:15
-
\$\begingroup\$ Which kind of diode should be better? \$\endgroup\$Marc– Marc2020年09月29日 08:18:14 +00:00Commented Sep 29, 2020 at 8:18
-
\$\begingroup\$ A fast switching diode, but also it could be that your PSU has no input filter and very low capacitance. A differential choke or LC filter would also help. \$\endgroup\$Marko Buršič– Marko Buršič2020年09月29日 08:22:27 +00:00Commented Sep 29, 2020 at 8:22
2 Answers 2
As @Marko wrote, a slow diode can do quite a bit of trouble. Let's look at his model to see if we can find something. dióda1
Yes, it is here: dióda2
Since it was a load around 100mA, let's try a small switching diode: dióda3
It got significantly better, but this diode will still be small here. Let's look at a better one: dióda4
So the diode would be fine. If we’re already modeling, let’s do something about the huge latency caused by the too high value Gate resistor: dióda5
The 10k resistor was changed to 1k and a miracle happened: dióda6
The delay was almost completely gone. So replacing a diode and a resistor has improved the system a lot. Finally, here are all the interesting signs from this tiny system: dióda7
If nothing helps, replace the ground wire with a thicker one. :)
-
1\$\begingroup\$ I like that you have shown the troubleshooting process and not only the final answer, very instructional, hats off \$\endgroup\$Marc– Marc2020年09月30日 09:08:38 +00:00Commented Sep 30, 2020 at 9:08
Kind of an unsatisfactory-looking fix, but you may be able to improve the by slowing the turn-on of the MOSFET (turn-off is already slow).
For example, add a 10K resistor series with the MOSFET gate.
That will reduce the demands on layout, bypassing, and even the diode since it will further slow turn-off.