Arduino-Controlled Robot with Distance Sensing and IR Obstacle Detection
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates various components to perform a set of functions involving sensor input, motor control, and power management. An Arduino UNO serves as the central microcontroller, interfacing with an IR sensor for input, a VL53L0X Time of Flight Distance Sensor for distance measurement, and an L298N DC motor driver to control two DC Mini Metal Gear Motors. The circuit is powered by an 18650 Li-Ion battery, which provides the necessary voltage for the motors and logic levels for the sensors and microcontroller.
Component List
Adafruit VL53L0X Time of Flight Distance Sensor
- Function: Measures distances using time of flight technology.
- Pins: VCC, GND, SCL, SDA, GPIO, XSHUT
L298N DC Motor Driver
- Function: Controls the direction and speed of 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
IR Sensor
- Function: Detects objects within its proximity using infrared light.
- Pins: out, gnd, vcc
18650 Li-Ion Battery
- Function: Provides power to the circuit.
- Pins: Positive, Negative
DC Mini Metal Gear Motor (x2)
- Function: Provides mechanical motion for the application.
- Pins: IN1, IN2
Arduino UNO
- Function: Acts as the central processing unit for the circuit, running the embedded code.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13
Wiring Details
Adafruit VL53L0X Time of Flight Distance Sensor
- VCC connected to Arduino UNO Vin
- GND connected to common ground
- SCL connected to Arduino UNO A5
- SDA connected to Arduino UNO A4
L298N DC Motor Driver
- OUT1/OUT2 connected to DC Mini Metal Gear Motor (Motor 1)
- OUT3/OUT4 connected to DC Mini Metal Gear Motor (Motor 2)
- 12V connected to 18650 Li-Ion Battery Positive
- GND connected to common ground
- 5V connected to Arduino UNO Vin
- ENA/ENB connected to Arduino UNO D5/D10
- IN1-IN4 connected to Arduino UNO D6-D9
IR Sensor
- out connected to Arduino UNO A0
- gnd connected to common ground
- vcc connected to Arduino UNO Vin
18650 Li-Ion Battery
- Positive connected to L298N DC motor driver 12V
- Negative connected to common ground
DC Mini Metal Gear Motor (Motor 1)
- IN1 connected to L298N DC motor driver OUT2
- IN2 connected to L298N DC motor driver OUT1
DC Mini Metal Gear Motor (Motor 2)
- IN1 connected to L298N DC motor driver OUT4
- IN2 connected to L298N DC motor driver OUT3
Arduino UNO
- GND connected to common ground
- Vin connected to 18650 Li-Ion Battery Positive and other components requiring 5V
- A0 connected to IR Sensor out
- A4/A5 connected to VL53L0X SDA/SCL
- D5/D6/D7/D8/D9/D10 connected to L298N DC motor driver ENA, IN1, IN2, IN3, IN4, ENB
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 contain any functional code. It needs to be populated with the logic to control the IR sensor, the VL53L0X sensor, and the motor driver based on the requirements of the application.