Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino-Controlled Robotics Platform with Dual DC Motors, Servo, and Sensor Integration

Image of Arduino-Controlled Robotics Platform with Dual DC Motors, Servo, and Sensor Integration

Circuit Documentation

Summary

This circuit integrates various components controlled by an Arduino UNO microcontroller to perform a range of functions. The circuit includes a DC motor driver (L298N) to control two DC motors, a servomotor (Servomotor S05NF) for precision movement, an ultrasonic sensor (HC-SR04) for distance measurement, and a magnetometer (QMC5883L) for detecting magnetic fields. The system is powered by a 12V battery, and the Arduino UNO manages the logic and sensor integration.

Component List

Arduino UNO

  • Microcontroller board based on the ATmega328P
  • It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.

L298N DC Motor Driver

  • A module for controlling up to two DC motors with a maximum current of 2A per channel.
  • It includes features like speed and direction control.

12V Battery

  • Provides power to the circuit, particularly the motor driver and motors.

DC Motor (x2)

  • Converts electrical energy into mechanical energy to drive a load.

Servomotor S05NF

  • A rotary actuator that allows for precise control of angular position.

HC-SR04 Ultrasonic Sensor

  • Measures distances by emitting ultrasonic waves and detecting the reflection.

QMC5883L Magnetometer

  • A sensor that measures the strength and direction of magnetic fields.

Wiring Details

Arduino UNO

  • 3.3V connected to QMC5883L Magnetometer VCC
  • 5V connected to Servomotor S05NF VCC
  • GND connected to QMC5883L Magnetometer GND and 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 12V Battery +
  • GND connected to 12V Battery -
  • OUT3 connected to DC Motor pin 2
  • OUT4 connected to DC Motor pin 1

DC Motors

  • One motor connected to L298N DC Motor Driver OUT1 and OUT2
  • Another motor connected to L298N DC Motor Driver OUT3 and OUT4

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 Notes

  • The provided code is a template and does not contain any functional code. It needs to be populated with the logic to control the motors, read sensor data, and perform the desired actions based on sensor inputs.
  • The setup() function is used to initialize variables, pin modes, start using libraries, etc. The code in the setup() function will only run once, after each powerup or reset of the Arduino board.
  • The loop() function is used for the main program logic. It runs continuously over and over again.
  • The actual implementation should include motor control routines, sensor readings, and possibly communication protocols if data needs to be sent to a computer or another device.