Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Raspberry Pi 4B Controlled Multi-Color LED Indicator

View and Edit Project In Cirkit DesignerImage of Raspberry Pi 4B Controlled Multi-Color LED Indicator

Circuit Documentation

Summary

This circuit consists of a Raspberry Pi 4B microcontroller unit (MCU) that controls three LEDs (red, yellow, and green). Each LED is connected to a GPIO pin on the Raspberry Pi 4B and is in series with a 220-ohm resistor to limit the current. The cathodes of the LEDs are connected directly to the GPIO pins, while the anodes are connected to the resistors, which in turn are connected to the ground (GND) pin of the Raspberry Pi 4B.

Component List

LEDs

Microcontroller

Resistors

Wiring Details

LED (Red)

LED (Yellow)

LED (Green)

Resistor (220 Ohms)

Raspberry Pi 4B

Documented Code

The following code is intended to be run on the Raspberry Pi 4B microcontroller. The code is written in the Arduino programming language (.ino file extension) and is structured with a setup() function that runs once at the start and a loop() function that runs repeatedly.

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

The code provided is a template and does not contain any specific logic to control the LEDs. To control the LEDs, the GPIO pins would need to be set as outputs in the setup() function, and then turned on and off in the loop() function using digital write commands.