Welcome Guest, you are in: Login

wiki.crowe.co.nz

RSS RSS

Navigation





Search the wiki
»

PoweredBy

RainSensorsCircuit

RSS
Modified on Monday, 15 August 2011 14:34 by Administrator Categorized as Uncategorized
Something simple - well since it is a relay that means it goes from 0v to say 24v (I need to get the unit to work out this properly - maybe it will be 12v if input is 12v?)

But if the output is say 24v then a voltage divider with a couple of resisters should drop it to 12v.

Then connect the unit to a 9 pin serial connector.

I have taken a female 9 pin d connector and soldered a wire between Pin 1 (Data Carrier Detect) & pin 4 (Data Terminal Ready)

http://www.lammertbies.nl/comm/cable/RS-232.html

I then connect a switch across Pin 1 (Data Carrier Detect) and Pin 6 (Data Set Ready)

By using a switch between Pin 1 and Pin 6 this toggles the PinChanged event in my source code in c# - it triggers the DSR pin changed event.

I am assuming that the switch can be a simulator for the relay?



    class Program
    {
        static void Main(string[] args)
        {
            
            SerialPort sp = new SerialPort("COM11", 19200, Parity.None, 8, StopBits.One);
            sp.DtrEnable = true;
            sp.PinChanged += new SerialPinChangedEventHandler(sp_PinChanged);
            sp.Open();
            while (Console.KeyAvailable == false)
            {
                System.Threading.Thread.Sleep(500);
            }
            sp.Close();
        }

        static void sp_PinChanged(object sender, SerialPinChangedEventArgs e)
        {
            Console.WriteLine(String.Format("{0} - Pin changed : {1} - State = {2}", DateTime.Now, e.EventType, (sender as SerialPort).DsrHolding));
        }

So from the looks of things (without the unit) I can simulate what it is doing for some modes.

When the rain sensor is in bucket tip mode (Mode 0) it output will pulse ON for 50mS each time 0.01" (depends on settings) of water accumulates, just as a tipping bucket would.

In Mode 1 (Its Raining) it turns on turns on when a given rate of rainfall is detected, and turns off after it has dropped below a threshold.

In Mode 2 (Condensation sensor) the relay closes when the condensation occurs, and opens when the condensation goes away.

In Mode 3 (Wiper) maybe not used

In Mode 4 (Irrigration Control) should be useable

Mode 5 - Missing from manual so no idea what it is!

Mode 6 - (Drop detector) - Pulses for each drop

Now I just need to receive it to determine if this is all doable.

chris

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.