Raspberry Pi – BI-COLOR RIGHT ANGLE LED – 2xGPIO

Moving on from “My first GPIO LED”, I decided to take a look at a different LED I had in my possession, an L-59BL/1.
This LED has 3 pins and I had no idea what they were for, so I Googled it and found this parts list, and this data sheet.

So this LED has two anodes, one for Red and one for Green. This would let me try and use two GPIO Pins.
I decided to leave the +5V LED connected, and so used another Female-to-Female jumper to connect Pin-12 (GPIO-18). This would be in addition to the already connected Pin-11 (GPIO-17).

Raspberry Pi - BI-COLOR RIGHT ANGLE LED - 2xGPIOOriginal image found here – http://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/.

To connect one anode to the circuit, I decided to use the 3x10k-Ohm in parallel I already had to limit the current for Pin-11. But with the +5V LED taking up another resistor, that left me with no more resistors!

After some digging around, I found a 1k-Ohm SIL (similar to this) that I had removed from a previous PCB. I would use this for the second anode.
I stripped 3 Female-to-Female jumper wires off my ribbon cable to house the 3-Pin LED.
The finished circuit looks like this (the picture had to be taken in the dark as the LED was quite dim in my circuit).

To control GPIO-18, I had to follow the setup steps from my previous post.

1
2
root@raspberrypi:~# echo "18" > /sys/class/gpio/export
root@raspberrypi:~# echo "out" > /sys/class/gpio/gpio18/direction

Then I could control both lights.

Raspberry Pi - BI-COLOR RIGHT ANGLE LED - 2xGPIO Schematic

1
2
3
4
5
6
7
8
9
root@raspberrypi:~# echo "1" > /sys/class/gpio/gpio17/value
root@raspberrypi:~# echo "0" > /sys/class/gpio/gpio17/value
root@raspberrypi:~# echo "1" > /sys/class/gpio/gpio18/value
root@raspberrypi:~# echo "1" > /sys/class/gpio/gpio17/value
root@raspberrypi:~# echo "0" > /sys/class/gpio/gpio17/value
root@raspberrypi:~# echo "0" > /sys/class/gpio/gpio18/value
root@raspberrypi:~# echo "1" > /sys/class/gpio/gpio17/value
root@raspberrypi:~# echo "0" > /sys/class/gpio/gpio17/value
root@raspberrypi:~# echo "1" > /sys/class/gpio/gpio18/value

I didn't actually get any Red light at all! I think this is because the part I have is actually a Yellow/Green two-colour part.

 

Source: Raspberry Pi – BI-COLOR RIGHT ANGLE LED – 2xGPIO


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top