is there any example program or anybody who tried to detect rain and wind (speed and direction) with BC modules? I have an anemometer and rain flip-flop vane with RJ11 connectors. I would like to connect it to the Sensor module and send the data to RPi.
This would make perfect addition to the climate monitor kit.
My project is using Sigfox, but should be easy to convert to BigClown radio.
I’m measuring only wind speed and direction, not the rain because there was no need in that project.
For rain sensor you would need third input, Sensor module has only two (one for wind speed, other for the direction). So you need to use some other GPIO. OR you can use the latest 5 pin Sensor module, which has 3 inputs if you resolder one resistor for channel C.
We can do that soldering job for you on request when you order this module.
Here is the project, code. In the description there are pictures of device:
Let us know if you need help with something.
Also, you can get 100€ dicount coupon if you share the project code, pictures and some video of device in action with us.
On the shop we have 4 pin Sensor Module, add it to your shopping basket and add note to the order that you would like 5 pin version and tha you woulk like hardware customization to enable channel C.
Hello, we improved ADC in the SDK and made it more precise and simplier. If you are clonning project with --recursive, then git downlaods the exact SDK revision which will work. When you use odler application.c with newer SDK or you use make update, then you run into these errors.
Channel C is nothing special, just a wire connected to the GPIO P7, please see the schematics
So you can access it as a GPIO, init, set direction, enable pull-up.
Is the rain sensor connected to the channel C?
Because it is kind of “slow” sensor, you could be use bc_button on this pin, then you react to the PRESS and RELEASE button events in your handler.
The best solution would be bc_switch. It has advantage, that the internal pullup is enabled only when the pin is sampled. This is perfect in case, when there is no rain for weeks and the flip-flops switch is connected all the time and the current is draining throught the pullup.
Please see this example, keep the “dynamic” pullup parameter, just change the pin:
Does this solve your problem? Let us know if you need some more help.
As always, thank you very much Martin. It helped a lot. I think I have the firmware ready for testing. Today I will connect sensors and will do first tests. BTW now is really good weather for wind and rain sensor testing
I will then create some text, video and upload the firmware to GitHub and will look forward for another BigClown shopping spree
I am doing some tests now. Next week I will publish summary with photos and some (hopefully not utterly bad) video (is Czech language ok? I do not have guts to speak in English in public video ) with whole station in action.
Just a small note to ADC. If you read adc raw values, then the value may change if you power kit from USB or from batteries. Because the USB linear regulator gives 3.3V to the voltage reference pin, and battery modules 3.0 V.
I have updated the code. For reading battery voltage I am using battery module SDK and it works flawlessly now. I have added temperature readings and cleaned up a bit the conversion from ADC to wind direction. Also cleaned up the code a bit. It looks good now. I hope I will get to create some article with testing results and videos next week.