Go Down

### Topic: LED problem (Read 3208 times)previous topic - next topic

#### pranoy

##### Jan 19, 2013, 03:18 pm
Hi guys,
I am doing a project with LEDs on traffic light
I have connected the RED and GREEN leds in reverse polarity and took the input to these pins to an AND gate and connected the output to YELLOW led.

when i am running the pgm i use the following logic

01 for RED
10 for GREEN
11 for YELLOW

but in my circuit my yellow light is ON with a minimum brightness even when the other LEDs are ON
what is the problem??

pls help guys

I used 7408 as my AND gate

#### JimboZA

#1
##### Jan 19, 2013, 03:22 pm
They say a picture is worth a thousand words.... I don't follow the circuit description- a diagram would make it muuuuuch easier.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### pranoy

#2
##### Jan 19, 2013, 03:26 pm

i will get the ckt in a bit

#### pranoy

#3
##### Jan 19, 2013, 03:50 pm

this is a rough sketch

#### pranoy

#4
##### Jan 19, 2013, 03:52 pm
this is a rough sketch

#### pranoy

#5
##### Jan 19, 2013, 04:11 pm
pls guys someone reply pls pls

#### suicidalacorn

#6
##### Jan 19, 2013, 04:20 pm
ok, i am no expert when it comes to this stuff, so take what i say with a grain of salt. but if i had to guess, the ground from one of your LEDs is activating your AND gate. take a look at the diagram i attached. that is my guess what is happening. but again, i could be completely wrong. im just letting you know what my guess is when it comes to this problem.

#### JimboZA

#7
##### Jan 19, 2013, 04:25 pm
My take is slightly different from that of suicidalacorn's... I think that with either 01 or 10 and therefore activating the R xor G LEDs, there's enough of a "short" across the AND gate for it to read both its inputs as 1's.

(Which is what suicidalacorn was saying, on second thoughts, now that I see his annotated pic....)

Do some measuring with your meter...
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### pranoy

#8
##### Jan 19, 2013, 04:28 pm

but can you give me a suggestion to stop this??

#### JimboZA

#9
##### Jan 19, 2013, 04:33 pm

but can you give me a suggestion to stop this??

Lose the 74' and do the whole thing in software....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### pranoy

#10
##### Jan 19, 2013, 04:37 pm
how do u suggest i do it in software?

i dont have enough pins

#### Grumpy_Mike

#11
##### Jan 19, 2013, 08:30 pm

this is a rough sketch

So now do a proper one, showing each LED and the series resistor connected to each LED along with values.
In other words a schematic that people can understand.

#### LockDots

#12
##### Jan 20, 2013, 04:31 am
What are you trying to achieve? You mentioned a traffic light. Do you mean that you only want one of the LED's on at a time or do you want the Yellow to light up when the Red AND Green are on?

You may want to use inverters as well if you want only one on at a time.

#### JimboZA

#13
##### Jan 20, 2013, 04:39 am

how do u suggest i do it in software?

i dont have enough pins

Well so far you mentioned only the 3 LEDs, so that would need 3 i/o pins instead of the 2 you have used so far- how many LEDs do you need then?

(Btw a question is not going to get answered any faster with than just with ?)
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)

#### arduinohabib

#14
##### Jan 20, 2013, 04:58 am
I remmember once trying to dirrectly drive a seven segment display with my Arduino and the segments were really dim I checked and found that I forgot to put
Code: [Select]
`pinMode(segment, OUTPUT);`
!
What is man's best friend? The breadboard!

Go Up

Please enter a valid email to subscribe