MOSFET issues

Thread Starter

Jassper

Joined Sep 24, 2008
84
I have this basic circuit x2 connected to 2 different I/O pins on a micro, one controls a mini air pump (K1) and the other controls a water valve Solenoid (also in place of K1) Both the pump and the Solenoid are off board, all other parts are on the same board as the MCU:

And I have 2 issues:
#1. If the Solenoid(K1) is ON (output of the MCU is high) the Solenoid is energized and opens as expected. If the second output of the MCU goes high and runs the mini air pump it (I assume) spikes the MCU and the MCU output for the Solenoid goes low and shuts off. I am thinking I need a decoupling cap on the outputs of the CPU?

#2. The same 12 volt power that powers the Solenoid and pump also powers a 7805 that powers the MCU (not shown, but standard stuff). If I remove the 12v input power to the circuit board, but leave the 12 volt power on the solenoid (of board) the solenoid passes power through and powers up the 7805, powering up the MCU. How do I prevent this back feed? I've tested the Schottky and the LED and they both check good.

Thanks
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Hi Jassper,
1) A likely situation for this occurrance is that the input cap for the 7805 is getting drained. Use a diode between the 12v supply and the cap on the input of the 7805 to keep the motor from discharging the cap. You may want to add a 12v Zener after the diode to ground to ensure that any spikes on the supply in gets clamped to ground.

2) You really need to show your entire circuit schematic, and make certain that your actual circuit agrees with the schematic.
 

Thread Starter

Jassper

Joined Sep 24, 2008
84
How have you been :)

1) I thought a couple times that the MCU was actually re-booting and not just shutting off the output. So what you said makes sense.

2) after looking at the board and following the path, it appears that the 12v power comes from the Solenoid, enters the board at the top of the fuse and goes through the Schottky back to the input of the 7805. But the Schottky is needed to protect against the flyback. I'm not sure how to correct this. I'll have to think about this one and do more research.

Thanks

EDIT
I think I just killed two birds with one stone. Actually your solution to #1 allowed me to add a second Diode and separate the 12v supply between the 7805 and the 12v feed t to the pump. I will test this in the morning, a big thanks.
 
Last edited:

tracecom

Joined Apr 16, 2010
3,944
You should put current limiting resistors between the PICAXE outputs and the gates of the MOSFETS.

ETA: I thought I read PICAXE in one of your posts, but maybe that was another thread. If your uC is not a PICAXE, maybe you don't need current limiting resistors?
 

Thread Starter

Jassper

Joined Sep 24, 2008
84
You should put current limiting resistors between the PICAXE outputs and the gates of the MOSFETS.

ETA: I thought I read PICAXE in one of your posts, but maybe that was another thread. If your uC is not a PICAXE, maybe you don't need current limiting resistors?
It's an ATMEGA, it's there I just forgot to show it. But thanks.
 

Thread Starter

Jassper

Joined Sep 24, 2008
84
Well,... #2 is fixed, thanks SgtWookie

However I am unable to reproduce #1 on the bench with a regulated power supply. So I am starting the think again that the issues is some type of interference, bad grounding or line spikes caused by the pumps. (gota invest in a scope)

Not sure if the MCU is re-booting or not. there is a LED that will blink when the MCU reboots and I have seen it blink - HOWEVER, while monitoring the serial I can see that other variables that are set, stay set. Also while the pump runs, I get some garbage on the serial line. The pump has it's own 10uf cap across the poles of the motor.

I will have to gather more data.
 

Thread Starter

Jassper

Joined Sep 24, 2008
84
You might have a ground loop. It would help to see a photo of the whole layout.
Yep I agree. I will get something up as soon as I can and after I gather more info. I am trying to get it to replicate on the bench as the situation that it occurs in has "left" for the time being.

Thanks for your help
 
Top