Arduino UNO-Based Battery-Powered Robotic Vehicle with Magnetometer and Ultrasonic Sensor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an L298N DC motor driver, a 12V battery, two DC motors, a Servomotor S05NF, an HC-SR04 Ultrasonic Sensor, and a QMC5883L Magnetometer. The circuit is designed to control the motors and read sensor data using the Arduino UNO.
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
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control of two DC motors.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
Battery 12V
- Description: A 12V battery used to power the motor driver.
- Pins: +, -
DC Motor
- Description: A standard DC motor.
- Pins: pin 1, pin 2
Servomotor S05NF
- Description: A standard servomotor.
- Pins: SIG, VCC, GND
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic sensor used for distance measurement.
- Pins: VCC, TRIG, ECHO, GND
QMC5883L Magnetometer
- Description: A magnetometer used for measuring magnetic fields.
- Pins: VCC, GND, SCL, SDA, DRDY
Wiring Details
Arduino UNO
- 3.3V connected to QMC5883L Magnetometer VCC
- 5V connected to Servomotor S05NF VCC
- GND connected to QMC5883L Magnetometer GND
- GND connected to Servomotor S05NF GND
- SCL connected to QMC5883L Magnetometer SCL
- SDA connected to QMC5883L Magnetometer SDA
- D9 connected to Servomotor S05NF SIG
- D7 connected to L298N DC Motor Driver IN4
- D6 connected to L298N DC Motor Driver IN3
- D5 connected to L298N DC Motor Driver IN2
- D4 connected to L298N DC Motor Driver IN1
- D3 connected to L298N DC Motor Driver ENA
- D2 connected to L298N DC Motor Driver ENB
L298N DC Motor Driver
- OUT1 connected to DC Motor pin 2
- OUT2 connected to DC Motor pin 1
- 12V connected to Battery 12V +
- GND connected to Battery 12V -
- OUT3 connected to DC Motor pin 2
- OUT4 connected to DC Motor pin 1
Battery 12V
- + connected to L298N DC Motor Driver 12V
- - connected to L298N DC Motor Driver GND
DC Motor 1
- pin 1 connected to L298N DC Motor Driver OUT2
- pin 2 connected to L298N DC Motor Driver OUT1
DC Motor 2
- pin 1 connected to L298N DC Motor Driver OUT4
- pin 2 connected to L298N DC Motor Driver OUT3
Servomotor S05NF
- SIG connected to Arduino UNO D9
- VCC connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
QMC5883L Magnetometer
- VCC connected to Arduino UNO 3.3V
- GND connected to Arduino UNO GND
- SCL connected to Arduino UNO SCL
- SDA connected to Arduino UNO SDA
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)
This document provides a comprehensive overview of the circuit, including the components used, their wiring details, and the code for the Arduino UNO microcontroller.