PDA

View Full Version : Need guide to start working on weather meters



tacbanon
- 16th December 2012, 08:14
Hello everyone!
I have a weather meters(http://www.sparkfun.com/datasheets/Sensors/Weather/Weather%20Sensor%20Assembly..pdf) from sparkfun electronics, I read its manual but not all are really clear for me. But here is what I understand so far.
Sensor:
RAIN GUAGE - I think it's similar to a switch button, so I just need to count how many times it has been switched...am I right?
WIND VANE - I also thinking I can use ADC in reading the value from the sensor.
ANEMOMETER - don't really know how to on this one.
6775

Planning to use Pic18F4550 at 20Hz.
I hope anybody can help me out on this one.

Thanks in advance,
tacbanon

SteveB
- 16th December 2012, 21:06
RAIN GUAGE - I think it's similar to a switch button, so I just need to count how many times it has been switched...am I right?

Correct, count the number of pulses. Each pulse = .011" (.2794mm) of rain. This could be done with a general IO interrupt, or just poll it frequently if your main loop is quick and the pulse length is long. Hook it up to a scope if you have one to measure it.



WIND VANE - I also thinking I can use ADC in reading the value from the sensor.

Correct. There are only 16 discrete positions that can be identified, so you will need to set up the logic to identify which position based on the which value is closest to the actual ADC value. Even an 8bit ADC value should be more than enough.




ANEMOMETER - don't really know how to on this one.

COUNT would work well here. (COUNT PORTB.2, 1000, WindSpeed). Multiply pulses by 1.492 for MPH or 2.4 for KM/H. However, the problem with this is that you may miss the Rain Gauge pulse while the COUNT command is busy for the 1000 milliseconds. Again, it depends on how long the pulse is from the Rain Gauge, and if you are using an interrupt to catch the pulses.

There are a number of different ways this can be done and you would have to modify the multipliers to integer values. Hope this helps get you started.

pedja089
- 17th December 2012, 09:47
Just use TMR1 for counting impulses from anemometer....

tacbanon
- 17th December 2012, 09:50
Thanks SteveB and pedja089 for your kind response and advice I will try to work on it....

Regards,
tacbanon