Water level project circuit help needed

Thread Starter

TwoTon

Joined Aug 6, 2015
119
http://freecircuitdiagram.com/2008/...r-probes-using-alternating-current-detection/

In this project I am working on, based on the above circuit, when the probes touch it energizes the relay coil. I have the circuit built, all works well, except I would really like to have the relay coil de-energize when the probes make contact.

I have tried a few things to make this happen, but my brain is getting locked up and quite frankly I do not have half the aptitude as you guys do for this kind of stuff. Is this an easy fix, or is it going to be more complex than what I am hoping?
 

JohnInTX

Joined Jun 26, 2012
4,787
Use another section of the 4093 NAND gate as an inverter between U1 pin 4 and the base of the transistor. That will make the operation opposite of what it currently is.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Just for background, my thoughts were that the contacts will be sitting under water for the majority of the time, only being exposed for a filter wash. So that's a lot of power/heat that is constant with all the relays being in a constant energized state. Now they will stay in a de-energized state. I thought I was going to have to buy some more relays.....
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Ok, here is another question. I want to put a time delay, say around 5 or so seconds, between the time the probes make contact and the relay de-energizes. I want to keep the relay from constantly switching states when the water is turbulent, even if its for just a few seconds, that's a lot of 'clicking' going on.

I have some 555 timers on order, but am curious if it can be done with a capacitor or something a little more simplistic. Anyone have any thoughts?
 

JohnInTX

Joined Jun 26, 2012
4,787
Just for background, my thoughts were that the contacts will be sitting under water for the majority of the time, only being exposed for a filter wash. So that's a lot of power/heat that is constant with all the relays being in a constant energized state. Now they will stay in a de-energized state.
That's the correct way to think about these things. Well done.
 

KMoffett

Joined Dec 19, 2007
2,918
Change the PNP transistor to an equivalent NPN. An emitter follower is a bad choice to drive a relay from a CMOS gate. Emitter to common and collector to the relay coil. You also need a resistor between the base and the gate's output. The resistor should provide ~ 1/10th of the relay coil current. So R=~ Rcoil*10.

Ken

You can easily add a delay with a resistor, a capacitor, a diode and the two extra gates. (No time to do a schematic right now.)
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
Ok, here is another question. I want to put a time delay, say around 5 or so seconds, between the time the probes make contact and the relay de-energizes. I want to keep the relay from constantly switching states when the water is turbulent, even if its for just a few seconds, that's a lot of 'clicking' going on.
Most of this kind of thing I've been around use 3 probes - a common probe, a lower probe and an upper probe to provide hysteresis, in this case physical distance between the ON and OFF levels. A RS flip flop is used to save the current condition i.e. set the f/f when the upper probe is covered. As the level drops, the upper probe will be uncovered removing the 'SET' but nothing else happens. When the lower probe is uncovered, the f/f is RESET. From there as the level rises again, the RESET is removed but the f/f keeps its state until the upper probe is covered. Connect the f/f output to the relay. Space the probes to accommodate splashing.

In your circuit you have the common (oscillating) probe. Replicate the other one.

You can make the f/f with cross coupled NAND gates or use the f/f in the 555. I've used DIP packaged magnetic latching relays when power down memory is necessary.

Lots of ways to skin the cat but I would use some kind of 2 level approach rather than delays etc.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Change the PNP transistor to an equivalent NPN. An emitter follower is a bad choice to drive a relay from a CMOS gate. Emitter to common and collector to the relay coil. You also need a resistor between the base and the gate's output. The resistor should provide ~ 1/10th of the relay coil current. So R=~ Rcoil*10.

Ken

You can easily add a delay with a resistor, a capacitor, a diode and the two extra gates. (No time to do a schematic right now.)
I guess I am not understanding why the transistor type matters. I don't know a lot about theses things, but from what I have studied the pnp vs npn shouldn't matter except for how you trigger the transistor. Could you elaborate more when you get a chance?
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Most of this kind of thing I've been around use 3 probes - a common probe, a lower probe and an upper probe to provide hysteresis, in this case physical distance between the ON and OFF levels. A RS flip flop is used to save the current condition i.e. set the f/f when the upper probe is covered. As the level drops, the upper probe will be uncovered removing the 'SET' but nothing else happens. When the lower probe is uncovered, the f/f is RESET. From there as the level rises again, the RESET is removed but the f/f keeps its state until the upper probe is covered. Connect the f/f output to the relay. Space the probes to accommodate splashing.

In your circuit you have the common (oscillating) probe. Replicate the other one.

You can make the f/f with cross coupled NAND gates or use the f/f in the 555. I've used DIP packaged magnetic latching relays when power down memory is necessary.

Lots of ways to skin the cat but I would use some kind of 2 level approach rather than delays etc.
So either way, it's going to take an extra chip correct? I believe I understand what your saying though. I'd have to draw it out and visualize it before it sinks in.

One reason for the timer(my plan is to have a variable resistor to fine tune it) is because I'm not sure just how much the water turbulence is going to be effecting the probes.

My project is different than most because I'm not just monitoring a steady rise/fall. The fall should be steady, but the water rise will be anything but steady. During part of the process there is some extreme turbulence caused by an air blower under the water surface. This will cause splashing of various amounts(no way to keep it constant) on the probes.

Hypothetically, it could sometimes be a few inches, sometimes 3 times the amount.
 

AnalogKid

Joined Aug 1, 2013
11,038
The PNP in the original schematic is acting as an emitter follower, which a) does not saturate and so dissipates unnecessary power; and b) does not invert the logic polarity coming out of the NAND gate. An NPN transistor does act as a saturated switch, which is a better way to drive most loads, *and* it inverts the logic polarity, which solves your initial question so you no longer need the extra gate. To add a time delay, insert a resistor between the D2 cathode and C4. The resistor should not be greater than 1 M because it forms a voltage divider with R1 at the input to the gate, and you want a large enough signal to cause the gate to change state. If a 1 M resistor does not give you enough delay, increase C4.

ak
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Ok, I'll try all the above tomorrow. I'll report back then. I think I can see how it all goes in.

One thing I do have a question on is the diode placement. D3 to be exact. I noticed that when comparing transistor switch circuits when pnp vs npn were used the diode changed spots also. So I assume I'll need to change it also when changing to a npn?
 

JohnInTX

Joined Jun 26, 2012
4,787
My project is different than most because I'm not just monitoring a steady rise/fall. The fall should be steady, but the water rise will be anything but steady. During part of the process there is some extreme turbulence caused by an air blower under the water surface. This will cause splashing of various amounts(no way to keep it constant) on the probes.
In that case, I'd be tempted to use the 2 probe approach to avoid rapid pump cycling (by enforcing a minimum distance to replace) AND incorporate a delay on the top probe to take care of splashing.

@AnalogKid makes good points about the driving hardware too.
 

KMoffett

Joined Dec 19, 2007
2,918
I think this will give you what you have asked for.
Probes exposed by slowly lowering water level> relay turns on.
~5 seconds after last intermittent probe submersion> relay opens
Continuous probe submersion> relay stays open
As soon as the probes are exposed (even by turbulance)> relay turns on
WaterLevelWithDelay.gif

But not necessarily what you need. I think the two-probe (3-wire) approach is best.
 
Last edited:

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Thanks for the visual. But I'm confused, you recommended going to npn, but the 558 is pnp? I see the relay is in a different location, but does that address the thoughts you had before?
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Thanks again for all the help. This is my first venture into electronics this deep. I used to play around with simple kits as a kid, and did build a simple 4-20mA loop supply(although I only built it from instructions not knowing what I was doing). But this project is one I am trying to actually learn about components and how things work. I've learned a ton so far.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Ok, I'm about to change up the circuit board, but had a question. It was stated that the resistor before transistor base should be 1/10th of coil resistance. But then it was stated to take Rcoil*10. Wouldn't it be Rcoil/10?

The relays I have are 320ohm coils so I will start with a ~32 ohm resistor. This is just to protect the IC right? Is the 1/10th critical(I assume not or else I would have already ruined my current circuit).
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Hmmm.....just did a little googling, maybe I should start with assuming the Rcoil*10, or 1/10th higher, resistor needed at the base. So more like 3.2K?
 
Top