The automatic watering system simple just read the water level in the water bowl with a HC-SR04 Ultrasonic Sound Sensor. It measure the distance to the surface of the water. If the level is less then 3cm for more than 30sec it triggers a 5V relay whit a NO-contact . The relay are controlling a 12V DC supply to a mini watering pump in the water tank.
If the robot detects an object in front of it, with the help of a small servo motor, it scans the area left and right in order to find the best way to turn. It has a notification LED, an buzzer to play a tone when an object is detected and an button for changing the function of the robot (stopped / moving forward).
Use super glue to attach the servo motor in the front side of your robot. Watch the first image to understand how to put the ultrasonic sensor in the servo motor by using a small gear piece. The second image shows the completed part that will be the 'eyes' of your robot.
Step 4: Connect The Circuit
The connections are pretty easy, watch the image above with the breadboard circuit schematic.
(Tips: Use the breadboard only for the LED, buttonand buzzer, this will keep it simple and you can use the remain area to add more stuff on the future.)
Step 6: Upload Code To Robot
Plug an battery on it and press the function button once, your robot will start moving forward after upload the code to robot. To stop it, just press the button for one more time.
You can press the 'Edit' button and start making your modification in the sketch. For example, try to change the '10'cm value that is the distance that will make the robot to stop and 'look' for a clear path. [Note: If your robot doesn't move forward, try to change the pins of the motors (motorA1 and motorA2 or motorB1 and motorB2)].
This is tutorial to help you understand ultrasonic and buzzer and go deeper into learning Arduino, follow these steps and give me feedback please. It is an easy to make fun project that you can build in 30 minutes or so. Lets get started !!
Connect the Buzzer POSITIVE terminal to the Arduino pin 2 and the NEGATIVE terminal to the Gnd. Connect the VCC pin of ultrasonic to +5V pin of Arduino board and the Gnd to the ground. Connect trig pin to pin 10 and echo pin to pin 19. The schematic circuit diagram may help you.