bs2 analog I/O
Bullwinkle
Posts: 101
Kicking around ideas for a rain sensor for my irrigation controller. Would it be possible to rig up a resistive pair of tin foil plates, say, and supply it with +5v and have the stamp read the voltage on the other side?
If the voltage is zero, the the plates are dry, but if the voltage is 0.25v (say) then that plates are wet, therefore it is raining, or has rained recently?
In other words is there an analog input on the stamp somewhere that I could read the 0.25v ( or whatever ) voltage from. Or would I somehow have to convert this to a digital (TTL level) input?
Thanks.
If the voltage is zero, the the plates are dry, but if the voltage is 0.25v (say) then that plates are wet, therefore it is raining, or has rained recently?
In other words is there an analog input on the stamp somewhere that I could read the 0.25v ( or whatever ) voltage from. Or would I somehow have to convert this to a digital (TTL level) input?
Thanks.
Comments
RTFM!!!
What can I use the I/O pins for?
The BASIC Stamp’s I/O pins are perfectly suited for digital input and output with TTL/CMOS level (0 to 5 volt)
signals. However, you can use some special commands and techniques to input and output limited analog signals.
For example, the RCTIME and PWM commands can be used to read a variable resistance or output a variable
voltage from 0 to 5 volts. The I/O pins can not be used to read analog voltages by themselves, however, but this
can be done by interfacing the I/O pins to an A to D converter chip.
The links below are great for a personal weather station, which you should need in order to set up an accurate irrigation controller.
Here is a link to a 1-wire weather station;
www.maxim-ic.com/products/ibutton/solutions/product.cfm?id=11
Here is a link to 1-wire I-button site, with very good links towards bottom of page (humidity sensor, rain gauge);
www.maxim-ic.com/products/ibutton/weather/index.cfm#humid
Here is a web page that is titled " An instrumentation network for weather data on the Web ":
www.javaworld.com/javaworld/jw-05-1999/jw-05-javadev.html
This info should get you going, besides interfacing to the stamp, it can also be interfaced to a PC, or the PINK module...
Bob N9LVU
Some great ideas in those links. I love the seesaw rain gauge idea. Since all I want to do is detect rain, I can probably build a much simpler device based on the same principle, and it's digital - which solves another problem right there!
My idea at this stage is to have the software poll the rain sensor at regular intervals and add to a counter each time the sensor is detected as being "on". Then, once the rain sensor returns to the "off" position, start decrementing the counter every x cycles until it reaches zero once again. If the counter is non-zero then disable all watering events. Calibrating the counter decrement rate will take some trial-and-error.
This is GREAT. I'm having fun already!
If you use the BS2px you could use the built-in comparitor to do what you want.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"I hope the goonwave is not vaporware"
·
An analog comparitor! That's fantastic. These little guys can do just about anything.
If you calibrate the rain sensor, take the total for say a"24hr time period" store the amount, and subtract that amount from your "daily" plant requirement.
The remainder will be the amount that you need to "make up".....
You don't need to figure the ramp up/down that way....
Plus you will have a baseline as to cost of "water pumped" and a great record of "rainfall, humidity, temp, wind" and don't forget RECEIVED SUNLIGHT....
Bob N9LVU
I've used this with great success for a "wet" or "touch" sensor in the past; it works very well.
The only potential "gotcha" with this arrangement is the possibility of "gunk" bridging the contacts.· To get around this you could use a pair of reed switches and a tipping-bucket range gauge, and look for the tips - if the switches are cycling, its raining.....
As was mentioned you can also count the actual rain amount with the tipping bucket gauge, and then calculate how much irrigation you actually need.· This is even better!
"Received Sunlight" is not a problem - I live in inland Australia (Canberra). It's sunny (and hot) here most days when I'd want to be irrigating anyway.
Depending on memory I may add a "fully auto" mode to my controller where it irrigates based on a table of values depending on the month. That way it will automatically ramp up as summer really bites hard in late January/early February, then easy down until it does not need to run at all between late autumn and early spring.
Designing the user interface will be fun. I plan to use a 4x20 LCD screen and a few momentary contact switches on the front panel. Maybe an ethernet interface (wireless?) later on - the Rolls Royce edition.
[noparse][[/noparse]urlhttp://www.emesys.com/OL2mhos.htm
www.emesys.com/lwet_dat.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10