Watering PlantBot with ROS2 and Arduino
A simple plant-watering system that uses ROS 2 (Python) and Arduino UNO via serial communication. The system reads soil moisture and activates a servo motor to water the plant if the soil is dry.
| Component | Quantity |
|---|---|
| Arduino UNO | 1 |
| Soil Moisture Sensor | 1 |
| Servo Motor (SG90/MG90) | 1 |
| Jumper Wires | As needed |
- VCC → 5V (Arduino)
- GND → GND (Arduino)
- AO → A0 (Arduino)
- Signal → Arduino digital pin 9
- VCC → 5V
- GND → GND
Listens over serial for:
R→ Reads and returns soil moistureW→ Activates servo to water plant
- Sends
'R'to Arduino every 5 seconds - Reads the moisture value
- If value > 800, sends
'W'to water the plant
plantbot/
├── plant_bot_ros
├── plant_bot_Arduino
├── video
└── README.md
- Open
arduino_node.inoin Arduino IDE. - Select your board and COM port.
- Upload the code.
- Plug Arduino into PC (usually
/dev/ttyUSB0orCOMx).
source /opt/ros/<distro>/setup.bash
ros2 run plant_bot plant_bot_node