Pages: [1]   Go Down
Author Topic: two leg, bi-color led control.  (Read 1940 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

.
 
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Sr. Member
****
Karma: 7
Posts: 476
what?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2927
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

one more voice... It has worked many times for me...

Doc
Logged

--> 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

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Hello , thank you very much for your reply.  : )

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.

 : )





 
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
hope that made sense.
 
thanks for your help, saved me some soldering, and i can widen my traces  pheeew. : )




Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. : )
Logged

Pages: [1]   Go Up
Jump to: