Water level project circuit help needed

Discussion in 'The Projects Forum' started by TwoTon, Aug 17, 2015.

  1. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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?
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    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.
     
  3. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    Ah.....

    So, for example, if I connected pin 4 to pin 8, then pin 9 to 12v, pin 10 to the transistor base?
     
  4. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    Perfect! Thanks, I switched 8 and 9, but it works very well. Thanks again
     
  5. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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.....
     
  6. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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?
     
  7. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    That's the correct way to think about these things. Well done.
     
  8. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    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: Aug 17, 2015
    absf likes this.
  9. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    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.
     
  10. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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?
     
  11. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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.
     
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,544
    1,251
    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
     
  13. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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?
     
  14. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    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.
     
  15. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    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: Aug 17, 2015
    absf and AnalogKid like this.
  16. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,544
    1,251
    Looks good to me. OBTW, what did you use to draw the schematic?

    ak
     
  17. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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?
     
  18. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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.
     
    GopherT likes this.
  19. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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).
     
  20. TwoTon

    Thread Starter Member

    Aug 6, 2015
    119
    1
    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?
     
Loading...