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

Arduino Leonardo-Based Motion Detection and Distance Measurement System

Image of Arduino Leonardo-Based Motion Detection and Distance Measurement System

Circuit Documentation

Summary

The circuit in question is designed to interface an Arduino Leonardo with various sensors and a motor driver to control a DC motor. The sensors include PIR motion sensors, limit switches, and an HC-SR04 ultrasonic distance sensor. The Arduino Leonardo is responsible for processing the inputs from these sensors and controlling the motor driver, which in turn controls the DC motor. The circuit is powered by a DC power source.

Component List

Arduino Leonardo (Rev3b)

  • Microcontroller board based on the ATmega32u4
  • Features digital I/O pins, analog input pins, and PWM pins
  • Provides 3.3V and 5V output for powering sensors and other components

PIR Motion Sensor (Wokwi Compatible)

  • Passive Infrared sensor for detecting motion
  • Outputs a digital signal when motion is detected

Limit Switch

  • Mechanical switch that is actuated by the physical movement of an object
  • Commonly used to detect the presence or position of objects in industrial control applications

IBT-2 H-Bridge Motor Driver

  • Motor driver module capable of driving high current loads
  • Uses an H-Bridge configuration for controlling the direction and speed of a DC motor

DC Motor

  • A simple electric motor that runs on direct current (DC) power
  • Typically used for driving mechanical loads

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

  • Ultrasonic ranging module for distance measurement
  • Operates by sending an ultrasonic pulse and measuring the time taken for the echo to return

DC Power Source

  • Provides the necessary power to the circuit
  • Typically includes a positive and a ground terminal

Wiring Details

Arduino Leonardo (Rev3b)

  • D4/A6 connected to Limit Switch signal pin
  • D5 PWM connected to another Limit Switch signal pin
  • D6 PWM/A7 connected to another Limit Switch signal pin
  • D7 connected to another Limit Switch signal pin
  • 3V3 connected to the ground pins of all Limit Switches, PIR Motion Sensors, HC-SR04, and IBT-2 H-Bridge Motor Driver
  • 5V connected to the voltage pins of all Limit Switches, PIR Motion Sensors, HC-SR04, and IBT-2 H-Bridge Motor Driver
  • GND connected to the DC Power Source ground
  • D8/A8 connected to PIR Motion Sensor OUT pin
  • D9 PWM/A9 connected to another PIR Motion Sensor OUT pin
  • D10 PWM/A10 connected to IBT-2 H-Bridge Motor Driver RPWM pin
  • D11 PWM connected to IBT-2 H-Bridge Motor Driver LPWM pin
  • D12/A11 connected to HC-SR04 ECHO pin
  • D13 PWM connected to HC-SR04 TRIG pin

PIR Motion Sensor (Wokwi Compatible)

  • VCC connected to 5V from Arduino Leonardo
  • OUT connected to D8/A8 or D9 PWM/A9 on Arduino Leonardo
  • GND connected to common ground

Limit Switch

  • S connected to D4/A6, D5 PWM, D6 PWM/A7, or D7 on Arduino Leonardo
  • G connected to common ground
  • V connected to 5V from Arduino Leonardo

IBT-2 H-Bridge Motor Driver

  • VCC connected to 5V from Arduino Leonardo
  • GND connected to common ground
  • L_EN and R_EN connected to 5V from Arduino Leonardo
  • RPWM connected to D10 PWM/A10 on Arduino Leonardo
  • LPWM connected to D11 PWM on Arduino Leonardo
  • Motor connections to DC Motor pins

DC Motor

  • pin 1 and pin 2 connected to IBT-2 H-Bridge Motor Driver

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

  • VCC connected to 5V from Arduino Leonardo
  • TRIG connected to D13 PWM on Arduino Leonardo
  • ECHO connected to D12/A11 on Arduino Leonardo
  • GND connected to common ground

DC Power Source

  • Ground connected to common ground
  • Positive connected to IBT-2 H-Bridge Motor Driver

Documented Code

There is no code provided for the microcontroller. The code would typically include initialization of the input/output pins, reading sensor states, implementing control logic for the motor based on sensor inputs, and handling timing for the ultrasonic sensor measurements. Without the code, the specific functionality and behavior of the circuit cannot be documented further.