Recently I got few 10mm RGB LEDs. The strange thing is: the longer pin is positive? This is what is says on eBay:
10mm Ultra-Bright RGB LED 7000-9000 mcd
Emitted Colour : Red / Green / Blue
4 PINs with Common Anode
Pins sequence: RED/Common Anode(positive terminal)/Green/Blue
Size: 10mm
Lens Color : Water Clear
Forward Voltage (V) : 2.5~3.2
View Angle: About 40 degree.
Luminous Intensity: 7000/8000/9000mcd
My question is, what is the proper way to have all three color working to connect to arduino or other controller? So far I only know they usually have longer ping in Ground negative, but for this one, I never seen.
Thanks for anyone who could help!!
I have used the same…
I ran into this as well and was a bit surprised when I found it was a common positive. Really, nothing will change here. The common positive goes to positive and the other 3 legs goto your arduino’s PWM pins via a current limit resistor. For testing, just put a 330 resistor on each of the 3 pins and call it good. Run your PWM out (analogWrite) like you normally would, its just going to be backward now --Let me explain:
If your analogWrite was set to say, 75%. The pin is going to be high 75% of the time and low 25% of the time. Because you have a common positive, the any of the 3 colors will be “ON” when it’s pin gets a LOW signal. Now look at the PWM example above – 75% of the time, you have a HIGH/HIGH and thus that color is OFF 75% of time. 25% of the time you will have a LOW/HIGH situation and it will be ON. This results in a PWM duty of 75% but your LED will be at 25% power.
The bottom line: Your PWM is going to be backward. 0 = All the way on 255 = All the way off
"Again, Chris the Carpenter
"Again, Chris the Carpenter has saved the day! Thanks to the Chris the Carpenter!!" LOL~
Yeah, this is funny! It works that way. I was kinda confused that sometimes 2 lights were on and the one suppose to be on was off when I use digital HIGH/LOW method. Anyway, everything is clear now. Thank you so much for detail info.
BTW, I am always confused about this as well. I can use analogWrite on both analog and digital pin. Then what’s the major difference between digital and analog pins?
It has to do with the internal timer
It has to do with internal timers and how they are used for different things. I wouldn’t worry about the specifics --if it works, use it.
I missunderstood
I assumed that when you said “analog pin” you were talking about a pin labled “pwm”. I should say that I really don’t like the fact that Arduino decided to use a phrase like “analogWrite” --It is wrong in concept and confusing when used. It is really just a PWM out. Arrgg…
In terms of analog pins --go with what OddBot said.
Yep! Got it. Thanks to both
Yep! Got it. Thanks to both of you guys. Now I am a little step forward in this field.