Water Detector Circuit W/Relay

Discussion in 'The Projects Forum' started by brodie4416, May 17, 2013.

  1. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    Hello, if you wouldn't mind, I have been working on this circuit for a week and it still is not working!!

    I am trying to detect water by running 12V through a wire, if there's water, the "switch" (it is basically an open wire with the leads about half an inch apart) will be closed, if no water, the "switch" will be open. I am then using that 12V to attempt to trigger a 5V (or 12V, either doesn't work) relay to then activate a water pump (takes 24V) whenever there isn't water. The "switch" appears to be working but I think I lose too much current through it.


    https://www.circuitlab.com/circuit/5jxz68/waterdetector/


    The issue is that I don't think I'm getting enough current through the relay because even though I can measure over 5V at both ends of the relay coil with respect to ground, the relay does not activate! If I remove the resistor R1, the voltage drops to less than 1V... HELP! Thanks
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    Where did that circuit come from? It's never going to work, unless I'm missing something about that "step up" component. What is that?

    You're trying to send enough current across the water gap to drive the relay, taking the place of the switch, right? I doubt that would work even with salt water. You need a sensitive, low current circuit to detect the presence of the water and then an amplification of that small current to drive your relay.

    Are you trying to detect moisture is soil? There have been quite a few solutions for that discussed in this forum.

    But anyway, relying on the conductivity of water is a problem since pure water does not conduct, and you are then relying on the impurities remaining more-or-less constant, as well as the surface of the probes. They tend to corrode and/or foul. Why not a float switch? Then you don't even need the relay or 12V DC supply.
     
    Last edited: May 17, 2013
  3. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    Thanks for reply -

    The wire is inside a water fountain. When the fountain runs out of water (the wire is no longer submerged) then the pump turns on.

    I had it working with an LED in place of the pump which is why I am confused now.


    Can you show me an example of the water detection you are talking about?

    Edit: The step-up component just raises the voltage from anywhere greater than 0.8V to 5V. I have used the component with success in previous projects to get a steady voltage.

    Edit2:I didn't want the float switch because I did not think it would work for my application. Are they able to sense a certain water level? I'm trying to keep a constant water level. Anyways, I only have to the end of the day to finish (unfortunately) so I'm limited to the parts that radioshack sells (ugh).

    Thanks
     
    Last edited: May 17, 2013
  4. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    Ah, well the LED requires only maybe 5mA to light up. The relay might need 100mA.

    What is that "step up" thingy?

    Oh, just saw your edit. So the step-up thing is powered somehow?
     
  5. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
  6. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    Well now I'm even more confused. Whether there is a pump or a LED in series with the 24V AC supply shouldn't affect your detection circuit. Maybe you mean the LED was in place of the relay, not the pump? And when you say LED, I assume you mean there was also a resistor to limit current to the LED?

    The good news is, if your scheme was able to switch an LED to your liking, we should be able to switch the pump just as easily with minor changes. But I need more details about that "step up" thing and how it's powered.
     
  7. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    Yeah it doesn't make any sense really, I probably made a mistake testing when I thought it was working, because whenever I bring it outside it stops working... The relay is also turning on for a short time when I initially plug it in because the voltage is high enough, but the current drops and shuts off the relay as quickly as it turned on.

    Above is the link to the step-up circuits. Here is the relay I have (also have the 5V version):
    https://www.radioshack.com/product/...sInSession=1&filterName=Type&filterValue=SPDT

    Looks like it requires 37.5 mA and I think I currently have .005mA.
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    OK, I see now what you were doing. Those things are cute but I'm afraid the step-up is not going to work to drive the relay directly. RS does have op-amps but I think you can find a simpler solution, namely a single transistor.

    Send the output of your step-up to the base pin of an NPN transistor. RS will have several. If they have a darlington, get that. (It's like 2 transistors in one). Choose one that is rated for continuous current higher than the current rating of your relay. If you don't know that, look for at least 200mA and that should be plenty. The emitter pin of the transistor goes to your 12V ground. The +12V goes to the high side of the relay and the low side of the relay goes to the collector pin of the transistor.

    In this configuration, the transistor is acting as a switch under control by the voltage on its base. It will control at least ten times as much current in the collector-emitter circuit (the relay) as is flowing into the base-emitter circuit (the detector). That >10X boost in current should be enough to operate your relay.
     
    Last edited: May 17, 2013
  9. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    It would help protect the transistor to mount the diode "backwards" (reversed bias, cathode stripe to the high side) across the poles of the relay coil. This will dissipate the small bit of energy in the relay's magnetic field when it turns off, and thereby divert the energy away from the transistor. It's called a snubber diode. Get one at the Shack if you don't have any. Something like 1N4001, generic 1A black plastic silicon diode.
     
  10. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    I believe this one should do the job?
    https://www.radioshack.com/product/index.jsp?productId=2062617

    I have never actually worked with a transistor before (more accurately, I do not remember the application of a transistor), I should not need the voltage regulator anymore with the transistor?

    Thanks again
     
  11. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    That's overkill but should be fine.

    It's likely you won't need the regulator in between the detector (wire gap) and the base of the transistor. It's not adding any power, only losing it.

    You may need to adjust the sensitivity of the detector. You could use resistors and such but you can also alter the amount of wire exposed to the water, and the distance across the gap.
     
  12. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    Hello -

    You were saying to have a diode to protect the transistor, mounted reverse biased? I'm not exactly sure how that is protecting the transistor? Maybe I misunderstood, here's what I got:

    https://www.circuitlab.com/circuit/5jxz68/waterdetector/

    Edit, actually I think I had something reversed. link should update. I think I will give that a try.
     
    Last edited: May 17, 2013
  13. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,974
    744
  14. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    The diode is configured to pass current all the time and bypass the relay. It needs to be turned around.

    And the signal going to the switch (detector gap) should be coming from the +12 pole, not ground. Otherwise it's good.

    Dave, the transistor he chose at RS is a darlington.
     
    Dodgydave likes this.
  15. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    Ok, got the diode switched, and the switch issue. Going to give it a try!

    Thanks again! I'll let you know if it works out.
     
  16. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    It appears to be working! I do have some inconsistencies but I think that is because the relay won't sit flat on the breadboard, so I'm going to go ahead and solder it and hope that stops happening!

    Thanks again.
     
  17. brodie4416

    Thread Starter New Member

    May 17, 2013
    9
    0
    Actually it has stopped working... I tried to move the circuit to get it put inside an enclosure and some parts fell off, now I cannot get it working again, I think my diagram is wrong. I also think I should probably have a resistor between the transistor and ground?

    https://www.circuitlab.com/circuit/5jxz68/waterdetector/

    It is strange to me that I can get 12V on one side of the relay (the side with 12V wired to it, no surprise) but on the other side of the relay, I can get less than 1V on the voltmeter...
     
  18. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    The diagram looks good, assuming the diode is actually connected.

    The transistor controls the path to ground for the power through the relay. It makes sense that you should see 12V on the high side of it since it is connected directly to the battery.

    If you are seeing 12V across the opposite poles of the relay, it should be activated. If it is not, I'm sad to say it may have burnt out. But maybe things will look differently in the light of day.
     
Loading...