Circuit Documentation
Summary
This circuit is designed to interface an Arduino UNO with various sensors and actuators, including IR sensors, LDR sensors, LEDs, and a relay. The Arduino UNO is powered by a battery and controls the relay, which in turn switches LEDs on and off. The IR sensor and LDR sensor provide input to the Arduino, which can be used to make decisions based on environmental conditions.
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.
Battery
- Power source for the circuit.
IR Sensor
- An infrared sensor capable of detecting obstacles and measuring distances.
Sensor LDR LM393
- A light-dependent resistor sensor module based on the LM393 comparator. It is used for detecting light intensity.
Relay
- An electrically operated switch that allows the Arduino to control higher power loads.
LEDs (Red and Blue)
- Light Emitting Diodes that emit red and blue light when powered.
GND
- A ground reference point for the circuit.
Wiring Details
Arduino UNO
- Vin connected to the positive terminal of the battery.
- GND connected to the negative terminal of the battery, ground of IR sensor, ground of LDR sensor, and cathodes of all LEDs.
- 5V output provides power to the IR sensor, LDR sensor, and the coil of the relay.
- D3 controls the relay coil.
- A0 reads analog input from the LDR sensor.
- A1 reads analog input from the IR sensor.
Battery
- + (positive terminal) connected to Arduino UNO Vin.
- - (negative terminal) connected to Arduino UNO GND.
IR Sensor
- vcc connected to Arduino UNO 5V.
- gnd connected to Arduino UNO GND.
- out connected to Arduino UNO A1.
Sensor LDR LM393
- VCC connected to Arduino UNO 5V.
- GND connected to Arduino UNO GND.
- A0 connected to Arduino UNO A0.
Relay
- Common 1 and Common 2 connected to the positive terminal of the battery.
- Coil connected to Arduino UNO D3 and 5V.
- NO 1 connected to the anode of a blue LED.
- NC 1 connected to the anode of a red LED.
- NO 2 connected to the anode of another blue LED.
- NC 2 connected to the anode of another red LED.
LEDs (Red and Blue)
- Cathodes of all LEDs connected to Arduino UNO GND.
- Anodes of red LEDs connected to NC 1 and NC 2 of the relay.
- Anodes of blue LEDs connected to NO 1 and NO 2 of the relay.
Documented Code
void setup() {
}
void loop() {
}
The provided code is a template with empty setup()
and loop()
functions. The setup()
function is intended for initialization code that runs once at the start, while the loop()
function contains code that runs repeatedly. Actual implementation details need to be added based on the desired behavior of the circuit.