Arduino UNO and L298N Motor Driver-Based Motion-Activated Robotic System with PIR Sensor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control two hobby motors using an Arduino UNO, a PIR sensor, and an L298N DC motor driver. The circuit is powered by a 12V battery and includes a rocker switch for power control. The PIR sensor detects motion and sends a signal to the Arduino, which then controls the motors through the L298N motor driver.
Component List
L298N DC Motor Driver
- Description: A dual H-bridge motor driver that allows control of the speed and direction 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
PIR Sensor
- Description: A passive infrared sensor used to detect motion.
- Pins: VDD, SIG, GND
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
Battery 12V
- Description: A 12V battery used to power the circuit.
- Pins: +, -
Motor (Hobby Gear Motor)
- Description: A small DC motor with a gearbox for increased torque.
- Pins: vcc, GND
Rocker Switch
- Description: A switch used to control the power supply to the circuit.
- Pins: 1, 2
Wiring Details
L298N DC Motor Driver
- 12V connected to Rocker Switch pin 2
- GND connected to Battery 12V pin -
- 5V connected to Rocker Switch pin 2
- IN1 connected to Arduino UNO pin D4
- IN2 connected to Arduino UNO pin D5
- IN3 connected to Arduino UNO pin D7
- IN4 connected to Arduino UNO pin D8
- ENA connected to Arduino UNO pin D3
- ENB connected to Arduino UNO pin D6
- OUT1 connected to Motor (Hobby Gear Motor) pin vcc
- OUT2 connected to Motor (Hobby Gear Motor) pin GND
- OUT3 connected to Motor (Hobby Gear Motor) pin GND
- OUT4 connected to Motor (Hobby Gear Motor) pin vcc
PIR Sensor
- GND connected to Arduino UNO pin GND
- VDD connected to Arduino UNO pin Vin
- SIG connected to Arduino UNO pin D2
Arduino UNO
- GND connected to PIR Sensor pin GND
- Vin connected to PIR Sensor pin VDD
- D2 connected to PIR Sensor pin SIG
- D3 connected to L298N DC Motor Driver pin ENA
- D4 connected to L298N DC Motor Driver pin IN1
- D5 connected to L298N DC Motor Driver pin IN2
- D6 connected to L298N DC Motor Driver pin ENB
- D7 connected to L298N DC Motor Driver pin IN3
- D8 connected to L298N DC Motor Driver pin IN4
- GND connected to Battery 12V pin -
- GND connected to Rocker Switch pin 1
Battery 12V
- + connected to Rocker Switch pin 2
- - connected to Arduino UNO pin GND
- - connected to L298N DC Motor Driver pin GND
Motor (Hobby Gear Motor)
- vcc connected to L298N DC Motor Driver pin OUT1
- GND connected to L298N DC Motor Driver pin OUT2
- vcc connected to L298N DC Motor Driver pin OUT4
- GND connected to L298N DC Motor Driver pin OUT3
Rocker Switch
- 1 connected to Battery 12V pin -
- 2 connected to Battery 12V pin +
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)