Circuit Documentation
Summary
This circuit integrates an Arduino Nano microcontroller with an HC-SR04 Ultrasonic Sensor and three SG90 Servomotors. The circuit is powered by a 9V battery, which is regulated to a suitable voltage for the microcontroller and peripherals by a voltage regulator. The Arduino Nano is responsible for controlling the servomotors based on the input from the ultrasonic sensor.
Component List
Arduino Nano
- Microcontroller board based on the ATmega328P
- It has a variety of digital and analog I/O pins
- Used as the main controller for the circuit
HC-SR04 Ultrasonic Sensor
- Ultrasonic distance measuring module
- Provides 2cm to 400cm non-contact measurement functionality
- Connected to the Arduino for distance sensing
Servomotor SG90 (3 units)
- Small and lightweight servo motor
- Capable of precise control
- Used for actuation in the circuit
Voltage Regulator
- Regulates the input voltage to a stable output voltage
- Ensures that the components receive the correct operating voltage
Battery 9V
- Provides the power source for the circuit
- Connected to the voltage regulator
Wiring Details
Arduino Nano
- GND connected to the ground net of the circuit
- D2 connected to the signal pin of the first SG90 Servomotor
- D3 connected to the signal pin of the second SG90 Servomotor
- D4 connected to the signal pin of the third SG90 Servomotor
- D8 connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor
- D9 connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor
- 5V connected to the 5V net of the circuit
HC-SR04 Ultrasonic Sensor
- VCC connected to the 5V net of the circuit
- TRIG connected to the D8 pin of the Arduino Nano
- ECHO connected to the D9 pin of the Arduino Nano
- GND connected to the ground net of the circuit
Servomotor SG90
- SIG (for each servomotor) connected to the respective D2, D3, and D4 pins of the Arduino Nano
- VCC (for each servomotor) connected to the 5V net of the circuit
- GND (for each servomotor) connected to the ground net of the circuit
Voltage Regulator
- IN connected to the VCC pin of the 9V Battery
- OUT connected to the 5V net of the circuit
- GND connected to the ground net of the circuit
Battery 9V
- VCC connected to the IN pin of the Voltage Regulator
- GND connected to the ground net of the circuit
Documented Code
Arduino Nano - sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The code provided for the Arduino Nano is a template and does not contain any functional code. It is expected that the user will fill in the setup and loop functions with the necessary logic to control the servomotors based on the input from the ultrasonic sensor.
