Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« on: December 14, 2012, 07:43:07 am » |
guys need ur help
I am doing a project based on LED I have 2 pins left. I need to control 3 LEDs.
The idea i have is to connect 2 LEDs parallel with opposite polarity to these pins and also from these pins take inputs of an AND gate and connect the 3rd LED across the AND gate output and ground.
THIS IS HOW I THINK THE ABOVE IDEA WILL WORK:::: for the first 2 LEDs output 01 or 10 to the pins and if i give 11 as output the 3rd will light up
WILL THIS IDEA WORK???????
IF NOT CAN U HELP ME WITH UR IDEA?????
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #1 on: December 14, 2012, 07:58:12 am » |
That will work
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #2 on: December 14, 2012, 08:00:58 am » |
thanks but where will i connect the resistor??
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #3 on: December 14, 2012, 08:17:53 am » |
you can do this ----|<|-------- (pin) ---x---| |---www--x--(pin) | -----|>|------- | | | | | (AND) (AND)
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #4 on: December 14, 2012, 08:26:04 am » |
K
So what resistance shoul i use?
Shd i connect a resistor for the 3rd LED from and gate o/p ???
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #5 on: December 14, 2012, 08:33:28 am » |
220 - 330 ohms should be enough, and yes you should have a resistor (330 Ohms) for the 3rd LED. Assuming these are standard LEDs, that should be enough resistance.
Do you know what the LEDs drop voltages and the current rating (mA) are? I can give you a better answer with that information.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Malaysia
Offline
Sr. Member
Karma: 7
Posts: 385
|
 |
« Reply #6 on: December 14, 2012, 08:41:48 am » |
you know what, you remind me of multiplexing. i love that topic and you know that using charliplexing could also help.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #7 on: December 14, 2012, 08:43:20 am » |
I dont know about its rating .
Its ordinary 3MM LEDs
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #8 on: December 14, 2012, 08:46:29 am » |
@ ash
I have read about charlie plexing. But it will not work here. Just charlieplexing with 2 pins will work.
I am planning to control traffic light with 3 LEDs(red,green,Yellow). ON each side of a four way junction.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #9 on: December 14, 2012, 08:49:11 am » |
Ok here is what I found. There are three main categories of miniature single die LEDs: Low-current — typically rated for 2 mA at around 2 V (approximately 4 mW consumption). Standard — 20 mA LEDs at around 2 V (approximately 40 mW) for red, orange, yellow, and green, and 20 mA at 4–5 V (approximately 100 mW) for blue, violet, and white. Ultra-high-output — 20 mA at approximately 2 V or 4–5 V, designed for viewing in direct sunlight. Five- and twelve-volt LEDs are ordinary miniature LEDs that incorporate a suitable series resistor for direct connection to a 5 V or 12 V supply.
So using this and an LED calculator, the resistance should be about 100-150 ohms, @ 5 volts. Those resistor values should work fine. the 3rd led you can bring down a little, depending on how bright you want it.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Malaysia
Offline
Sr. Member
Karma: 7
Posts: 385
|
 |
« Reply #10 on: December 14, 2012, 08:56:27 am » |
yes, 2 pin only could drive 2 led with charliplexing. Anyway you could control 4 led with 2 pin with multiplexing, A B LED1 LED2 LED3 LED4 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 0
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #11 on: December 14, 2012, 08:59:27 am » |
@ash901226 That is a good suggestion, and he could probably free up some other pins too.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #12 on: December 14, 2012, 09:03:11 am » |
@ash
How shd i connect the 4 LEDs across the pins???
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #13 on: December 14, 2012, 09:06:00 am » |
With a multiplexer. The two MUX input pins are connected to the two available on the arduino. supply the voltage to the MUX and connect the LEDs with resistors to gnd.
2 pins => 4 leds
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #14 on: December 14, 2012, 09:10:10 am » |
ARE u telling about a DEMUX???
|
|
|
|
|
Logged
|
|
|
|
|
|