Implementing Rain Sensor Functionality in a Raspberry Pi 4 and Navio2 Rover

I am building a rover using a Raspberry Pi 4 and Navio2 with ArduRover 4.0. I’ve connected a rain sensor to the Navio2 pins and can now read its status (1, 0) on the Raspberry Pi. I want the rover to respond based on the sensor’s status. For example, if the sensor detects rain, I would like to receive a warning on Mission Planner or activate the return-to-home feature. Is this possible?

If its just a binary output you can just use it as a button to activate an auxiliary function, if you want more complex behavour you will need to use LUA.

1 Like

Also you should replace ArduRover 4.0 with Rover 4.5.1. :slight_smile:

Thank you for the response. I tried using it as a button, but I couldn’t set it in Mission Planner. I changed BTN_ENABLE from 0 to 1, set BRD_PWM_COUNT from 8 to 12, and changed BTN_PIN1 from -1 to 55 (which should be the GPIO pin according to the Navio2 documentation). The problem is that the options BTN_OPTIONS1 and BTN_FUNC1 do not appear in the full parameter list on Mission Planner.

Unfortunately, the last version supported by Navio2 is 4.0

Thank you, I didn’t know that it was possible to update ArduPilot on Navio2. From here it seemed that it wasn’t: Upgrading | Navio2. But after your post, I found this page: Building from sources | Navio2, and even though it was a bit difficult, I managed to update the firmware. Now I will try again to set up the rain sensor. Thank you.

Awesome! You could have used the .bin from my link, BUT building from source is a great excercise :slight_smile:


I didn’t realize there was already a completed file :tired_face: Next time I’ll use that one, thanks!