Arduino-Controlled Ultrasonic Sensor with Servo and Dual Motor Driver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to interface an Arduino UNO with various components including an HC-SR04 Ultrasonic Sensor, a Micro servo 9G, an L298N DC motor driver, two hobbyist yellow geared motors, and a 9V battery power supply. The circuit is controlled via an Arduino UNO, which is programmed to interact with the ultrasonic sensor and servo, as well as to drive the motors through the motor driver. A rocker switch is included to control the power flow from the battery.
Component List
9V Battery
- Description: Provides the power supply for the circuit.
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used as the main controller for the circuit.
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor that measures distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
Micro servo 9G
- Description: A small and lightweight servo motor used for precise angular movement.
L298N DC Motor Driver
- Description: A dual H-bridge motor driver that allows for the control of two DC motors or one stepper motor.
Rocker Switch (SPST)
- Description: A single pole single throw switch used to connect or disconnect the power supply.
Motor Amarillo Motorreductor Hobby (x2)
- Description: Yellow hobbyist geared motors used for driving mechanical loads.
Comments
- Description: Placeholder components for additional notes or documentation.
Wiring Details
9V Battery
-connected to Rocker Switch (SPST) pin1+connected to L298N DC motor driver pin12V, Arduino UNO pinVin
Arduino UNO
IOREFconnected to Micro servo 9G pin+5V5Vconnected to HC-SR04 Ultrasonic Sensor pinVCCGNDconnected to HC-SR04 Ultrasonic Sensor pinGND, L298N DC motor driver pinGND, Micro servo 9G pinGNDVinconnected to 9V Battery+D10connected to Micro servo 9G pinPWMD9connected to HC-SR04 Ultrasonic Sensor pinTRIGD8connected to HC-SR04 Ultrasonic Sensor pinECHOD7connected to L298N DC motor driver pinIN1D6connected to L298N DC motor driver pinIN2D5connected to L298N DC motor driver pinIN3D4connected to L298N DC motor driver pinIN4
HC-SR04 Ultrasonic Sensor
VCCconnected to Arduino UNO pin5VTRIGconnected to Arduino UNO pinD9ECHOconnected to Arduino UNO pinD8GNDconnected to Arduino UNO pinGND
Micro servo 9G
GNDconnected to Arduino UNO pinGND+5Vconnected to Arduino UNO pinIOREFPWMconnected to Arduino UNO pinD10
L298N DC Motor Driver
12Vconnected to 9V Battery+GNDconnected to Rocker Switch (SPST) pin2, Arduino UNO pinGNDIN1connected to Arduino UNO pinD7IN2connected to Arduino UNO pinD6IN3connected to Arduino UNO pinD5IN4connected to Arduino UNO pinD4OUT1connected to Motor Amarillo Motorreductor HobbyvccOUT2connected to Motor Amarillo Motorreductor HobbyGNDOUT3connected to Motor Amarillo Motorreductor HobbyGNDOUT4connected to Motor Amarillo Motorreductor Hobbyvcc
Rocker Switch (SPST)
1connected to 9V Battery-2connected to L298N DC motor driver pinGND
Motor Amarillo Motorreductor Hobby
vccconnected to L298N DC motor driver pinsOUT1andOUT4GNDconnected to L298N DC motor driver pinsOUT2andOUT3
Documented Code
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:
}
Additional Documentation (documentation.txt)
No additional code documentation provided.