dokeeffe / cloud-rain-monitor

Device to measure sky conditions (rain and cloud) for an astronomical observatory
16 stars 3 forks source link

rain detector issue #3

Closed Trigger-broom-289 closed 7 years ago

Trigger-broom-289 commented 7 years ago

I have the following issue:

Stephanes-MacBook-Air:~$ curl http://192.168.2.212:8080/weather/current {"outsideTemp": 27.37, "skyTemp": 25.41, "rain": true, "readingTimestamp": "2017-08-22 08:24:09"} {"outsideTemp": 27.39, "skyTemp": 25.43, "rain": false, "readingTimestamp": "2017-08-22 08:24:12"} {"outsideTemp": 27.39, "skyTemp": 25.43, "rain": false, "readingTimestamp": "2017-08-22 08:24:12"} {"outsideTemp": 27.39, "skyTemp": 25.43, "rain": false, "readingTimestamp": "2017-08-22 08:24:12"} {"outsideTemp": 27.39, "skyTemp": 25.11, "rain": true, "readingTimestamp": "2017-08-22 08:24:15"}

The sensor is dry, it's cloud less. As you can see, it seems to switch from false to true regardless.

Trigger-broom-289 commented 7 years ago

update:

I've disconnected the relay ouput from the RG11 sensor, and connected pin 8 from the Arduino directly to the ground. Now it shows a constant "false" in minicom:

{"rain":false,"sky":25.63,"ambient":29.01}??q {"rain":false,"sky":25.67,"ambient":28.99}??q {"rain":false,"sky":25.79,"ambient":28.97}??q {"rain":false,"sky":25.87,"ambient":28.99}??q {"rain":false,"sky":25.87,"ambient":28.97}??q

Am I understanding this correctly that when the pin 8 and ground are making a circuit it's reporting as no rain, but when the circuit is open it reports as rainy ?

Trigger-broom-289 commented 7 years ago

What are your RG11 switches set to please?

dokeeffe commented 7 years ago

Good question, I cant remember at all. I remember it detects a single drop and then closes the circuit do you have a link or any info to the available settings and I'll see if I can remember

Trigger-broom-289 commented 7 years ago

the pdf link: http://hydreon.com/wp-content/uploads/sites/3/2015/documents/rg-11_instructions.pdf

I have it set to Mode 1 it's raining with the extra 15min. What I've noticed for example, if you touch the sensor to simulate rain, your code will pick up the rain but shortly will revert back to no rain, despite the relay be active for 15 min.

dokeeffe commented 7 years ago

Yes that sounds familliar, I think I have the same setting. My one stays on for 15min. I think you may be missing a pull up/down resistor when connecting the RG11 to the arduino... What you could do as an experiment is get it working with a basic switch/button instead of the RG11, so a microswitch or the like. Then swap in the RG11. See here for a good example of using the resistor in an on/off button circut https://www.arduino.cc/en/Tutorial/Button

Trigger-broom-289 commented 7 years ago

ah, in the code it says:

_* Wiring:

I wasn't aware it needed a pull down resistor. I'll have to install it when I'm back this following Christmas holidays as there are no shops selling electronic components where I am now.

dokeeffe commented 7 years ago

My bad, sorry about that. Actually you will probably randomly get rain/no-rain readings now so

Trigger-broom-289 commented 7 years ago

That's correct, I had rain/no-rain going round and round :).... Now that we know it needs a resistor, I'll close this issue. thanks for the help on this one.