Vietduino Uno-Based Rain Detection and Distance Measurement System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question is designed to interface a Vietduino Uno USB-B microcontroller with a set of sensors and actuators, including a rain sensor, an SG90 servo motor, and an HC-SR04 ultrasonic sensor. The Vietduino Uno USB-B serves as the central processing unit, reading sensor inputs and controlling the servo motor based on the data received. The rain sensor provides analog input to the Vietduino Uno, which can be used to detect the presence of rain. The ultrasonic sensor is used to measure distance by sending out a pulse and measuring the time it takes for the echo to return. The servo motor is controlled via PWM signal from the Vietduino Uno. The circuit is powered through the Vietduino Uno's 5V output, which is distributed to the other components.
Component List
Vietduino Uno USB-B
- Description: A microcontroller board based on the ATmega328P, compatible with Arduino Uno. It has digital and analog I/O pins.
- Pins: AREF, GND, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 3V3, 5V, RESET, VIN, A0, A1, A2, A3, A4, A5
RAIN SENSOR
- Description: A sensor that detects water presence by measuring the conductivity between two traces.
- Pins: AO (Analog Output), DO (Digital Output), GRD (Ground), VCC (Power Supply)
SG90 Servo Motor
- Description: A small and lightweight servo motor capable of precise control.
- Pins: PWM (Pulse Width Modulation), 5V (Power Supply), GND (Ground)
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor that uses sonar to determine the distance to an object.
- Pins: VCC (Power Supply), TRIG (Trigger), ECHO (Echo), GND (Ground)
Wiring Details
Vietduino Uno USB-B
- Pin 12 is connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor.
- Pin 11 is connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor.
- Pin 7 is connected to the PWM pin of the SG90 Servo Motor.
- Pin 5V is connected to the 5V pins of the SG90 Servo Motor, HC-SR04 Ultrasonic Sensor, and RAIN SENSOR.
- Pin GND is connected to the GND pins of the SG90 Servo Motor, HC-SR04 Ultrasonic Sensor, and RAIN SENSOR.
- Pin A0 is connected to the AO pin of the RAIN SENSOR.
RAIN SENSOR
- AO pin is connected to the A0 pin of the Vietduino Uno USB-B.
- VCC pin is connected to the 5V pin of the Vietduino Uno USB-B.
- GRD pin is connected to the GND pin of the Vietduino Uno USB-B.
SG90 Servo Motor
- PWM pin is connected to pin 7 of the Vietduino Uno USB-B.
- 5V pin is connected to the 5V pin of the Vietduino Uno USB-B.
- GND pin is connected to the GND pin of the Vietduino Uno USB-B.
HC-SR04 Ultrasonic Sensor
- TRIG pin is connected to pin 12 of the Vietduino Uno USB-B.
- ECHO pin is connected to pin 11 of the Vietduino Uno USB-B.
- VCC pin is connected to the 5V pin of the Vietduino Uno USB-B.
- GND pin is connected to the GND pin of the Vietduino Uno USB-B.
Documented Code
No code has been provided for the microcontroller. To fully utilize the circuit, embedded code should be written and uploaded to the Vietduino Uno USB-B. The code should initialize the pins connected to the sensors and servo motor, read sensor data, and control the servo motor accordingly. Since no code is available, this section cannot be completed at this time.