Arduino Nano-Controlled Servo Mechanism with Ultrasonic Sensing
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates an Arduino Nano microcontroller with a set of peripherals including a 7805 voltage regulator, HC-SR04 Ultrasonic Sensor, multiple Tower Pro SG90 servos, a single 18650 Li-Ion battery, and a Rocker Switch. The Arduino Nano serves as the central processing unit, interfacing with the ultrasonic sensor for distance measurement and controlling the servos. The 7805 voltage regulator is used to provide a stable 5V supply to the servos and the ultrasonic sensor from the 18650 Li-Ion battery. The Rocker Switch is used to control the power supply to the circuit.
Component List
- Arduino Nano: A compact microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
- 7805 Voltage Regulator: A voltage regulator that outputs a stable 5V from a higher voltage input.
- HC-SR04 Ultrasonic Sensor: A sensor for measuring distance via ultrasonic waves.
- Tower Pro SG90 Servo: A small and lightweight servo motor suitable for a variety of applications.
- 18650 Li-Ion Battery: A rechargeable battery providing the power source for the circuit.
- Rocker Switch: A switch to control the power supply to the circuit.
Wiring Details
Arduino Nano
- GND: Connected to the ground plane of the circuit.
- D2: Connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor.
- D3: Connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor.
- D8, D9, D10, D11/MOSI: Connected to the Signal pins of the Tower Pro SG90 servos.
- VIN: Connected to the output of the Rocker Switch and input of the 7805 Voltage Regulator.
- 5V: Connected to the VCC pin of the HC-SR04 Ultrasonic Sensor and the +5V pins of the Tower Pro SG90 servos.
7805 Voltage Regulator
- Vin: Connected to the Rocker Switch.
- Gnd: Connected to the ground plane of the circuit.
- Vout: Connected to the +5V pins of the Tower Pro SG90 servos.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to the 5V output from the Arduino Nano.
- TRIG: Connected to pin D2 of the Arduino Nano.
- ECHO: Connected to pin D3 of the Arduino Nano.
- GND: Connected to the ground plane of the circuit.
Tower Pro SG90 Servos
- Signal: Each servo's signal pin is connected to a designated digital pin on the Arduino Nano (D8, D9, D10, D11/MOSI).
- +5V: All servos' +5V pins are connected to the Vout of the 7805 Voltage Regulator.
- GND: All servos' GND pins are connected to the ground plane of the circuit.
18650 Li-Ion Battery
- Positive: Connected to pin 1 of the Rocker Switch.
- Negative: Connected to the ground plane of the circuit.
Rocker Switch
- Pin 1: Connected to the Positive terminal of the 18650 Li-Ion Battery.
- Pin 2: Connected to the VIN of the Arduino Nano and Vin of the 7805 Voltage Regulator.
Documented Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The actual functionality of the code is not provided in the input. The user should implement the setup and loop functions to control the servos and read data from the ultrasonic sensor.