scass0807
Posts: 8
Joined: Thu Feb 12, 2015 10:27 pm

4 pin RGB LED

Thu Feb 12, 2015 10:42 pm

hi I'm trying to hook up a four pin RGB LED. I have the Canakit raspberry pi b+ ultimate starter kit and one RGB I can't figure out how to hook it up and program there are no tutorials and I already know how to hook up a regular
LED please help

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12217
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: 4 pin RGB LED

Thu Feb 12, 2015 10:48 pm

What kind or RGB LED? If its just three LED's in a package with a common anode, then you can just treat it as if they were three separate LED's, but it might be something else altogether.

Do you have a data sheet of the RGB LED?

jimallyn
Posts: 51
Joined: Wed Nov 12, 2014 9:13 am

Re: 4 pin RGB LED

Thu Feb 12, 2015 10:57 pm

If the LED came with the Canakit, it should have documentation on it in the kit. If not, check their website, or contact them for more information. Or you can figure it out yourself: try applying a low voltage through a resistor to the leads in various combinations until you figure it out.
“So you say you love the poor? Name them.” - Gustavo Gutierrez

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: 4 pin RGB LED

Thu Feb 12, 2015 11:08 pm

I wonder what would happen if you typed "4 pin RGB LED" into Google?

scass0807
Posts: 8
Joined: Thu Feb 12, 2015 10:27 pm

Re: 4 pin RGB LED

Fri Feb 13, 2015 1:29 am

mahjongg wrote:What kind or RGB LED? If its just three LED's in a package with a common anode, then you can just treat it as if they were three separate LED's, but it might be something else altogether.

Do you have a data sheet of the RGB LED?
No data sheet what about resistance

User avatar
mikronauts
Posts: 2722
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: 4 pin RGB LED

Fri Feb 13, 2015 1:34 am

I'd email Canakit support and ask them.

There both common anode and common cathode RGB LED's

There are also 4 lead WS2812b LED's

Best to ask them.
scass0807 wrote:
mahjongg wrote:What kind or RGB LED? If its just three LED's in a package with a common anode, then you can just treat it as if they were three separate LED's, but it might be something else altogether.

Do you have a data sheet of the RGB LED?
No data sheet what about resistance
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: 4 pin RGB LED

Fri Feb 13, 2015 1:50 am

most likely it's a plain rgb led. the longest lead is the common. get an aaa or aa battery and a bit of wire; bend the longest led lead so that you can hold it against one end of the battery without the other 3 leads getting in the way. do so. you should also press one end of the wire against the other end of the battery. you should now have the led, battery and wire together between your thumb and forefinger. this leaves your other hand free to touch the other end of the wire to the 3 remaining led pins. if nothing lights up at all, then turn the battery around...
note: I may or may not know what I'm talking about...

User avatar
DougieLawson
Posts: 36104
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: 4 pin RGB LED

Fri Feb 13, 2015 1:57 am

Use a 560ohm (on each leg except the common anode / common cathode).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
davidcoton
Posts: 4132
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 4 pin RGB LED

Fri Feb 13, 2015 12:50 pm

toxibunny wrote:most likely it's a plain rgb led. the longest lead is the common. get an aaa or aa battery and a bit of wire; bend the longest led lead so that you can hold it against one end of the battery without the other 3 leads getting in the way. do so. you should also press one end of the wire against the other end of the battery. you should now have the led, battery and wire together between your thumb and forefinger. this leaves your other hand free to touch the other end of the wire to the 3 remaining led pins. if nothing lights up at all, then turn the battery around...
This may not work (LED forward voltage can be >1.5V), and worse still,may damage the LED. Use a higher voltage (at least 3V), and put a current limiting resistor between the battery and the common lead (usually the longest). The resistor should be at least 560 ohms, as per Dougie's post, but higher for higher voltage -- up to 10K for a 12V supply. The aim is to limit the current to a few milliamps.

RGB LEDS could be designed for use this way (with external current limiting), or could be designed for fixed voltage with internal current limiting. Assume the former until you know otherwise.
Signature retired

scass0807
Posts: 8
Joined: Thu Feb 12, 2015 10:27 pm

Re: 4 pin RGB LED

Fri Feb 13, 2015 3:51 pm

davidcoton wrote:
toxibunny wrote:most likely it's a plain rgb led. the longest lead is the common. get an aaa or aa battery and a bit of wire; bend the longest led lead so that you can hold it against one end of the battery without the other 3 leads getting in the way. do so. you should also press one end of the wire against the other end of the battery. you should now have the led, battery and wire together between your thumb and forefinger. this leaves your other hand free to touch the other end of the wire to the 3 remaining led pins. if nothing lights up at all, then turn the battery around...
This may not work (LED forward voltage can be >1.5V), and worse still,may damage the LED. Use a higher voltage (at least 3V), and put a current limiting resistor between the battery and the common lead (usually the longest). The resistor should be at least 560 ohms, as per Dougie's post, but higher for higher voltage -- up to 10K for a 12V supply. The aim is to limit the current to a few milliamps.

RGB LEDS could be designed for use this way (with external current limiting), or could be designed for fixed voltage with internal current limiting. Assume the former until you know otherwise.

How do I know which resistor colors have the amount of resistance I want.

User avatar
davidcoton
Posts: 4132
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 4 pin RGB LED

Fri Feb 13, 2015 5:12 pm

scass0807 wrote:How do I know which resistor colors have the amount of resistance I want.
Here or other resources found by Uncle Google.
Signature retired

PiGraham
Posts: 3602
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: 4 pin RGB LED

Fri Feb 13, 2015 5:34 pm

If you have a digital multimeter with diode test function you may find that connecting the probes one way will light the LED dimly. The current is limited and won't harm the LED if you connect it in reverse. Try the various combinations to see if there is common anode or common cathode and which lead is red, green or blue.

scass0807
Posts: 8
Joined: Thu Feb 12, 2015 10:27 pm

Re: 4 pin RGB LED

Fri Feb 13, 2015 8:25 pm

davidcoton wrote:
toxibunny wrote:most likely it's a plain rgb led. the longest lead is the common. get an aaa or aa battery and a bit of wire; bend the longest led lead so that you can hold it against one end of the battery without the other 3 leads getting in the way. do so. you should also press one end of the wire against the other end of the battery. you should now have the led, battery and wire together between your thumb and forefinger. this leaves your other hand free to touch the other end of the wire to the 3 remaining led pins. if nothing lights up at all, then turn the battery around...
This may not work (LED forward voltage can be >1.5V), and worse still,may damage the LED. Use a higher voltage (at least 3V), and put a current limiting resistor between the battery and the common lead (usually the longest). The resistor should be at least 560 ohms, as per Dougie's post, but higher for higher voltage -- up to 10K for a 12V supply. The aim is to limit the current to a few milliamps.

RGB LEDS could be designed for use this way (with external current limiting), or could be designed for fixed voltage with internal current limiting. Assume the former until you know otherwise.

Are there specific pins I should hook it up to or just any of the GPIO pins? I just bought resistors and male to female wires. Will 680ohms resistors work with a 4 Pin RGB without damaging the light or the Pi?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: 4 pin RGB LED

Fri Feb 13, 2015 8:55 pm

Any GPIO is fine, as long as you know what number it is.

680 ohm resistors are also fine.

PiGraham
Posts: 3602
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: 4 pin RGB LED

Fri Feb 13, 2015 9:49 pm

scass0807 wrote:Are there specific pins I should hook it up to or just any of the GPIO pins? I just bought resistors and male to female wires. Will 680ohms resistors work with a 4 Pin RGB without damaging the light or the Pi?
For identifying the leads use the 3.3v and GND pins.

scass0807
Posts: 8
Joined: Thu Feb 12, 2015 10:27 pm

Re: 4 pin RGB LED

Sat Feb 14, 2015 1:46 am

PiGraham wrote:
scass0807 wrote:Are there specific pins I should hook it up to or just any of the GPIO pins? I just bought resistors and male to female wires. Will 680ohms resistors work with a 4 Pin RGB without damaging the light or the Pi?
For identifying the leads use the 3.3v and GND pins.
Not the regular GPIO pins?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: 4 pin RGB LED

Sat Feb 14, 2015 2:33 am

scass0807 wrote:
PiGraham wrote:
scass0807 wrote:Are there specific pins I should hook it up to or just any of the GPIO pins? I just bought resistors and male to female wires. Will 680ohms resistors work with a 4 Pin RGB without damaging the light or the Pi?
For identifying the leads use the 3.3v and GND pins.
Not the regular GPIO pins?
He means you can use it for testing. It's always on, so if you have it right your LED will light up. You can connect it to a GPIO later.

If you connect it to a GPIO now then you have make sure that GPIO is set properly.

scass0807
Posts: 8
Joined: Thu Feb 12, 2015 10:27 pm

Re: 4 pin RGB LED

Sat Feb 14, 2015 3:36 pm

ame wrote: He means you can use it for testing. It's always on, so if you have it right your LED will light up. You can connect it to a GPIO later.

If you connect it to a GPIO now then you have make sure that GPIO is set properly.
What do you mean if the
GPIO pins are set properly? Does that mean if I connect it to the GND pins or 3.3V pins it will light up automatically with no programing needed because the pins are always on?

PiGraham
Posts: 3602
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: 4 pin RGB LED

Sat Feb 14, 2015 3:46 pm

scass0807 wrote:
ame wrote: He means you can use it for testing. It's always on, so if you have it right your LED will light up. You can connect it to a GPIO later.

If you connect it to a GPIO now then you have make sure that GPIO is set properly.
What do you mean if the
GPIO pins are set properly? Does that mean if I connect it to the GND pins or 3.3V pins it will light up automatically with no programing needed because the pins are always on?
Yes, 3.3V and GND are always on. They are power pins rather than IO pins. No programming required for the test. Once you have the LED figured out then connect it to GPIO pins to control it from software.

Of course you can use a GPIO pin for the test, if you program it to be on (output and set high, or low) but that's an extra variable.

imperialex
Posts: 1
Joined: Mon Jun 18, 2018 9:52 pm

Re: 4 pin RGB LED

Mon Jun 18, 2018 9:54 pm

From Canakit website (https://www.canakit.com/triple-output-l ... 00105.html)
Wiring example states 1x180 ohms and 2x100 ohms
http://wiring.org.co/learning/basics/rgbled.html

Return to “Advanced users”