Interfacing with a rain gauge w/12v signal
dharwood
Posts: 12
Hello,
Newbie question.
I am doing a project that requires me to read a rain gauge. The rain gauge sends a signal every 0.01" of rain detected. The specs for the device indicate that the output signal is 12v. The rain gauge has it's own 12v input power source. I am using a Propeller dev board to do the project and am currently using 3.3v.
How do I connect the rain gauge output to the dev board? Do I use a 3.3v Voltage Regulator? Or is a Resistor all I need?
Can I interface a device and the dev board that are on seperate circuits?
Thanks,
Dan
Newbie question.
I am doing a project that requires me to read a rain gauge. The rain gauge sends a signal every 0.01" of rain detected. The specs for the device indicate that the output signal is 12v. The rain gauge has it's own 12v input power source. I am using a Propeller dev board to do the project and am currently using 3.3v.
How do I connect the rain gauge output to the dev board? Do I use a 3.3v Voltage Regulator? Or is a Resistor all I need?
Can I interface a device and the dev board that are on seperate circuits?
Thanks,
Dan
Comments
You can also make a voltage divider like this: This will provide about 3V to the Propeller Pin which is fine.
kwinn - I think I understand what you are suggesting, but am confused on both a clamping diode and a zener diode? Don't they kinda do the same thing (different, but similiar). Is this a cover your bases approach? Also I didn't understand what you meant by putting them to the ground AND near the input pin. This is probably my NEWBIE shinning through, but those seem to be different to me. An explanation of the connection order would help me greatly! (like Mike did).
Mike - Thanks! I will likely try your suggestion first, since it is straight forward. Thanks also for steering me towards connecting the grounds. I knew I would have to do something of this nature, but wasn't sure how to ask the question. I'm glad you picked up on that! I would still like to try kwinn's suggestion, since I can imagine that if I continue to interface with sensors that are not 3.3v/5v, sooner or later I will need to learn how to "clamp" the inputs to ensure stability.
Franklin - You hit the nail on the head. This is a pulsed output. The device is an optical rain sensor that "emulates" a tipping bucket sensor as a drop-in replacement. It isn't as accurate, but is much lower maintenance and cheaper than most tipping bucket gauges. Accuracy isn't important in my application, so I thought it was a good choice. I just need to know if it rained "a little" or "a lot".
The device can be found on this link: http://www.rainsensors.com/how_it_works.php
The specs can be found on this link: http://www.rainsensors.com/docs/rg-11_instructions.pdf
As I eluded to, I am using it in Tipping Bucket mode, however the "Drop Dectector" mode seems really cool too, but alas....I must learn to walk...before I run.
Thanks again for the help. I am looking forward to trying these suggestions, and will reply with the results!
I don't understand why I don't need to be concerned about the voltage. The specs indicate that the output is "Relay closure, Normally Open and Normally Closed contacts. Max load 1A, 24 VDC". Some modes support 24v, however I am using the mode that only requires providing 12v, therefore wouldn't the contact pulse be "potentially" 12v at 1 amp?
I am sure I am missing something in what you are saying, so let me explain what I did. What I am doing to power this is using a CAT5 cable and a POE (Power Over Ethernet) injector. I have combined and connected the blue wires to the DC+ and the brown wires to the DC-. I then combined and connected the orange and the green to the COM and NO contacts.
I really appreciate your help!
Thanks,
Dan
The NO/NC circuit is simple. The resistor connected to the input pin pulls that pin up to 3.3volts when the relay is open. When the relay closes it connects the input pin to ground. The only gotcha is that the contacts may bounce open and closed several times so the software needs to de-bounce it.
The second circuit is the clamping diode circuit. when the input voltage gets about 0.7V higher than the 3.3V supply the top diode starts to conduct and "clamps" the input voltage. If the input voltage drops to about 0.7V lower than the ground the lower diode starts to conduct and clamps the input voltage.
The third circuit is the zener. The input signal will not be higher than the rated voltage of the zener diode, or lower than about -0.7V with respect to ground.
With a NO/NC contact you have the clamping circuits are not required. The power for the rain gage is still needed.
Thank you kwinn for the schematics on the various configuration options. That is extremely helpful to me. I intend to try all three so I can become more familar with these concepts and their application.
As for de-bouncing the simple approach, I think this will be straightforward in the mode that I intend to use, since the contact should not close more that once every couple of seconds (extreme worse case), so I should be able to process the closure and ignore any false-positives for a specified interval of milliseconds.
I have confirmed the device is working and will connect it to my dev board now that you have given me the confidence that I won't fry anything
This is just a first step in a much bigger project that "hopefully" will include the ability to retrieve the rainfall data remotely over the web and ultimately remotely/automatically drive a sprinkle system based on actual rainfall amounts.
I will undoubtely be posting more questions on these forums to accomplish all this, but have to say that I have been monitoring these forums for some time and am impressed on how willing everyone is to help folks of all abilities, without making it painful when those of us that are "less informed' need guidance.
Thanks again!
Your ultimate goal and even more are well within the capability of the prop. A complete weather and ground moisture measurement station has been built with a propeller protoboard, and that communicates with a second protoboard that controls an irrigation system for a nursery. One protoboard could have carried out both functions but it was more cost effective to use two due to the location of the irrigation pumps and controls.
As to people on this forum helping folks of all abilities without making it painful, I couldn't agree more. It was one of the things that made me join. We were all new to this at some point, and I believe the person helping gains from it as much as the person being helped.
Good luck with your project, and feel free to ask for help or answers any time.
It does require the 9 to 30 Vdc power for the internal circuitry, but the rain gage contacts appear to be an isolated spdt relay. I'm a little surprised that that the output is a mechanical relay, instead of a solid state one, especially for the rain gage emulator. I'd expect some kind of opto-relay there. Can you actually hear it clicking when it detects rain? Standard rain gages usually use a long-life dry contact reed relay and the tipping bucket has a magnet that closes the relay every time the bucket tips.
If this gage does use a mechanical relay it will probably bounce when it closes, as others have said. (not a problem if it is solid state). If there is bounce, here is another circuit that can help to pre-filter.
The gage rapidly discharges the 1000pF capacitor through 220Ω, but the capacitor takes longer to charge back up through the 10kΩ, thus smoothing out some of the bounce. The 220Ω limits current through the switch, because you don't want to wear it out with a spark from the capacitor discharge. The 5V zener is protection from high voltages, as a rain gage out on a cable is a magnet for lighting induced voltage surges. The 1kΩ is additional protection for the CPU input pin.
In this circuit, the CPU has to poll the pin often enough so as not to miss a pulse. Rain pulses can be infrequent and frequent polling may be a waste of CPU resources. Another technique is to use the capacitor as a storage element. Remove the 10kΩ pullup resistor. Instead, the CPU charges up the capacitor to +3.3 V, as a high output, then turns the pin around to be an input. At a later time, it comes back, and if it finds that the pin is low, that means that a raindrop has occured in the interim. It counts that and in any case refreshes the high level on the capacitor. Using that technique, the CPU does not have to pay so much attention to the rain gage. That is important with the BASIC Stamp, but not so much an issue with the Propeller.
The overall quality of the device is very good IMHO. The dome has a heft to it, that makes it feel substantial. It has rubber o-rings to seal it against the elements. Overall small and easy to mount out of the way.
I was looking at tipping bucket devices, but found that most are pretty expensive (up to $600). The average price was around $300. I found one for $75, but it looked really cheap (all plastic). While I admit that I would like the accuracy of a tipping bucket device, I really don't require it.
The Davis Instruments tipping bucket rain gage ($75) is actually well made. They bring the cost down through their volume of sales. It is made of a UV resistant polyethylene and it holds up outdoors through years of exposure. The funnel does have to be kept frees of debris.