decoupling unwanted interrupts

Discussion in 'General Electronics Chat' started by engelb, Jul 11, 2013.

  1. engelb

    Thread Starter New Member

    Jul 11, 2013
    3
    0
    I have the following circuit where an arduino nano is controlling a number of 12v devices; a 12v rgb led strip switched using transistors and also a 12v solenoid valve switched using a relay. For power I'm using a desktop ATX psu, 5v going to the nano and 12v going to the solenoid/leds.

    [​IMG]

    Within my sketch, pin2 (INT0) is pulled high using its internal resistor and listening for interrupts on a falling edge when it is pulled to ground.

    The problem I'm currently facing is whenever the solenoid valve is switched on it somehow manages to pull pin2 low and fire an interrupt, causing unwanted behaviour. As part of my troubleshooting I replaced the solenoid valve with another 12v device (non-inductive) and the circuit performed fine with the relay switching the device on/off without any unwarranted interrupts being fired. As another test I also isolated the solenoid valve from the nano by powering it off a second discrete power supply and again it solved the problem.

    I'm trying to figure out how to modify the above circuit so I can continue to use a single power supply without the solenoid valve firing these unwanted interrupts. I asked this question elsewhere and was pointed towards "de-coupling" but reading up on that subject left me with more questions and I'm still wondering how to solve this problem. Are there any easy solutions to this?
     
  2. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    It's probably not pulling int low, rather you're getting ringing on your supply rail and that's causing false triggering. Solutions to this problem inculde (you guessed it) decoupling the power to your controller with proper decoupling capacitors, running your relay on a seperate power supply ( as you already discovered ) using a snubber network, which can be difficult to do and good circuit layout technique. Proper design dictates using the first two solutions, decoupling and isolation, as well as carefully laying out the circuit. If there is a 'shortcut' to solving this issue; it won't be robust.
     
  3. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    You might consider placing a dummy load - like a small automotive light bulb - on the 12V rail all the time. Some supplies regulate better when loaded. It may not help but it's sure easy to try.
     
  4. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Also, make your life easy and get rid of the relay, unless you ABSOLUTELY require it. If you think you need it, then use it properly. It'll save you heartache in the long run.
     
  5. engelb

    Thread Starter New Member

    Jul 11, 2013
    3
    0
    Thanks for the quick responses.

    I was wondering about that; the behavior confused me since it was causing interrupts and not necessarily resetting the nano so I wasn't sure if de-coupling caps would apply here. My reading on the subject then tells me I need to order both higher value electrolytic and smaller value ceramic caps to filter both low/high frequency noise; can someone tell me the values I should be considering?

    Also, would there be any point in placing decoupling caps 'around' the solenoid valve - would that lessen the effect it has on the rest of the circuit?

    I would have used another transistor but I don't have any to hand capable of the 1.5amps the solenoid valve draws and the relay module was spare. I'll pick some up though. Or perhaps a mosfet since I haven't dabbled with those yet.

    Will test that out as a short term solution.
     
  6. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    That's sort of like saying, "I'm climbing the side of a building and I'm not sure if a safety harness applies here." Decoupling is part of any robust design. It ignore important design principles is just asking for trouble.
     
  7. engelb

    Thread Starter New Member

    Jul 11, 2013
    3
    0
    Nice analogy. Duly noted.

    Could you comment on the question of adding decoupling caps 'around' the solenoid valve? Would it be right to say a cap there would slow down the demand the solenoid puts on the psu when switched on which may make it regulate better?
     
  8. Meixner

    Member

    Sep 26, 2011
    116
    21
    Try a diode across the solonoid coil.
     
  9. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,024
    A catch diode across the solenoid coil (preferably in series with a 12V zener, anode to anode) will help by shunting the collapsing field which otherwise appears as a large voltage across the relay contacts, making arcs. You can omit the zener but it makes the field drop faster. Don't omit the diode. A 1N400x will do it.

    Leave the diode across the relay coil but consider the diode/zener combination. You DO want the field of the relay coil to decay fast to get those contacts open smartly. Here's some info about that..

    Consider using an external pullup resistor for the IRQ line. A lower impedance (stronger pullup) will take more of a hit. A small cap (to put an RC on the IRQ input) will also help if you can afford it.

    All that said, the previous posters have a point regarding relay contact noise. A solid state solution would be a good one. Don't forget that relay contacts wear over time with increasing noise as they do. Ask me how I know this..

    Good luck!
     
    Last edited: Jul 11, 2013
Loading...