Go Down

Topic: Interactive Traffic light - button doesn't work (Read 4 times) previous topic - next topic

Techone

So, you did run my test code to check the leds ?

If one led - pin 9 not working, did you try to exchange with a led - pin that work . example :  pin 12 led with pin 9 led. re-run the code. If pin 9 is still not working... well in that case, the ATMega328P chip maybe partially damage...

TiboJ


TiboJ

Just tested it, and it still not works...

Techone

1. Thank you for a picture of your setup. Much better.

2. If you did my code and pin 9 is still not working... Hum...

3. I did look at the breadboard you have... I notice a big space. The gnd connection of the led connected to pin 9, is in my opinion is "open" The negative / gnd rail is not connected completely.

I mean the "power" rail is cut in half.

Look at my picture here... see the red wire connected to the "blue" power rail ?   In some breadboard, the rails are not connected completely. Just place a jumper wire like my picture and re-run my test code and see what happen... I hope my instint is right.

TiboJ

That solved the problem!!
Thank you very much!!! XD

Techone


TiboJ


Runaway Pancake

Why does it go back to Yellow after Red?
Shouldn't it be Green, Yellow, Red, Green,...
Is the Pedestrian signal for the cross street?
Here, the Pedestrian signal goes Walk, flashing DontWalk, DontWalk.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Techone

@runaway_pancake

The author of the book "Begining Arduino" by Micheal McRoberts is from the UK. Their traffic light system is different than Noth American system. ( Assuming the traffic light system in New-York City is the same in Toronto )

Runaway Pancake

How is one to "interpret" the G-Y-R-Y-G...?
The Yellow after Red == "get ready to go, but, beware ?
Apparently the plan is to make mandatory this flashing-yellow arrow arrangement for left turns - in a four-section signal there'll be two yellow arrow indications, one will flash and the other won't. 
Red-Green Arrow, flashing yellow arrow (== Green through), solid yellow arrow, Red.
? ? ? ?
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Techone

I know it look comfusing...  :~  I do drive for a living...
Quote
The Yellow after Red == "get ready to go, but, beware ?
Must be it...  :D   In Toronto is :  G - Y - R - G - Y - R -------  standard traffic light.  Simple

Quote
Apparently the plan is to make mandatory this flashing-yellow arrow arrangement for left turns - in a four-section signal there'll be two yellow arrow indications, one will flash and the other won't. 


You may be right.  The traffic light is a UK system.

TiboJ

#26
Feb 28, 2012, 07:42 pm Last Edit: Feb 28, 2012, 07:49 pm by TiboJ Reason: 1

Well, can you show us : Schematic, circuit setup and code.

My test code is simple. It is just a Blink, but using multiple leds. 150 ohms is a bit high. Use 330 ohms or 470 ohms. Check the led polarity : cathode and anode. Check where the ground wire is, and the digital output pins are wired. My code is design to check the leds and connections... Checking the hardware basicaly.


Is 150 ohms to low?
I calculated it with the formula: (Vsupply-Vled) / Iled, so (5v-2v) / 0.020A = 3v / 0.020A = 150ohms.

btw: How can I type an indice, for exemple if I want to type R2, and make the 2 go right under the R. Like in this picture:


Techone

[quotebtw: How can I type an indice,][/quote]

That, I don't know...  :~

Quote
Is 150 ohms to low?
I calculated it with the formula: (Vsupply-Vled) / Iled, so (5v-2v) / 0.020A = 3v / 0.020A = 150ohms.


It is not 150 ohms is too low, it the 20 mA is the problem. It is 50 % lower than the max rated of the Arduino chip 40 mA.  I am not confortable with it...  I always use 470 ohms.   

5 - 2 / 470 = 6.383 mA is much safer than 20 mA..... in my opinion. That current value, I am comfortable with it.

TiboJ

#28
Feb 28, 2012, 08:10 pm Last Edit: Feb 28, 2012, 08:12 pm by TiboJ Reason: 1
Ok no problem ;)

I'm trying to calculate the resistor for my bright leds, but I don't know the max current and voltage of it.

Do you know what the max current and voltage is for a normal bright led?

Techone

It depend. Check the datasheet of the led. Some type are 10 mA, 20 mA, 2 Vled, 3 Vled, 1.8 Vled....If you REALLY want to go for MAX value of an led, pass 20 mA, well use a transistor to control the led. With a base resistor of 1 K to 4.7 K, that will be safer for the Arduino digital pin and the transistor will switch the led with at higher current. If something goes wrong, the transistor will be "bye--bye" not your Arduino.

Here a picture.


Go Up