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

Arduino-Controlled Ultrasonic Sensor with Bluetooth and Dual Motor Driver

Image of Arduino-Controlled Ultrasonic Sensor with Bluetooth and Dual Motor Driver

Circuit Documentation

Summary of the Circuit

This circuit is designed to interface an Arduino UNO with various peripherals including an HC-SR04 Ultrasonic Sensor, a Servomotor SG90, an L298N DC motor driver, two hobbyist yellow geared motors, and a Bluetooth HC-06 module. The circuit is powered by a 2 x AA Battery Mount. The Arduino UNO acts as the central controller, managing sensor inputs, motor control, and Bluetooth communication.

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.

HC-SR04 Ultrasonic Sensor

  • An ultrasonic distance sensor that provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm.

Servomotor SG90

  • A small and lightweight servo motor capable of precise control. It operates on 4.8V to 6V and offers good torque for its size.

L298N DC Motor Driver

  • A dual H-bridge motor driver capable of driving two DC motors or one stepper motor. It can handle a current of up to 2A per channel.

Motor Amarillo Motorreductor Hobby (x2)

  • Yellow hobbyist geared motors that are commonly used in robotics and small projects.

Bluetooth HC-06

  • A Bluetooth module that allows for wireless communication between devices. It operates as a slave and can be connected to a variety of devices through its serial port.

2 x AA Battery Mount

  • A battery holder for two AA batteries, providing a convenient power source for portable electronics.

Wiring Details

Arduino UNO

  • 5V connected to HC-SR04 Ultrasonic Sensor VCC
  • GND connected to Servomotor SG90 GND, HC-SR04 Ultrasonic Sensor GND, and L298N DC Motor Driver GND
  • Vin connected to Servomotor SG90 VCC and L298N DC Motor Driver 5V
  • A0 connected to HC-SR04 Ultrasonic Sensor TRIG
  • A1 connected to HC-SR04 Ultrasonic Sensor ECHO
  • D11 connected to L298N DC Motor Driver ENA
  • D8 connected to L298N DC Motor Driver IN1
  • D7 connected to L298N DC Motor Driver IN2
  • D5 connected to L298N DC Motor Driver IN3
  • D4 connected to L298N DC Motor Driver IN4
  • D3 connected to L298N DC Motor Driver ENB
  • D2 connected to Servomotor SG90 SIG

HC-SR04 Ultrasonic Sensor

  • VCC connected to Arduino UNO 5V
  • TRIG connected to Arduino UNO A0
  • ECHO connected to Arduino UNO A1
  • GND connected to Arduino UNO GND

Servomotor SG90

  • SIG connected to Arduino UNO D2
  • VCC connected to Arduino UNO Vin
  • GND connected to Arduino UNO GND

L298N DC Motor Driver

  • OUT1 connected to Motor Amarillo Motorreductor Hobby
  • OUT2 connected to Motor Amarillo Motorreductor Hobby
  • 12V connected to 2 x AA Battery Mount +
  • GND connected to Arduino UNO GND
  • 5V connected to Arduino UNO Vin
  • OUT3 connected to Motor Amarillo Motorreductor Hobby
  • OUT4 connected to Motor Amarillo Motorreductor Hobby
  • ENA connected to Arduino UNO D11
  • IN1 connected to Arduino UNO D8
  • IN2 connected to Arduino UNO D7
  • IN3 connected to Arduino UNO D5
  • IN4 connected to Arduino UNO D4
  • ENB connected to Arduino UNO D3

Motor Amarillo Motorreductor Hobby

  • One motor's vcc connected to L298N DC Motor Driver OUT2, GND to OUT1
  • Another motor's vcc connected to L298N DC Motor Driver OUT4, GND to OUT3

2 x AA Battery Mount

  • + connected to L298N DC Motor Driver 12V
  • - connected to Arduino UNO GND, L298N DC Motor Driver GND

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:

}

Note: The provided code is a template and does not include specific functionality. It should be populated with the setup and loop code required to control the connected components based on the desired application.