Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller interfacing with an HC-SR04 Ultrasonic Sensor and multiple LEDs through resistors. The Arduino UNO is used to control the sensor and LEDs, providing a simple example of sensor integration and LED control.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
HC-SR04 Ultrasonic Sensor
- Description: A sensor used to measure distance using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
Resistor (220 Ohms)
- Description: A resistor with a resistance of 220 Ohms.
- Pins: pin1, pin2
LED: Two Pin (white)
- Description: A white LED with two pins.
- Pins: cathode, anode
Wiring Details
Arduino UNO
GND is connected to:
- GND of HC-SR04 Ultrasonic Sensor
- Anode of all LEDs
5V is connected to VCC of HC-SR04 Ultrasonic Sensor.
D13 is connected to ECHO of HC-SR04 Ultrasonic Sensor.
D12 is connected to TRIG of HC-SR04 Ultrasonic Sensor.
D8 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
D7 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
D6 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
D5 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
D4 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
D3 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
D2 is connected to pin1 of a 220 Ohm Resistor.
- pin2 of this resistor is connected to the cathode of an LED.
HC-SR04 Ultrasonic Sensor
- GND is connected to GND of Arduino UNO.
- VCC is connected to 5V of Arduino UNO.
- ECHO is connected to D13 of Arduino UNO.
- TRIG is connected to D12 of Arduino UNO.
Resistors
Resistor 1:
- pin1 is connected to D8 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
Resistor 2:
- pin1 is connected to D7 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
Resistor 3:
- pin1 is connected to D6 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
Resistor 4:
- pin1 is connected to D5 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
Resistor 5:
- pin1 is connected to D4 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
Resistor 6:
- pin1 is connected to D3 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
Resistor 7:
- pin1 is connected to D2 of Arduino UNO.
- pin2 is connected to the cathode of an LED.
LEDs
LED 1:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
LED 2:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
LED 3:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
LED 4:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
LED 5:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
LED 6:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
LED 7:
- anode is connected to GND of Arduino UNO.
- cathode is connected to pin2 of a 220 Ohm Resistor.
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is where you initialize your settings, and the loop() function is where the main code runs repeatedly. You can add your sensor reading and LED control logic in these functions.
