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