Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Battery-Powered Robotic System with Ultrasonic Sensors and Magnetometer

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Battery-Powered Robotic System with Ultrasonic Sensors and Magnetometer

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller interfacing with multiple sensors and a motor driver to control two DC motors. The sensors include a QMC5883L magnetometer and three HC-SR04 ultrasonic sensors. The circuit is powered by a Li-ion 18650 battery. The L298N motor driver is used to control the DC motors.

Component List

  1. 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
  2. QMC5883L Magnetometer

    • Description: A 3-axis digital compass.
    • Pins: VCC, GND, SCL, SDA, DRDY
  3. HC-SR04 Ultrasonic Sensor

    • Description: A sensor used for distance measurement.
    • Pins: VCC, TRIG, ECHO, GND
  4. Li-ion 18650 Battery

    • Description: A rechargeable lithium-ion battery.
    • Pins: -, +
  5. L298N DC Motor Driver

    • Description: A dual H-Bridge motor driver.
    • 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
  6. DC Motor

    • Description: A simple DC motor.
    • Pins: pin 1, pin 2

Wiring Details

Arduino UNO

QMC5883L Magnetometer

HC-SR04 Ultrasonic Sensor (1)

HC-SR04 Ultrasonic Sensor (2)

HC-SR04 Ultrasonic Sensor (3)

Li-ion 18650 Battery

L298N DC Motor Driver

DC Motor (1)

DC Motor (2)

Code Documentation

Arduino UNO Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This code is a basic template for the Arduino UNO. The setup() function is where you initialize your components and set up your initial conditions. The loop() function is where you place the code that you want to run continuously.