Arduino UNO-Based Smart Distance Sensing and Motor Control System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller interfacing with a 1 Channel 5V Relay Module, an HC-SR04 Ultrasonic Sensor, a Tower Pro SG90 servo, and a DC Motor. The Arduino UNO controls the relay, servo, and ultrasonic sensor to perform various tasks, including motor control and distance measurement.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
1 Channel 5V Relay Module
- Description: A relay module that allows control of high voltage devices with a low voltage signal.
- Pins: VCC+, VCC- (GND), IN, N.O., COM, N.C.
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic sensor used for distance measurement.
- Pins: VCC, TRIG, ECHO, GND
Tower Pro SG90 Servo
- Description: A small servo motor used for precise control of angular position.
- Pins: Signal, +5V, GND
DC Motor
- Description: A simple DC motor.
- Pins: pin 1, pin 2
Wiring Details
Arduino UNO
- 5V: Connected to VCC+ of the 1 Channel 5V Relay Module, VCC of the HC-SR04 Ultrasonic Sensor, +5V of the Tower Pro SG90 Servo, and pin 2 of the DC Motor.
- GND: Connected to VCC- (GND) of the 1 Channel 5V Relay Module, GND of the HC-SR04 Ultrasonic Sensor, and GND of the Tower Pro SG90 Servo.
- D13: Connected to IN of the 1 Channel 5V Relay Module.
- D11: Connected to Signal of the Tower Pro SG90 Servo.
- D9: Connected to TRIG of the HC-SR04 Ultrasonic Sensor.
- D8: Connected to ECHO of the HC-SR04 Ultrasonic Sensor.
1 Channel 5V Relay Module
- VCC+: Connected to 5V of the Arduino UNO.
- VCC- (GND): Connected to GND of the Arduino UNO.
- IN: Connected to D13 of the Arduino UNO.
- N.O.: Connected to +5V of the Tower Pro SG90 Servo, pin 2 of the DC Motor, and VCC of the HC-SR04 Ultrasonic Sensor.
- COM: Connected to pin 1 of the DC Motor.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to 5V of the Arduino UNO.
- TRIG: Connected to D9 of the Arduino UNO.
- ECHO: Connected to D8 of the Arduino UNO.
- GND: Connected to GND of the Arduino UNO.
Tower Pro SG90 Servo
- Signal: Connected to D11 of the Arduino UNO.
- +5V: Connected to 5V of the Arduino UNO.
- GND: Connected to GND of the Arduino UNO.
DC Motor
- pin 1: Connected to COM of the 1 Channel 5V Relay Module.
- pin 2: Connected to +5V of the Tower Pro SG90 Servo, N.O. of the 1 Channel 5V Relay Module, and VCC of the HC-SR04 Ultrasonic Sensor.
Code Documentation
Arduino UNO Code
sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
documentation.txt