Circuit Documentation
Summary of the Circuit
This circuit is designed to interface with a Raspberry Pi 4B to control three LEDs of different colors: red, yellow, and green. Each LED is connected to a GPIO pin on the Raspberry Pi through a current-limiting resistor to prevent damage to the LED. The ground (GND) pins of all the resistors are tied together and connected to the Raspberry Pi's GND pin, creating a common ground for the circuit.
Component List
LEDs
- LED (Red): A two-pin red LED that emits red light when powered.
- LED (Yellow): A two-pin yellow LED that emits yellow light when powered.
- LED (Green): A two-pin green LED that emits green light when powered.
Raspberry Pi 4B
- Raspberry Pi 4B: A single-board computer with multiple GPIO pins used for controlling the LEDs.
Resistors
- Resistor (220 Ohms): Three resistors each with a resistance of 220 Ohms, used to limit the current flowing through the LEDs.
Wiring Details
LED (Red)
- Anode: Connected to GPIO17 on the Raspberry Pi 4B.
- Cathode: Connected to one end of a 220 Ohm resistor.
LED (Yellow)
- Anode: Connected to GPIO27 on the Raspberry Pi 4B.
- Cathode: Connected to one end of a 220 Ohm resistor.
LED (Green)
- Anode: Connected to GPIO22 on the Raspberry Pi 4B.
- Cathode: Connected to one end of a 220 Ohm resistor.
Raspberry Pi 4B
- GPIO17: Connected to the anode of the red LED.
- GPIO27: Connected to the anode of the yellow LED.
- GPIO22: Connected to the anode of the green LED.
- GND: Connected to the other end of the 220 Ohm resistors (common ground).
Resistors (220 Ohms)
- One end: Connected to the cathode of each LED (red, yellow, and green).
- Other end: Connected to the GND pin on the Raspberry Pi 4B.
Documented Code
Since no code was provided, this section is left blank. To control the LEDs, code would typically be written to set the GPIO pins (GPIO17, GPIO27, GPIO22) as outputs and then toggled between high and low states to turn the LEDs on and off. The code would be run on the Raspberry Pi 4B using a suitable programming language such as Python, with a library like RPi.GPIO or gpiozero to interface with the GPIO pins.
