Output to relay causing chatter.

Discussion in 'The Projects Forum' started by kamaka71, Mar 6, 2015.

  1. kamaka71

    Thread Starter New Member

    Mar 6, 2015
    6
    0
    Hello all.

    Thank you to all involved in providing this forum. I am new to the forum but not completely new to electronics. Had some schooling on digital logic, ttl, etc. and now work in the field of industrial control.

    I am building an automatic pet water fountain. This is a DIY, keep myself busy in the winter project, just for fun. I won't bore you with all the details but the circuit basically is controlling a pump with two relays, one timing and one discrete. The inputs to the circuit are 0.5cm-15cm digital optical sensors that send active low ttl signals. These signals go to a 3 input nand chip, then to a mosfet switch output to drive the relay coils.

    All is working well except for one functional problem. At the distance threshold (~15cm) of the optical sensors, the signal fluctuates from 0-5v causing the relay to chatter. I would like to prevent this from happening to prolong the life of the relay. I have looked into different circuits, comparator with hysteresis, 555 timer, etc. but am not sure what the best approach is. Don't want anyone to do my work for me, just need a push in the right direction. :)

    The ideal setup would be :

    If the input signal is fluctuating, output is low.
    Once signal is solid for more than ~0.5 sec, output goes high.

    The relay and sensor used linked below.

    Pololu Carrier with Sharp GP2Y0D815Z0F Digital Distance Sensor 15cm
    Pololu Basic SPDT Relay Carrier with 5VDC Relay (Assembled)

    Thank you in advance for any replies to the one post noob.
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    The simplest solution is to try an RC delay at the input to the MOSFET driver. Try a value of about 1MΩ in series with the gate and about 1μF from the gate to the source. Adjust those values as needed to get the proper operation.

    Do you have a diode transient suppression diode across the relay coils?
     
  3. kamaka71

    Thread Starter New Member

    Mar 6, 2015
    6
    0
    Great, thanks. Sounds like a very simple solution.

    I am using p channel mosfet switching circuit, (attached image) does that make any configuration changes for RC delay circuit?

    Oh and yes, I have diode in place in parallel w/coils.
     
  4. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,974
    744
    You say its the input to the nand gate thats fluctuating, put a RC filter on the input of the gate, then it will smooth out the fluctuations, also use a CD4093 quad nand gate ic, as that has a Schmidt gate to prevent flickering.
     
  5. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    What is +Vdd ?
    What is the range of Vin (high and low)?
     
  6. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    Change the 1kΩ resistor to 1MΩ and replace the 10kΩ resistor with a 1μF capacitor (plus side to +Vdd).
     
  7. kamaka71

    Thread Starter New Member

    Mar 6, 2015
    6
    0
    Thanks, will order a couple 4093 chips.

    5vdc, range is about 0.8 low and 4.2 high.

    I will bench test and post back my results.

    Do you fellas think it would be best to put an RC filter on each input, only on output of nand, (between nand and mosfet) or both?

    Thanks again for taking the time to reply.
     
  8. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,974
    744
    Try input first.
     
  9. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    But that requires more than one filter (the OP said he had "inputs" to the circuit).
     
  10. kamaka71

    Thread Starter New Member

    Mar 6, 2015
    6
    0
    Hi just wanted to follow up on this thread. I shot a quick vid as it seemed easier to demonstrate than torturing you with my needless ramblings.



    Still not sure the placement of the filter in the circuit, waiting on a few parts from digikey to do a full mock up. I will post back when it's all worked out.

    Thanks again for all y'alls help. :D
     
  11. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,974
    744
    Post your circuit so we can see whats going on.
     
  12. kamaka71

    Thread Starter New Member

    Mar 6, 2015
    6
    0
    Alright, here is a crude sketch. It's kind of a combo, TTL/ladder logic circuit.
     
  13. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,974
    744
    if you're happy with the result you have,leave it alone.
     
Loading...