LED weirdness

Talk about YBoxen, widgets, Propeller hacking, etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
middlerun
 
Posts: 8
Joined: Sun Jan 04, 2009 11:42 pm

LED weirdness

Post by middlerun »

There seems to be something wrong with my LED. It always seems to show either red, or a combination of green and blue, or all three colours. I've never seen it show only green or only blue. I wrote a little program using subsys to test the LED with different colour combinations, and here are the results:

Red ==> Red
Green ==> Green and Blue
Blue ==> Nothing
Red and Blue ==> Red, Green and Blue
Red and Green ==> Red
Green and Blue ==> Green and Blue
Red, Green and Blue ==> Red, Green and Blue

Am I doing something wrong, or have I soldered the LED in wrong, or what?

SteveBaker
 
Posts: 59
Joined: Thu Jan 01, 2009 2:08 am

Re: LED weirdness

Post by SteveBaker »

How sure are you that Red+Green gives you Red only? If you made a mistake about that then I'd say you'd accidentally connected the blue LED to the green one - and left the wire that's supposed to control blue kinda dangling somewhere. That theory fits all of the facts - EXCEPT if the Green LED doesn't come on in that one case - then that theory is wrong and I have no clue what it could be!

SteveBaker
 
Posts: 59
Joined: Thu Jan 01, 2009 2:08 am

Re: LED weirdness

Post by SteveBaker »

AHA!!!! I was right!!! There is a bug in your code AND an error in your wiring:

term.str(string("Red and Blue"))
subsys.FadeToColor(255, 255, 0, 1000) <=== That's Red+Green - not Red+Blue
waitcnt(160_000_000 + cnt)
subsys.FadeToColor(0, 0, 0, 1000)
waitcnt(160_000_000 + cnt)
term.out($00)
term.str(string("Red and Green"))
subsys.FadeToColor(255, 0, 255, 1000) <=== That's Red+Blue - not Red+Green
waitcnt(160_000_000 + cnt)
subsys.FadeToColor(0, 0, 0, 1000)
waitcnt(160_000_000 + cnt)

...when you fix that software bug - your code behaves EXACTLY as if the Blue LED is connected to the Green control wire by mistake. The Blue control does nothing - and the Green control always lights up both Green and Blue LED's - while the Red LED always does exactly the right thing.

middlerun
 
Posts: 8
Joined: Sun Jan 04, 2009 11:42 pm

Re: LED weirdness

Post by middlerun »

Ah, well spotted, cheers. :D Now I have to go through the hassle of extracting it from my Altoids tin to locate the problem.

EDIT: OK, I de-soldered the LED and tested it with a battery and it's still doing that, so I guess it's just a dodgy LED.

SteveBaker
 
Posts: 59
Joined: Thu Jan 01, 2009 2:08 am

Re: LED weirdness

Post by SteveBaker »

It would be an odd fault condition for an LED...but if you're sure you got all of the solder bridges off of it and you can see the same fault when it's not plugged into your circuit - then that's what it is.

The problem is that there are really two faults:

1) The blue LED isn't connected to the blue input pin.
2) The green and blue LED's are connected together.

If (for example) it were just the second fault - then lighting either the green or blue LED in your software would have the same effect - and they don't. If it were just the first fault then the blue LED would never come on. So it must be both things at once.

That's something that could EASILY be a pin wired up wrong on your board someplace (eg you connected the green control wire to the blue LED instead of the blue control wire) - but it's really not the kind of fault you'd find inside a tricolor LED component where there could maybe be a short or a broken internal connection...but it's very unlikely to be both.

You need to be REALLY sure before you start thinking in terms of buying another LED...those tricolor beasties can't be cheap!

middlerun
 
Posts: 8
Joined: Sun Jan 04, 2009 11:42 pm

Re: LED weirdness

Post by middlerun »

Well I used a continuity tester to make sure the pins 9, 10, 11 were connected properly to the LED legs and it was all as it should be, and after de-soldering it if I hook a power supply to the 2nd and 3rd legs (common anode and green cathode) the blue and green LEDs come on. The red one works fine and the blue one still does nothing. There's definitely no solder bridges on the LED.

So I'll go grab a new one, they're about three bucks at the place near me, so I don't really mind about the cost.

User avatar
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm

Re: LED weirdness

Post by darco »

Make sure you get a common-anode LED.

middlerun
 
Posts: 8
Joined: Sun Jan 04, 2009 11:42 pm

Re: LED weirdness

Post by middlerun »

These little buggers are hard to find - I went all over Sydney trying to find one... finally I've found a couple on eBay that weren't in some huge lot of 50 or something.

UPDATE: Got 2 new ones, soldered one in. Works perfectly.
Last edited by middlerun on Mon Jan 19, 2009 8:24 pm, edited 1 time in total.

User avatar
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm

Re: LED weirdness

Post by darco »

Yes, they are. Finding a source of decently-priced common-cathode frosted RGB LEDs turned out to be very difficult for us making the kits. Finding a source of decently priced common-anode frosted RGB LEDs turned out to be a tad easier, but still difficult. (This is why the LED is common-anode, and not common-cathode)

But damn it looks cool. ^_^

Locked
Please be positive and constructive with your questions and comments.

Return to “YBox2 (discontinued)”