[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
Brads Electronic Projects Forum • What leds do you use on your pov projects - Page 2
Page 2 of 2

Re: What leds do you use on your pov projects

Posted: Thu Nov 25, 2010 10:00 pm
by bitfogav
Not sure if your ones are diffused though Brad? :)

Here are some Diffused RGB 5mm Leds (50pcs) that are still quite cheap.
http://cgi.ebay.co.uk/50-Pcs-5mm-tri-co ... 19b6ba14cc
led5mmrgb.jpg
led5mmrgb.jpg (14.65 KiB) Viewed 16128 times

Re: What leds do you use on your pov projects

Posted: Sat Nov 27, 2010 7:17 pm
by brad
Yes you're right!

The diffused ones are the ones you really want to go for :)

Re: What leds do you use on your pov projects

Posted: Tue Nov 30, 2010 12:55 pm
by waywardson07
thanks alot for the info brad :]] i think im going to get some of those.....

in the meantime i bought one of the ones from radioshack just to play around with and i found out that this full color led has a common anode instead of cathode like i was hoping. well i was wondering how would i go about setting this led with a common anode to cycle through the rgb colors? i could figure a way to do it if it had a common cathode but im a little stumped with the common anode

Re: What leds do you use on your pov projects

Posted: Tue Nov 30, 2010 8:49 pm
by brad
If you just wanted to test it out without using a microcontroller or any other hardware, then just connect the common anode straight to your power supply (most commonly 5volts if you are working with microcontroller circuits)

Then you will need three resistors. One for each cathode.

Connect each cathode to ground and you will light up that corresponding color. you can also mix the colors by lighting up more than one at a time.

If you are connecting it to a microcontroller then again just connect the common anode to your power rail (VCC) and then the other three connections (through your resistors) to three port pins of the microcontroller. The easiest way to work with it now is to just pretend they are common cathodes but before you send the data out to the LED pins, you just need to invert the data.

so if you wanted to cycle through the colors and you connect the LED to PORTA pins 0, 1 and 2 and you're programming in basic, you would do this:

Code: Select all

while true
inc(leds)
leds = leds xor 255 ; this inverts the data in leds and stores it back in leds
porta = leds
leds = leds xor 255 ; invert back to original
delayms(500)
wend
If you ever are dealing with common anode (rather than common cathode) then you just need to invert the data before sending it to your port. Remember we are only dealing with the first three port pins of porta so if we started at 000 and sent that data to a common anode RGB LED, it would actually light them all up, so before we send the data out, we invert it using the xor instruction.

we xor our 8-bit variable with 255 (which is binary 11111111)

if we had the number 00000101 (which means that we wanted the first and third color to be lit) then putting it through the xor instruction we get:

Code: Select all

      00000101
xor 11111111
=    11111010
Hopefully that helps!

Re: What leds do you use on your pov projects

Posted: Sat Mar 26, 2011 9:54 am
by 22hertz
To diffuse LEDs I have used fine wet/dry sandpaper...600+ grit
A very light sanding works well.

Re: What leds do you use on your pov projects

Posted: Sat Mar 26, 2011 10:00 pm
by brad
22hertz wrote:To diffuse LEDs I have used fine wet/dry sandpaper...600+ grit
A very light sanding works well.
Thanks for the tip!

clear LED's are often quite a bit cheaper than diffused, so it would be a good way to save money.