Circuit Documentation
Summary
The circuit in question consists of an Arduino UNO microcontroller, a PIR (Passive Infrared) sensor, and a Bluetooth module. The Arduino UNO serves as the central processing unit, interfacing with the PIR sensor to detect motion and communicating with external devices via the Bluetooth module. The PIR sensor is used to detect the presence of humans or animals through infrared signals, and the Bluetooth module enables wireless communication.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
- Purpose: Acts as the central processing unit for the circuit, reading sensor data and handling communication with the Bluetooth module.
PIR Sensor
- Description: A sensor that detects motion by measuring changes in the infrared levels emitted by surrounding objects.
- Pins: VDD, SIG, GND.
- Purpose: To detect motion and provide a signal to the Arduino UNO.
Bluetooth Module
- Description: A wireless communication module that allows for serial communication over Bluetooth.
- Pins: en, vcc, gnd, txd, rxd, start.
- Purpose: To enable wireless communication between the Arduino UNO and other Bluetooth-capable devices.
Wiring Details
Arduino UNO
- 5V: Connected to the VDD of the PIR sensor and vcc of the Bluetooth module to provide power.
- GND: Connected to the GND of the PIR sensor and gnd of the Bluetooth module to complete the power circuit.
- D7: Connected to the SIG of the PIR sensor to receive motion detection signals.
- D0 (RX): Connected to the txd of the Bluetooth module to receive data.
- D1 (TX): Connected to the rxd of the Bluetooth module to transmit data.
PIR Sensor
- VDD: Connected to the 5V of the Arduino UNO.
- SIG: Connected to the D7 of the Arduino UNO.
- GND: Connected to the GND of the Arduino UNO.
Bluetooth Module
- vcc: Connected to the 5V of the Arduino UNO.
- gnd: Connected to the GND of the Arduino UNO.
- txd: Connected to the D0 (RX) of the Arduino UNO.
- rxd: Connected to the D1 (TX) of the Arduino UNO.
Documented Code
Arduino UNO Code - sketch.ino
int pir = 7;
void setup() {
Serial.begin(9600);
pinMode(pir, INPUT);
}
void loop() {
if (digitalRead(pir) == 1) {
Serial.println("23");
delay(3000);
}
}
Description: This code initializes the Arduino UNO's serial communication at a baud rate of 9600 and sets the pin connected to the PIR sensor (D7) as an input. In the main loop, the Arduino checks for a high signal from the PIR sensor indicating motion detection. Upon detection, it sends the string "23" over the serial connection, which could be received by the connected Bluetooth module and transmitted wirelessly. There is a delay of 3 seconds after each detection to prevent continuous transmission.