MOSFET issues

Discussion in 'General Electronics Chat' started by Jassper, Oct 2, 2011.

  1. Jassper

    Thread Starter Active Member

    Sep 24, 2008
    84
    1
    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:
    [​IMG]
    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: Oct 2, 2011
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  3. Jassper

    Thread Starter Active Member

    Sep 24, 2008
    84
    1
    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: Oct 2, 2011
  4. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    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?
     
  5. Jassper

    Thread Starter Active Member

    Sep 24, 2008
    84
    1
    It's an ATMEGA, it's there I just forgot to show it. But thanks.
     
  6. Jassper

    Thread Starter Active Member

    Sep 24, 2008
    84
    1
    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.
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You might have a ground loop. It would help to see a photo of the whole layout.
     
  8. Jassper

    Thread Starter Active Member

    Sep 24, 2008
    84
    1
    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
     
  9. Jassper

    Thread Starter Active Member

    Sep 24, 2008
    84
    1
    Just wanted to let you all know that Issue #1 turned out to be a Software issue.

    Thanks for your help.
     
    SgtWookie likes this.
Loading...