Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Traffic light !!!

Status
Not open for further replies.

yak103

New Member
Hi all ...
actually I am planning to build a 4 way traffic light circuit that works in sequence for example:
north/south (Red(off)-yellow(off)-Green(on)) <<main street>>
east/west (Red(on)-yellow(off)-Green(off)) <<cross street>>

I know that I can use IC4017 (the decade counter) and NE555 timer ... but i would change my design using another microcontoller that has timming as well instead of using both 4017 and 555 !!!
you know why ???
because I am planning to use an RF module to my system to control the traffic light sequnce ...
so my question is:
what type of PIC can I use ??
can I connect the outputs of the RF receiver directly to the PIC???
can I program the PIC to recognise that I wanna change the sequence of the lights ?? for example the Green on in the cross street and I am using my remote control to change the sequnce making the manin street's Green ON and Red ON in the cross street ?? can i do that ?? how ???

any other ideas ..

thanks
 
You can do everything you want using a PIC, it's just a question of programming it!. Something as small as a 16F628 should have enough I/O pins, or you could move up to a 16F876 or 16F877.

My tutorials have some of the routines you need, such as IR and RF remote control.
 
actually this time I wanna use 16F84 but the question is:
can i take the outupts directly from the receiver to become inuts for my PIC and how is the circuit gonna be look like if I use a ready RF modules ??
thanks
 
yak103 said:
actually this time I wanna use 16F84 but the question is:
can i take the outupts directly from the receiver to become inuts for my PIC and how is the circuit gonna be look like if I use a ready RF modules ??
thanks

Again, check my tutorials for details of interfacing the modules I used.
 
I copied and modified a traffic light programme from the book "PIC Your Personal Introductory Course" second edition by John Morton.

It is not exactly what you want, but it could be easily modified to meet your requirements.

See the preamble to the code for more detail.
 

Attachments

  • traflite.txt
    4.4 KB · Views: 1,178
Last edited:
i want to make sequential lights in which each set of 4 led's (total 4-5 sets) will glow after 3-4 seconds of Ist set, pl help
 
untested:
Here is the most basic Traffic Lights Pic Circuit. (depends on which pic you use, you may have to add a reset switch,or, bla bla bla, for the pic to turn on/function).

Yes, the rf module's output can be connected directly into the pic, as shown.
 

Attachments

  • Trafficlights_15711.gif
    Trafficlights_15711.gif
    7.2 KB · Views: 1,434
yak103 said:
thank you Len ... do you have any idea about the circuit that I may use ??
thanks
The circuit posted by Screech would suffice. I don't know why it has an RF receiver. You would not need that part. Also, if you want to add pedestrian lights they would be extra. Note that the PIC can drive one LED directly from each i/o but if you want 2 or more in parallel, then drive them with a transistor as per Screech's circuit.

You will need a 4 MHz crystal and 2 capacitors. I expect Nigel's tutorials will show details.

For the pedestrian push button, connect +5 Volt to the button and the other contact goes to the PIC i/o pin with a 4k7 resistor to gnd.
 
ljcox said:
You will need a 4 MHz crystal and 2 capacitors. I expect Nigel's tutorials will show details.

Only if you want to use a pic that does't have an internal Crystal.


I use the PIC12F683 pic.
It already has an INTERNAL 4 MHz Crystal and 2 caps.
It's an 8 pin pic. It supports 5 Input/Outputs including 3 analogue inputs.


P.S.
(pin/leg 2 of this pic must be tide to ground for it to operate. No other mods are requided to the circuit to operate.)
 
yak103 said:
thank you Len ... do you have any idea about the circuit that I may use ??
thanks
Don't neglect to connect a 100 nF bypass capacitor across the Vdd and Vss pins.
 
Last edited:
The diagram posted has all the yellow light on at the same time? I have never seen RED then YELLOW then GREEN.

I have a picbasic program that runs the ones my kids have you are welcome to the code. Not sure if I have the schematic. But simple and it runs on the 16F84 as I made it may years ago (10 years ago).
 
Screech said:
untested:
Here is the most basic Traffic Lights Pic Circuit. (depends on which pic you use, you may have to add a reset switch,or, bla bla bla, for the pic to turn on/function).

Yes, the rf module's output can be connected directly into the pic, as shown.
What programme did you write to use with this circuit?
 
Richard-d,

This post is almost 1 year old/dead.

The circuit will not work right as all the YELLOW leds are tired together, so as you tell the GREEN light people it is YELLOW time and to get ready for RED, the RED light people will see the YELLOW as well. Do not use that curcuit.

So add an I/O pin and move two of the YELLOW LEDs to it and then you can write the code to make it work.

EDIT: Also, when you kill the GREEN light to turn on the YELLOW, the RED light goes out for the other side and might take off. :) Also, I make these comment based on the way the lights work in the US. Maybe they are different elsewhere.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top