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

Arduino UNO Controlled DC Motor with IR Sensors and Relay Switching

Image of Arduino UNO Controlled DC Motor with IR Sensors and Relay Switching

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a DC motor using an Arduino UNO microcontroller in conjunction with an L298N DC motor driver. The circuit also includes two IR sensors for input, two pushbuttons for manual control, and a 1-channel 5V relay module for additional power control mechanisms. The Arduino UNO is responsible for processing the inputs from the IR sensors and pushbuttons to control the motor's operation through the motor driver.

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.

DC Motor

  • An electric motor that runs on direct current (DC) electricity.
  • It has two pins for power connection.

L298N DC Motor Driver

  • A high-power motor driver capable of driving two DC motors.
  • It has pins for motor connections, power supply, and control inputs.

1 Channel 5V Relay Module

  • An electrically operated switch that allows you to turn on or off a circuit using voltage and/or current much higher than a microcontroller can handle.
  • It has a set of input and output pins for controlling and switching high-power devices.

Pushbutton (x2)

  • A simple switch mechanism for controlling some aspect of a machine or a process.
  • It has four pins, two of which are used for the switch operation.

IR Sensor (x2)

  • An electronic device that emits and/or detects infrared radiation to sense certain aspects of its surroundings.
  • It has three pins: VCC, GND, and an output signal pin.

Wiring Details

Arduino UNO

  • 5V: Connected to the 5V power bus.
  • GND: Connected to the ground bus.
  • D2, D3: Connected to pushbuttons.
  • D4, D5: Connected to the L298N motor driver for motor control.
  • D6, D7: Connected to IR sensors for input signals.
  • D8: Connected to the relay module for control.

DC Motor

  • Pin 1: Connected to OUT1 on the L298N motor driver.
  • Pin 2: Connected to OUT2 on the L298N motor driver.

L298N DC Motor Driver

  • OUT1, OUT2: Connected to the DC motor.
  • 5V: Connected to the 5V power bus.
  • GND: Connected to the ground bus.
  • IN1, IN2: Controlled by the Arduino UNO for motor operation.

1 Channel 5V Relay Module

  • VCC+: Connected to the 5V power bus.
  • VCC- (GND): Connected to the ground bus.
  • IN: Controlled by the Arduino UNO.
  • N.O., COM: Used for switching external devices (not specified).

Pushbuttons

  • Pin 1: Connected to D2 and D3 on the Arduino UNO for manual control.
  • Pin 3: Connected to the ground bus.

IR Sensors

  • VCC: Connected to the 5V power bus.
  • GND: Connected to the ground bus.
  • Out: Connected to D6 and D7 on the Arduino UNO for sensing.

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 to control the circuit. The user is expected to write the necessary code to read inputs from the IR sensors and pushbuttons and control the DC motor through the motor driver.