Author Topic: Traffic light circuit  (Read 3766 times)

0 Members and 1 Guest are viewing this topic.

Offline rthorntn

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: au
Traffic light circuit
« on: June 10, 2018, 05:04:25 am »
Hi All,

I'm working with my 7yo daughter to build a traffic light circuit without an MCU, we have this:

https://www.jaycar.com.au/led-traffic-light-module-for-arduino/p/XC3720

Perfectly happy for it to just alternate between red, amber and green roughly every second.

We have a limited amount of components to use (we have lots of capacitors and resistors).

- 1x555
- 3xNPN
- 3xPNP
- 1xSCR
- 1xRelay (Coil, Coil, NC, NO, COM)

UPDATE: I just had a thought, I also have rLogic boards that I'm trying to work out what to use for (essentially 10 x Fairchild NC7SV57 and 10 x NC7SV58 on wee BOB's):

https://www.eevblog.com/forum/beginners/playing-with-logic/

Is it possible, if so, could you please provide a circuit and/or some pointers?

We could buy more of the bits above if required but would like to do it with what we have, we have a system called "Snap Circuits" and most if its flexibility comes from the empty two/three spring and eight pin DIP socket but 8-pins is the most we can easily integrate (so the circuits out there with 16-pin 4017's are no good).

Thanks for looking.

Richard
« Last Edit: June 10, 2018, 07:01:40 am by rthorntn »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4451
  • Country: au
  • Question Everything... Except This Statement
Re: Traffic light circuit
« Reply #1 on: June 10, 2018, 05:47:12 am »
It will require a few more of the 555 modules, but yes you can do it,

This exact circuit is called a pulse sequencer, The left most is the clock that keeps it going, then the other 3 are each light.

http://www.falstad.com/circuit/circuitjs.html?cct=$+3+0.005+1.700203994009402+50+5+50%0A165+160+208+168+208+1+5%0Aw+160+224+152+224+0%0Aw+152+224+152+272+0%0Aw+152+272+160+272+0%0Ac+152+272+152+336+0+0.00009999999999999999+0.5156293756910884%0Aw+152+224+152+192+0%0Ar+152+192+152+136+0+10000%0Ar+112+192+112+136+0+10000%0Aw+112+192+112+256+0%0Aw+112+256+160+256+0%0Aw+112+136+152+136+0%0Aw+152+136+192+136+0%0Aw+192+136+192+192+0%0AR+-56+136+-120+136+0+0+40+5+0+0+0.5%0Ag+152+336+152+352+0%0Aw+224+240+224+256+0%0Ac+224+256+272+256+0+0.00001+-0.0829260490866135%0Aw+272+256+272+192+0%0Ar+272+136+272+192+0+10000%0Ar+312+136+312+192+0+10000%0Aw+192+136+272+136+0%0Aw+272+136+312+136+0%0A165+320+208+352+208+1+5%0Aw+352+192+352+136+0%0Aw+352+136+312+136+0%0Aw+312+224+320+224+0%0Aw+312+192+312+224+0%0Aw+312+224+312+272+0%0Aw+312+272+320+272+0%0Aw+272+256+320+256+0%0Ac+312+272+312+336+0+0.00009999999999999999+0.5156293756910884%0Ag+312+336+312+352+0%0Aw+384+240+384+256+0%0Ac+384+256+432+256+0+0.00001+-0.0829260490866135%0Aw+432+256+432+192+0%0Ar+432+192+432+136+0+10000%0Ar+472+136+472+192+0+10000%0Aw+352+136+432+136+0%0Aw+432+136+472+136+0%0A165+480+208+488+208+1+5%0Aw+472+192+472+224+0%0Aw+472+224+480+224+0%0Aw+472+224+472+272+0%0Aw+472+272+480+272+0%0Aw+512+192+512+136+0%0Aw+512+136+472+136+0%0Aw+432+256+480+256+0%0Ac+472+272+472+336+0+0.00009999999999999999+0.5156293756910884%0Ag+472+336+472+352+0%0AM+224+256+224+328+0+2.5%0AM+384+256+384+328+0+2.5%0AM+544+240+584+240+0+2.5%0A165+-8+208+8+208+3+5%0Aw+24+136+112+136+0%0Aw+24+168+24+136+0%0Aw+-8+272+-24+272+0%0Aw+-24+272+-24+256+0%0Aw+-24+256+-8+256+0%0Ar+-56+224+-56+272+0+1000%0Aw+-56+224+-8+224+0%0Aw+-56+272+-24+272+0%0Ar+-56+224+-56+136+0+47000%0Aw+24+168+24+192+0%0Ac+-56+272+-56+328+0+0.00009999999999999999+0.11171474663694816%0Ag+-56+328+-56+344+0%0AR+56+224+64+224+0+0+40+5+0+0+0.5%0Ac+112+256+56+256+0+0.00001+0.08357540475660663%0Aw+56+240+56+256+0%0Aw+-56+136+24+136+0%0Ao+49+4+0+4102+5.1+0.000048828125+0+1%0Ao+50+4+0+4102+5.1+0.00009765625+0+1%0Ao+51+4+0+4102+5.1+0.00009765625+0+1%0A
 
The following users thanked this post: rthorntn

Offline FlyingHacker

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: us
  • You're Doing it Wrong
Re: Traffic light circuit
« Reply #2 on: June 10, 2018, 06:10:25 am »
Something like this one works well, too. Only one 555, but a CD4017 decade counter to boot.

--73
 
The following users thanked this post: rthorntn

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4451
  • Country: au
  • Question Everything... Except This Statement
Re: Traffic light circuit
« Reply #3 on: June 10, 2018, 06:46:58 am »
Flying, you missed where he said he didn't want to go to any large dip chips, specifically saying against the 4017
 
The following users thanked this post: rthorntn

Offline FlyingHacker

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: us
  • You're Doing it Wrong
Re: Traffic light circuit
« Reply #4 on: June 10, 2018, 07:03:04 am »
Flying, you missed where he said he didn't want to go to any large dip chips, specifically saying against the 4017

Haha. So I did! Sorry...

Given the cost of 555s your circuit is almost the same price.

Interesting so whatever this Snap Circuits is does not support the 16 pin DIPs?
--73
 
The following users thanked this post: rthorntn

Offline rthorntn

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: au
Re: Traffic light circuit
« Reply #5 on: June 10, 2018, 07:36:24 am »
Thanks all!

http://elenco.shptron.com/p/eight-pin-ic-socket-u8

Is there a smaller DIP-8 or less version of the CD4017 decade counter that will do what I need?
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4451
  • Country: au
  • Question Everything... Except This Statement
Re: Traffic light circuit
« Reply #6 on: June 10, 2018, 08:09:40 am »
With the Dip8 sockets, you can now use dual op amps, which simplifies things,

You would use 2 of these guys https://www.jaycar.com.au/dual-quad-cmos-op-amps/p/ZL3482 (rail to rail op amps), just to keep things simple (The old 741 op amp has a number of gotcha's for beginners)

http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.000005+10.20027730826997+50+5+43%0Aa+224+64+304+64+1+5+0+1000000+0.7100065913928562+5%0Aa+224+160+304+160+1+5+0+1000000+0.7100065913928562+3.3333333333333335%0Aa+224+256+304+256+1+5+0+1000000+0.7100065913928562+1.6666666666666667%0Aa+272+464+352+464+1+5+0+1000000+0.7100065913928562+4.904249441620213%0Aw+224+240+176+240+0%0Aw+224+144+176+144+0%0Aw+224+48+176+48+0%0Ar+176+240+176+144+0+1000%0Ar+176+48+176+144+0+1000%0Ar+176+240+176+352+0+1000%0Ag+176+352+176+368+0%0AR+176+48+176+32+0+0+40+5+0+0+0.5%0Aw+224+272+208+272+0%0Aw+208+272+208+176+0%0Aw+208+176+224+176+0%0Aw+208+176+208+80+0%0Aw+208+80+224+80+0%0A162+400+64+400+160+1+2.1024259+1+0+0+0.01%0A162+400+160+400+256+1+2.1024259+1+0+0+0.01%0A162+400+288+400+384+1+2.1024259+1+0+0+0.01%0Ar+400+256+304+256+0+1000%0Ar+400+160+304+160+0+1000%0Ar+400+64+304+64+0+1000%0Ag+400+384+400+400+0%0Ar+304+288+400+288+0+1000%0Aw+304+288+304+256+0%0Ac+208+528+208+592+0+0.00001+0.7100065913928562%0Ag+208+592+208+608+0%0Aw+272+528+208+528+0%0Aw+352+464+352+528+0%0Ar+352+528+272+528+0+1000%0Aw+272+528+272+480+0%0Ar+352+464+352+416+0+1000%0Aw+272+416+272+448+0%0Aw+352+416+272+416+0%0Aw+208+528+208+272+0%0AR+240+384+240+368+0+0+40+5+0+0+0.5%0A174+240+384+272+432+0+100000+0.5+Resistance%0Ag+240+448+240+464+0%0A
 
The following users thanked this post: rthorntn

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13419
  • Country: gb
  • 0999
Re: Traffic light circuit
« Reply #7 on: June 10, 2018, 10:40:14 am »
Why do you want to avoid DIL14 packages?

Which is easier? One DIL14 package or several DIL8 packages?

The simplest implementation I know of is a ring oscillator, with the LEDs connected across its outputs. It can be done with the 74HC04, which contains six NOT gates, but only three are required, so the spare gates can be used as buffers. Three NOT gate packages are available, such as the 74HC3G04, but they're surface mount.
http://tinyurl.com/yb6ul4fs

By the way, does anyone know how to get that falstad simulator to output plain line drawings (no pretty dots) showing the LEDs with proper symbols? I had so mess around with editing the screenshot!
« Last Edit: June 10, 2018, 10:42:50 am by Hero999 »
 
The following users thanked this post: rthorntn

Offline Benta

  • Super Contributor
  • ***
  • Posts: 2179
  • Country: de
Re: Traffic light circuit
« Reply #8 on: June 10, 2018, 04:35:00 pm »
Don't know about Australia, but in Europe the traffic light sequencing is a bit more involved:

Green -> Amber -> Red -> Red/Amber -> Green

 
The following users thanked this post: rthorntn

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 3311
  • Country: de
Re: Traffic light circuit
« Reply #9 on: June 10, 2018, 06:41:25 pm »
Why do you want to avoid DIL14 packages?
Which is easier? One DIL14 package or several DIL8 packages?

You might consider actually reading this thread? It's not that long, and much of it revolves around the OP's desire for using 8-pin devices or smaller, and the reason for that desire.

It is indeed much easier to fit several DIP8 packages into several DIP8 sockets, than to fit even a single DIP14 package into said DIP8 socket.  :P
 
The following users thanked this post: rthorntn

Online sokoloff

  • Super Contributor
  • ***
  • Posts: 1396
  • Country: us
Re: Traffic light circuit
« Reply #10 on: June 10, 2018, 07:18:06 pm »
Don't know about Australia, but in Europe the traffic light sequencing is a bit more involved:

Green -> Amber -> Red -> Red/Amber -> Green
In Austria last week, I noticed an additional light phase:
Green -> Blinking Green -> Amber -> Red -> Red/Amber -> Green
 
The following users thanked this post: rthorntn

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13419
  • Country: gb
  • 0999
Re: Traffic light circuit
« Reply #11 on: June 10, 2018, 10:27:31 pm »
Why do you want to avoid DIL14 packages?
Which is easier? One DIL14 package or several DIL8 packages?

You might consider actually reading this thread? It's not that long, and much of it revolves around the OP's desire for using 8-pin devices or smaller, and the reason for that desire.

It is indeed much easier to fit several DIP8 packages into several DIP8 sockets, than to fit even a single DIP14 package into said DIP8 socket.  :P
You might want to consider whether what you've got to say is helpful before typing . . .

So what if I missed something? It should have been obvious I posted with the best of intentions.

555 timers could easily be used for the NOT gates. All that's required is a little imagination.
=
https://electronicsclub.info/555buffer.htm

Don't know about Australia, but in Europe the traffic light sequencing is a bit more involved:

Green -> Amber -> Red -> Red/Amber -> Green

Yes, it's like that in the UK too, although the original poster said just flipping from red, amber and green is fine for now. I suppose more complex sequences can be added later.
 
The following users thanked this post: rthorntn

Offline rthorntn

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: au
Re: Traffic light circuit
« Reply #12 on: June 10, 2018, 11:13:27 pm »
Thanks everyone.

I think the ring oscillator is what I'm looking for, nice and simple, brilliant.

The snap circuits have 3 x NOT gate modules.

On reading a bit more on this it looks like a NOT gate is just a single transistor so can I just use 3 transistors?

On further reading maybe 3 x MOSFET not BJT (something about high impedance inputs)

It's basic stuff for now.
« Last Edit: June 10, 2018, 11:26:48 pm by rthorntn »
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 5151
  • Country: au
Re: Traffic light circuit
« Reply #13 on: June 11, 2018, 02:11:08 am »
Don't know about Australia, but in Europe the traffic light sequencing is a bit more involved:

Green -> Amber -> Red -> Red/Amber -> Green

Normal sequence in Australia is Green -> Amber -> Red -> Green.(with, in many cases, additional things like turn arrows & pedestrian lights.)
I was horrified to see some traffic lights in the UK back in the '70s which had Amber both ways at the same time!

They also had such delights as "three lane roads" with a common passing lane.
It just shows that if you are used to it, almost everything works!
 
The following users thanked this post: rthorntn

Offline JohnnyMalaria

  • Frequent Contributor
  • **
  • Posts: 473
  • Country: us
    • Enlighten Scientific LLC
Re: Traffic light circuit
« Reply #14 on: June 11, 2018, 02:53:36 am »
They also had such delights as "three lane roads" with a common passing lane.
It just shows that if you are used to it, almost everything works!


Not only that, there are some three lane roads that have two lanes going in one direction and one in the other with nothing to divide the two. Why? Because the direction of the lanes switches from morning to evening to account for the rush hour traffic. In the middle of the day and night the centre lane is bidirectional (like you describe).
Tell me it can't be done and I'll do it. Or give it a damned good try.
 
The following users thanked this post: rthorntn

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 1869
  • Country: gb
Re: Traffic light circuit
« Reply #15 on: June 11, 2018, 06:37:26 am »
Don't know about Australia, but in Europe the traffic light sequencing is a bit more involved:

Green -> Amber -> Red -> Red/Amber -> Green
In Austria last week, I noticed an additional light phase:
Green -> Blinking Green -> Amber -> Red -> Red/Amber -> Green
Who thought up 'Blinking Green' in that context?  Isn't that is what Amber is for?  Maybe it was a bug in the controller s/w?  ;)
(Doesn't blinking green have an entirely different meaning in other places?, e.g. USA)
 
The following users thanked this post: rthorntn

Offline David Chamberlain

  • Regular Contributor
  • *
  • Posts: 238
Re: Traffic light circuit
« Reply #16 on: June 11, 2018, 09:10:45 am »
Yes those posts above are technically relevant but as OP mentioned she is 7 years old!

When I was a kid of that age my dad (and it was mostly him) and I made traffic light project for a school fair. Ours was made of cardboard, dry cell batteries, wire, 12V incandescent bulbs, coloured cellophane, paperclips for switches and thumb tacks to fasten everything together. It worked well enough, everyone was impressed and because it was something I could understand - at the time - it kick started what has become a lifelong (so far) interest in electronics.

Coincidentally I've helped design actual traffic light controllers in a professional capacity so I look back on that memory with fondness. 

What I'm trying to say is please do not stifle a young mind with your own ego.
 
The following users thanked this post: rthorntn

Online wraper

  • Supporter
  • ****
  • Posts: 10764
  • Country: lv
Re: Traffic light circuit
« Reply #17 on: June 11, 2018, 09:32:49 am »
Flying, you missed where he said he didn't want to go to any large dip chips, specifically saying against the 4017
Then why do you want to use 555 at all? I don't see much difference between 8 pin and 16 pin DIP. It's not like it will save significant number of components anyway. You could use following circuit + single BJT invertor for each led as 2 out of 3 LEDs are lit each time. Or just build this running light as is. Which probably is better as don't show unnecessary complication to the beginner.



 
The following users thanked this post: rthorntn

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13419
  • Country: gb
  • 0999
Re: Traffic light circuit
« Reply #18 on: June 11, 2018, 10:17:36 am »
Flying, you missed where he said he didn't want to go to any large dip chips, specifically saying against the 4017
Then why do you want to use 555 at all? I don't see much difference between 8 pin and 16 pin DIP. It's not like it will save significant number of components anyway. You could use following circuit + single BJT invertor for each led as 2 out of 3 LEDs are lit each time. Or just build this running light as is. Which probably is better as don't show unnecessary complication to the beginner.




That's also a good idea. Connecting the LEDs across the transistors should also work but is inefficient.


Another alternative is to add emitter followers, which also has the advantage of allowing smaller capacitors to be used, but it's more parts.
« Last Edit: June 11, 2018, 10:19:16 am by Hero999 »
 
The following users thanked this post: rthorntn

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 8181
Re: Traffic light circuit
« Reply #19 on: June 11, 2018, 12:31:53 pm »
Unfortunately the Jaycar XC3720 LED Traffic Light Module is common cathode.

The only 8 pin DIP and no MCUs constraints are making this project far far harder than it needs to be.   I strongly recommend getting a small breadboard and using normal DIP ICS of up to 16 pins, and normal wire ended components.   If breadboard + Snap-Circuits integration is required, get their snap to male pin jumper pack: http://cs-sales.net/snsetsc.html

Here's a 555 + 4017 traffic light circuit that will work with the Jaycar XC3720 LEDs.   It implements the full red, red+amber, green, amber and back to red sequence, with realistic timings for each phase.  LTspice sim attached.

It could easily be extended for two directions of lights on a full cross-roads junction with a red in both directions phase for the junction to safely clear.   It could also be extended so that some phases hold the 555 in reset so a button or sensor pulse on the other 4017 clock pin is required to proceed to the next phase.

I recommend using a CMOS 555 and a 74HC4017 as they are more forgiving of low supply voltage, and the Jaycar LED module is intended for 5V operation, with integrated resistors to suit, so the 6V max supply voltage for 74HC logic isn't a disadvantage.   If you were driving higher voltage bulbs, the classic CD4017 would be more suitable.

N.B. if using a CD4017 at a supply voltage above 6V, due to the transistors' reverse Vbe breakdown limits, the paralleled NPN emitter follower OR gating that drives the Red and Amber LEDs should be replaced with diode OR gating driving a single NPN emitter follower transistor for each LED.
« Last Edit: June 11, 2018, 12:43:32 pm by Ian.M »
 
The following users thanked this post: rthorntn

Offline FlyingHacker

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: us
  • You're Doing it Wrong
Re: Traffic light circuit
« Reply #20 on: June 11, 2018, 03:56:05 pm »
Could also be done with some DIP8 comparators.

Just charge a cap through a resistor and have comparators to turn in each LED, and finally reset. You could even use the 555 for the charging and reset, but just have the comparators measure the voltage directly at the capacitor.
--73
 
The following users thanked this post: rthorntn

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 1869
  • Country: gb
Re: Traffic light circuit
« Reply #21 on: June 11, 2018, 04:12:27 pm »
I'm working with my 7yo daughter to build a traffic light circuit without an MCU
You might be putting her at a disadvantage to those 7yr olds that have already completed their traffic light circuits because they chose to use an Arduino.  In fact they probably now have four sets of lights and a full traffic junction coded by now.
 
The following users thanked this post: rthorntn

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13419
  • Country: gb
  • 0999
Re: Traffic light circuit
« Reply #22 on: June 12, 2018, 08:02:14 am »
I'm working with my 7yo daughter to build a traffic light circuit without an MCU
You might be putting her at a disadvantage to those 7yr olds that have already completed their traffic light circuits because they chose to use an Arduino.  In fact they probably now have four sets of lights and a full traffic junction coded by now.
You're assuming all the other 7 year olds will be using Arduinios.

Often placing artificial limits on things, promotes creative thinking. For example being asked to build the tallest tower, made from a packet of printer paper.

There's plenty of time for her to learn to code later.
 

Online wraper

  • Supporter
  • ****
  • Posts: 10764
  • Country: lv
Re: Traffic light circuit
« Reply #23 on: June 12, 2018, 08:30:58 am »
Often placing artificial limits on things, promotes creative thinking. For example being asked to build the tallest tower, made from a packet of printer paper.

There's plenty of time for her to learn to code later.
Placing artificial limits is discouraging, there must be some sort of success to get encouragement. On top of that, coding even something simple means you have designed something by your own. Repeating preexisting circuit is not.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13419
  • Country: gb
  • 0999
Re: Traffic light circuit
« Reply #24 on: June 12, 2018, 09:17:34 am »
Often placing artificial limits on things, promotes creative thinking. For example being asked to build the tallest tower, made from a packet of printer paper.

There's plenty of time for her to learn to code later.
Placing artificial limits is discouraging, there must be some sort of success to get encouragement.
It mimics real life. Quite often, it's not feasible to do something the easiest way.

Quote
On top of that, coding even something simple means you have designed something by your own. Repeating preexisting circuit is not.
I agree but the same is true, whichever method is used: copying someone else's code is even more pointless.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf