Pages: 1 [2] 3   Go Down
Author Topic: Interactive Traffic light - button doesn't work  (Read 3619 times)
0 Members and 1 Guest are viewing this topic.
Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Belgium
Offline Offline
Full Member
***
Karma: 2
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 I will try this now.

Here is the setup:

Logged

Belgium
Offline Offline
Full Member
***
Karma: 2
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* breadboard_connection.jpg (118.86 KB, 1024x768 - viewed 10 times.)
Logged

Belgium
Offline Offline
Full Member
***
Karma: 2
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That solved the problem!!
Thank you very much!!! smiley-lol
Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your welcome...
Logged

Belgium
Offline Offline
Full Member
***
Karma: 2
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a little video of it smiley
Logged

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2513
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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 )
Logged

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2513
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know it look comfusing...  smiley-confuse  I do drive for a living...
Quote
The Yellow after Red == "get ready to go, but, beware ?
   Must be it...  smiley-grin   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.
Logged

Belgium
Offline Offline
Full Member
***
Karma: 2
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

« Last Edit: February 28, 2012, 01:49:15 pm by TiboJ » Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

That, I don't know...  smiley-confuse

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

Belgium
Offline Offline
Full Member
***
Karma: 2
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok no problem smiley-wink

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?
« Last Edit: February 28, 2012, 02:12:29 pm by TiboJ » Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

 


* ledconnection.jpg (117.93 KB, 1024x1049 - viewed 9 times.)
Logged

Pages: 1 [2] 3   Go Up
Jump to: