Go Down

### Topic: two leg, bi-color led control. (Read 4537 times)previous topic - next topic

#### qwerky

##### May 17, 2012, 12:44 pm
hi there.

I have made a circuit so that I can control a tactile switch which has a bi-color led inside it ( the red/green led has two legs only)

I am trying to keep the footprint small and therefore wonder if having only transistors reduce power to the led is adequate or would I need to add a current limiting resistor for each led also?

here is the circuit, does this look o.k?

thanks for help.

.

#### johnwasser

#1
##### May 17, 2012, 02:01 pm
Are 'arduino 1' and 'arduino 2' just two pins on the same Arduino?

Is the "-5V" really MINUS five volts?  If so, why?

Why not just connect the LED directly to two data pins:
Pin2 ----- Resistor----- LED----Pin3

Then you will get one color with Pin2 HIGH and Pin3 LOW and the other color with Pin2 LOW and Pin3 HIGH.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### Grumpy_Mike

#2
##### May 17, 2012, 05:45 pm
Quote
if having only transistors reduce power to the led is adequate

No because it is not reducing the current in the LED.
See:-
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

Anyway go with what johnwasser said.

#### P18F4550

#3
##### May 18, 2012, 02:44 am
Quote
Why not just connect the LED directly to two data pins:
Pin2 ----- Resistor----- LED----Pin3

Then you will get one color with Pin2 HIGH and Pin3 LOW and the other color with Pin2 LOW and Pin3 HIGH.

I'd go with that

#### Docedison

#4
##### May 18, 2012, 04:27 am
one more voice... It has worked many times for me...

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

#### qwerky

#5
##### May 18, 2012, 01:26 pm

Are 'arduino 1' and 'arduino 2' just two pins on the same Arduino?

Is the "-5V" really MINUS five volts?  If so, why?

Why not just connect the LED directly to two data pins:
Pin2 ----- Resistor----- LED----Pin3

Then you will get one color with Pin2 HIGH and Pin3 LOW and the other color with Pin2 LOW and Pin3 HIGH.

I would really like to use only two pins for this. wow, the footprint would be so much smaller.

My mega ardunio will be powered via a 12v regulator and there is a "+5v" reg available also. However I need to power:

12 bi colour leds tactile switches, (only 6 will be on at a time of course)
15 single colour leds. ( < these could be powered via transistors instead)
I have 2 shift registers running a dual segment display. ( from only 3 pins of course)

I was fearing that I may overheat the arduino? i presume the above would be approx 500 ma. So I thought to use transistors here to keep the arduino cool.

do you think I would be o.k with the above ? maybe i should just use transistors on the single leds instead? that would certainly help.

: )

#### johnwasser

#6
##### May 18, 2012, 03:33 pm
Do you need to individually control 6 bi-color LEDs?  If you don't have 12 pins to spare you could always use more shift registers.

Did you want to control all 6 bi-color LEDs together with two pins?  I think that can be done with two transistors each:

+5 ----- Resistor ---(a)--- LED ---(b)--- Resistor ----- +5

Use NPN transistors to ground point (a) for one color and point (b) for the other color.  The transistors should be able to share a common data pin but may need separate base resistors.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### qwerky

#7
##### May 18, 2012, 04:20 pm
hi: )

yes i need to individually control all leds. i have just rewired my circuit so that all the bi-color leds use just 2 pins and a current limiting resistor. and all the other individual leds now have a transistor and limiting resistor each so to keep the arduino cooler.

i was really keen to use more shift registers.

i use max/msp to trigger all these leds, I use serial and standard firmata. thats the limit of my arduino knowledge. so i had to figure a way to control the seven segment displays from max msp
and still have acces to all the remaining ins and outs.

i ended up creating a sequencer in max that would fire out 1's and 0's in the correct order/time to control the shift register.  very inefficeint .but it works.

i know there are arduinio sketchs that do this far far better , but there are no sketches that i could find that would allow the use of multiple shift registers and also allow max to have access to the rest of the ins and outs on the arduino all at the same time. so i had to compromise.

thanks for your help, saved me some soldering, and i can widen my traces  pheeew. : )

#### qwerky

#8
##### May 18, 2012, 04:25 pm
i'll post up the max patches I made in the appropriate sub -forum on here when i get chance, it may interest other max users. : )

Go Up