Arduino Nano-Based Motion Detection and Distance Measurement System with IR Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates various sensors and components with an Arduino Nano microcontroller to perform sensing and control tasks. The circuit includes an HC-SR04 ultrasonic distance sensor, a PIR HC-SR501 motion sensor, a TSOP312 IR receiver, and an LED. Power is supplied by a pair of 18650 Li-ion batteries. The Arduino Nano is the central processing unit that interfaces with the sensors and controls the LED based on the inputs from these sensors.
Component List
LED: Two Pin (white)
- Description: A white LED used for indication purposes.
- Pins: cathode, anode
Resistor (100 Ohms)
- Description: A resistor with a resistance of 100 Ohms, likely used for current limiting.
- Pins: pin1, pin2
Resistor (1000 Ohms)
- Description: A resistor with a resistance of 1000 Ohms, possibly used for pull-up or pull-down purposes.
- Pins: pin1, pin2
TSOP312 IR Receiver
- Description: An infrared receiver for remote control applications.
- Pins: GND, Vs, Data
Arduino Nano
- Description: A compact microcontroller board based on the ATmega328P, used as the main controller in the circuit.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- Description: A sensor that measures distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
- Pins: VCC, TRIG, ECHO, GND
PIR HC-SR501
- Description: A passive infrared sensor used to detect motion.
- Pins: VDD, SIG, GND
18650 Li-ion Battery x 2
- Description: A power source consisting of two 18650 lithium-ion batteries.
- Pins: +, -
Wiring Details
LED: Two Pin (white)
- Cathode: Connected to the GND of the Arduino Nano.
- Anode: Connected to one end of a 100 Ohms resistor, whose other end is connected to pin D9 of the Arduino Nano.
Resistor (100 Ohms)
- Pin1: Connected to the anode of the LED.
- Pin2: Connected to pin D9 of the Arduino Nano.
Resistor (1000 Ohms)
- Pin1: Connected to the Vs pin of the TSOP312 IR Receiver.
- Pin2: Connected to pin D1/TX of the Arduino Nano.
TSOP312 IR Receiver
- GND: Connected to the GND of the Arduino Nano.
- Vs: Connected to one end of a 1000 Ohms resistor.
- Data: Connected to the GND of the Arduino Nano.
Arduino Nano
- 5V: Connected to the VCC of the HC-SR04 Ultrasonic Distance Sensor and VDD of the PIR HC-SR501.
- GND: Common ground connected to the GND of the HC-SR04, the GND of the PIR HC-SR501, the GND of the TSOP312 IR Receiver, and the cathode of the LED.
- D2: Connected to the SIG pin of the PIR HC-SR501.
- D3: Connected to the TRIG pin of the HC-SR04 Ultrasonic Distance Sensor.
- D4: Connected to the ECHO pin of the HC-SR04 Ultrasonic Distance Sensor.
- D9: Connected to one end of a 100 Ohms resistor, with the other end connected to the anode of the LED.
- VIN: Connected to the + pin of the 18650 Li-ion Battery x 2.
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- VCC: Connected to the 5V pin of the Arduino Nano.
- TRIG: Connected to pin D3 of the Arduino Nano.
- ECHO: Connected to pin D4 of the Arduino Nano.
- GND: Connected to the common ground.
PIR HC-SR501
- VDD: Connected to the 5V pin of the Arduino Nano.
- SIG: Connected to pin D2 of the Arduino Nano.
- GND: Connected to the common ground.
18650 Li-ion Battery x 2
- +: Connected to the VIN pin of the Arduino Nano.
- -: Connected to the common ground.
Documented Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a template and does not contain any functional code. It is expected that the user will fill in the setup() and loop() functions with code to initialize the sensors and perform tasks based on sensor inputs.