Output to relay causing chatter.

Thread Starter

kamaka71

Joined Mar 6, 2015
6
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.
 

crutschow

Joined Mar 14, 2008
38,316
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?
 

Thread Starter

kamaka71

Joined Mar 6, 2015
6
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?
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.
 

Attachments

Dodgydave

Joined Jun 22, 2012
11,395
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.
 

crutschow

Joined Mar 14, 2008
38,316
..................
I am using p channel mosfet switching circuit, (attached image) does that make any configuration changes for RC delay circuit?
.......................
Change the 1kΩ resistor to 1MΩ and replace the 10kΩ resistor with a 1μF capacitor (plus side to +Vdd).
 

Thread Starter

kamaka71

Joined Mar 6, 2015
6
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.
Thanks, will order a couple 4093 chips.

What is +Vdd ?
What is the range of Vin (high and low)?
5vdc, range is about 0.8 low and 4.2 high.

Change the 1kΩ resistor to 1MΩ and replace the 10kΩ resistor with a 1μF capacitor (plus side to +Vdd).
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.
 

Thread Starter

kamaka71

Joined Mar 6, 2015
6
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
 
Top