EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: rthorntn on June 10, 2018, 05:04:25 am

Title: Traffic light circuit
Post by: rthorntn 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 (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/ (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
Title: Re: Traffic light circuit
Post by: Rerouter 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 (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)
Title: Re: Traffic light circuit
Post by: FlyingHacker 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.

Title: Re: Traffic light circuit
Post by: Rerouter 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
Title: Re: Traffic light circuit
Post by: FlyingHacker 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?
Title: Re: Traffic light circuit
Post by: rthorntn on June 10, 2018, 07:36:24 am
Thanks all!

http://elenco.shptron.com/p/eight-pin-ic-socket-u8 (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?
Title: Re: Traffic light circuit
Post by: Rerouter 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 (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 (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)
Title: Re: Traffic light circuit
Post by: Zero999 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 (http://tinyurl.com/yb6ul4fs)
(https://www.eevblog.com/forum/beginners/traffic-light-circuit/?action=dlattach;attach=452611;image)
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!
Title: Re: Traffic light circuit
Post by: Benta 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

Title: Re: Traffic light circuit
Post by: ebastler 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
Title: Re: Traffic light circuit
Post by: sokoloff 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
Title: Re: Traffic light circuit
Post by: Zero999 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/symbols/not.gif) = (https://electronicsclub.info/images/555buffer.gif)
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.
Title: Re: Traffic light circuit
Post by: rthorntn 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.
Title: Re: Traffic light circuit
Post by: vk6zgo 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!
Title: Re: Traffic light circuit
Post by: JohnnyMalaria 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).
Title: Re: Traffic light circuit
Post by: NivagSwerdna 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)
Title: Re: Traffic light circuit
Post by: David Chamberlain 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.
Title: Re: Traffic light circuit
Post by: wraper 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.

(http://s002.radikal.ru/i200/1001/ff/edb8e59130ce.gif)

(https://s001.radikal.ru/i196/1001/d2/e468a62901db.jpg)
Title: Re: Traffic light circuit
Post by: Zero999 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.

(http://s002.radikal.ru/i200/1001/ff/edb8e59130ce.gif)

(https://s001.radikal.ru/i196/1001/d2/e468a62901db.jpg)
That's also a good idea. Connecting the LEDs across the transistors should also work but is inefficient.
(https://www.eevblog.com/forum/beginners/traffic-light-circuit/?action=dlattach;attach=453448;image)

Another alternative is to add emitter followers, which also has the advantage of allowing smaller capacitors to be used, but it's more parts.
(https://www.eevblog.com/forum/beginners/traffic-light-circuit/?action=dlattach;attach=453457;image)
Title: Re: Traffic light circuit
Post by: Ian.M 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 (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.
Title: Re: Traffic light circuit
Post by: FlyingHacker 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.
Title: Re: Traffic light circuit
Post by: NivagSwerdna 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.
Title: Re: Traffic light circuit
Post by: Zero999 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.
Title: Re: Traffic light circuit
Post by: wraper 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.
Title: Re: Traffic light circuit
Post by: Zero999 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.
Title: Re: Traffic light circuit
Post by: wraper on June 12, 2018, 09:39:52 am
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.
Entry level of writing your own code is much lower than designing own circuit.
Title: Re: Traffic light circuit
Post by: wraper on June 12, 2018, 09:50:43 am
Quote
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.
Yeah, show the real life to 7yo  :palm:.
Title: Re: Traffic light circuit
Post by: Zero999 on June 12, 2018, 09:54:50 am
Quote
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.
Yeah, show the real life to 7yo  :palm:.
That's what being a good parent is about FFS: preparing your children for real life!

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.
Entry level of writing your own code is much lower than designing own circuit.
That depends on the complexity and the nature of the device. I designed my own circuits using switches, lamps and relays, long before I touched a keyboard and found it easier than coding. There are no commands to remember.

However in this case, it's a state machine, so yes, coding is easier.
Title: Re: Traffic light circuit
Post by: NivagSwerdna on June 12, 2018, 10:00:47 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.
Absolutely not.  I'm assuming other 7yr olds will be watching Peppa Pig. I am hoping that this 7yo gets given a path of least resistance otherwise they will give up.
Incidentally... I remember a long time ago doing Nuffield Physics at school... must have been around 14yo at the time maybe older and we built some traffic lights from some building blocks which were small square plugable grey boxes (presumably gates, multivibrators etc); at 14yo that was about do-able.  Maybe young people are smarter nowadays?  ;)
(PS I was also wondering about suggesting Lego Mindstorms but I haven't used them so can't really comment... even that might be a stretch for a 7yo.)
DISCLAIMER: I love Peppa Pig.  Especially the parrot episode. :)
Title: Re: Traffic light circuit
Post by: wraper on June 12, 2018, 10:01:27 am
Quote
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.
Yeah, show the real life to 7yo  :palm:.
That's what being a good parent is about FFS: preparing your children for real life!
:palm: The only thing it can do to the child at such young age is discourage and loose self confidence.
Quote
I designed my own circuits using switches, lamps and relays, long before I touched a keyboard and found it easier than coding. There are no commands to remember.
Don't forget the year you were born. What was the best available best back then does not mean it remains so today.
Title: Re: Traffic light circuit
Post by: wraper on June 12, 2018, 10:09:48 am
Also don't forget that with computers, smartphones and all other stuff being all around nowadays, child might just think that WTF I need to mess with those stupid switches and lamps.
Title: Re: Traffic light circuit
Post by: tautech on June 12, 2018, 10:53:34 am
Don't forget the year you were born. What was the best available best back then does not mean it remains so today.
I don't and when I was 7 in '66 dad bought me a Philips 2 transistor electronics set as I'd been playing with batteries and bulbs for a year or so. If kids show some curiosity and interest.....foster it !
Title: Re: Traffic light circuit
Post by: Zero999 on June 12, 2018, 11:17:43 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.
Absolutely not.  I'm assuming other 7yr olds will be watching Peppa Pig. I am hoping that this 7yo gets given a path of least resistance otherwise they will give up.
Incidentally... I remember a long time ago doing Nuffield Physics at school... must have been around 14yo at the time maybe older and we built some traffic lights from some building blocks which were small square plugable grey boxes (presumably gates, multivibrators etc); at 14yo that was about do-able.  Maybe young people are smarter nowadays?  ;)
(PS I was also wondering about suggesting Lego Mindstorms but I haven't used them so can't really comment... even that might be a stretch for a 7yo.)
DISCLAIMER: I love Peppa Pig.  Especially the parrot episode. :)
If you continuously give children the path of least resistance, they will never learn anything.

Quote
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.
Yeah, show the real life to 7yo  :palm:.
That's what being a good parent is about FFS: preparing your children for real life!
:palm: The only thing it can do to the child at such young age is discourage and loose self confidence.
Quote
I designed my own circuits using switches, lamps and relays, long before I touched a keyboard and found it easier than coding. There are no commands to remember.
Don't forget the year you were born. What was the best available best back then does not mean it remains so today.
And I started learning electronics when I was a bit younger than that, with minimal support from my dad.

I don't think I could have figured out how to use an Ardunio, at the age of 7, had there been such a thing back then. It would have made me completely lose self-confidence, as my reading wasn't good enough to RTFM. I found schematics with switches, relays and lamps much easier to follow, than reading text. Heck, even today, I find schematics easier to follow, than reading lines of code.

Also don't forget that with computers, smartphones and all other stuff being all around nowadays, child might just think that WTF I need to mess with those stupid switches and lamps.
And I had TV and simple video games, yet it didn't stop me from playing with stupid switches and lamps. Other children had home computers and got into programming in BASIC, but I that didn't interest me that much. It's interesting to see how little children have changed: my 5 year old nephew also likes playing with stupid screws and wood, even with all the more exciting gadgets available today.
Title: Re: Traffic light circuit
Post by: NivagSwerdna on June 12, 2018, 11:20:52 am
If you continuously give children the path of least resistance, they will never learn anything.
ROFL
Title: Re: Traffic light circuit
Post by: wraper on June 12, 2018, 11:33:07 am
If you continuously give children the path of least resistance, they will never learn anything.
Arduino is certainly not a path of least resistance. The path of least resistance is when you provide a TV with cartoons and a game console so they can waste their time without bothering you. FFS I hope you don't have any children, otherwise I'm sorry for them.
EDIT: I mean that electronics or programming already is not an easy path, to begin with. So making it even more challenging than it could be, especially when you just try getting 7yo into it is just plain stupid. When child got interested and already learns something is when you could give something more challenging to do.
Title: Re: Traffic light circuit
Post by: Ian.M on June 12, 2018, 12:51:11 pm
Its worth mentioning at this point that the Snap-Circuits system the O.P. is using supports the PICAXE-08M2 (http://www.picaxe.com/Hardware/PICAXE-Chips/PICAXE-08M2-microcontroller/) MCU, which can be programmed graphically in a way that's more accessible to younger children.

See https://www.elenco.com/wp-content/uploads/2011/08/SCXP-50.pdf (https://www.elenco.com/wp-content/uploads/2011/08/SCXP-50.pdf) for the manual of the now discontinued SCXP-50 kit that shows how to use a PICAXE-08M2 with Snap-Circuits. To get the essential parts you need to use a PICAXE-08M2, see the Snap-circuits spare parts page: http://cs-sales.net/sncirepa.html (http://cs-sales.net/sncirepa.html) (Edit: stupid site doesn't allow deep links).  Look for "PICAXE Micro IC in Socket # 6SC U21" or if you already have a suitable PICAXE-08M2 "8-pin IC Socket ONLY with Micro Marking # 6SC U21S"

Its worth noting  that a PICAXE chip needs a couple of resistors on its serial input pin (see Nuts & Volts article link below) to prevent noise interrupting the program.  For it to work  properly the #6SCU21S PICAXE socket snap must include them internally.  If you wanted to use a generic "Eight-Pin IC Socket # 6SC ?U8" snap, you'd need to make a little carrier board with a socket for the actual PICAXE chip, those resistors, and an 8 pin header to fit the DIP socket on the 6SC?U8.

The official PICAXE system download cable is terminated with a 3.5mm stereo jack plug, and the Snap-Circuits SCXP-50 download cable with snaps on the end ("Cable USB to Snaps # TL SCXP" on the spares page) is rather expensive at $40 so you'll probably need a programming jig or adapter.

Probably the easiest/cheapest option (with a competent electronics tech in the house) would be to DIY the programming cable - see http://www.nutsvolts.com/magazine/article/july2014_Tyler (http://www.nutsvolts.com/magazine/article/july2014_Tyler)
and buy orange, yellow and black snap to snap  jumper wires (search spares page for "jumper wire") to hack up and solder to the DIY programming cable board.  However, one could just get the official PICAXE cable, and the Snap-Circuits "Audio Jack on Snaps, Horizontal # 6SC JA" + those three jumpers and use the 6SCJA as an adapter.

Once you've jumped through all those hoops, you can download for free all you need to program PICAXE MCUs in BASIC or graphically using flowcharts from the official PICAXE website: http://www.picaxe.com/Software. (http://www.picaxe.com/Software.)   There's also support for using it with MIT Scratch.

N.B. To avoid frustration and resulting lack of interest you need to have 'all your ducks in a row' before putting this in front of a child - All hardware assembled and tested, all software installed and a basic 'blinky LED' hello world program running on the PICAXE-08M2, and enough familiarity with the PICAXE toolchain that you can demonstrate 'drag & drop' flowchart programming to the child without fumbling it.

Edit: I found the Snap-Circuits PICAXE USB to snaps cable on the spare part page, + some problems with the links to parts, so a lot of changes above.
Title: Re: Traffic light circuit
Post by: Zero999 on June 12, 2018, 12:53:23 pm
If you continuously give children the path of least resistance, they will never learn anything.
Arduino is certainly not a path of least resistance. The path of least resistance is when you provide a TV with cartoons and a game console so they can waste their time without bothering you. FFS I hope you don't have any children, otherwise I'm sorry for them.
EDIT: I mean that electronics or programming already is not an easy path, to begin with. So making it even more challenging than it could be, especially when you just try getting 7yo into it is just plain stupid. When child got interested and already learns something is when you could give something more challenging to do.
I agree with you about unnecessary complication, but you shouldn't assume everyone learns the same as you do. Fair enough, you might find coding easier, than designing/following a schematic, but not everyone feels the same way.

I'm glad I wasn't forced down the path of coding when I was 7. It would have put me off computers for life! Fortunately the first time I used a computer was for word processing, because it was a practical application and I could see how it made life easier for me: I always struggled with handwriting!

I'm glad my first experience of electronics was with dumb switches, lamps and relays, rather than the Ardunio. I found it fun making my own relay, from a nail and pieces of iron wood staples, even before I knew the word 'relay' or its schematic symbol.

Every child is different. Someone who's a visual learner will struggle with coding, but will find building something with physical components, from drawings easier. One of the problems with the education system is one size fits all!

If a child is interested in something, they'll learn it for themselves. All one needs to do is guide them.
Title: Re: Traffic light circuit
Post by: Ian.M on June 12, 2018, 01:13:16 pm
Also the Arduino environment is absolutely unforgiving to a novice with no experience programming in a procedural language.  Due to the crappy Arduino IDE lacking syntax checking and error hiliting, there is no instant feedback that there's something wrong with the line you've just typed.  To get anywhere, even just modifying supplied example sketches, you have to be able to write syntactically correct C code, and interpret cryptic GCC error messages. 

Putting an Arduino already set up and connected to a PC with the Arduino IDE installed and running in front of a 7 year old is just *DUMB* and will frustrate and/or bore the child - unless they are a prodigy already tackling higher education.   Most children will be able to handle the concepts and develop the skills required sometime in their teens, but that's not guaranteed as a significant proportion of adults (of average intelligence) have little or no aptitude for procedural computer programming.
Title: Re: Traffic light circuit
Post by: NivagSwerdna on June 12, 2018, 02:04:59 pm
Have you spent time with a 7 year old recently?  They are quite limited in their EE and Computer Science skills.  We are more thinking along the lines of cutting things out and sticking them on, building some LEGO or tying shoe laces etc.

Quote
I'm working with my 7yo daughter
The OP recognised that this would be a *with* type of guided exercise.

I do agree that Arduino isn't easy.... there seem to be quite a few platforms that aren't that easy... e.g. RPi, Micro:bit etc,... as I mentioned before I don't have experience of Lego Mindstorms... I presume that is 'easy'?
Title: Re: Traffic light circuit
Post by: Ian.M on June 12, 2018, 03:05:18 pm
I don't know about 'easy' but the drag and drop LEGO Mindstorms applicatinon certainly gets away from traditional programming and makes it more accessible to kids.  I  believe LEGO Mindstorms targets age 10+, but each child is an individual, and a particularly bright 7 year old may well take to it readily.  e.g. https://www.techagekids.com/2015/09/lego-mindstorms-ev3-age-recommendations.html (https://www.techagekids.com/2015/09/lego-mindstorms-ev3-age-recommendations.html) is a blog post of the author's experience introducing his 7 and 8 year olds to the system  .
Title: Re: Traffic light circuit
Post by: JohnnyMalaria on June 12, 2018, 04:01:08 pm
Maybe it's just me but the place to start is a simple breadboard, 74 series logic chips, a timer, battery, LEDs and resistors. This will teach the basics of binary logic and rudimentary electronics. Pair it with a very simple truth table she creates with your guidance for the simple green-yellow-red-green-yellow-red then progress to a more complex table for the red-red/amber-green-amber-red). Once she gets the concepts then move to some simple programming language (e.g., VBA) and then progress to the complicated world of the Arduino, PICAXE etc. I just think jumping straight in to the latter isn't as educational.
Title: Re: Traffic light circuit
Post by: Ian.M on June 12, 2018, 04:34:39 pm
Yes, its easy to get lost in the fancy technology.  It may even be better to start with gearmotor driven mechanical switching to introduce the fundamental concepts of sequencing before advancing to sequential 555s or a clocked 4017.

VBA is not at all simple.   I mentioned MIT Scratch (https://en.wikipedia.org/wiki/Scratch_(programming_language)) previously, as that is largely drag and drop and is popular with the STEM education community.
Title: Re: Traffic light circuit
Post by: NivagSwerdna on June 12, 2018, 05:06:09 pm
http://www.primaryscience.ie/media/pdfs/col/dpsm_traffic_lights_activity.pdf (http://www.primaryscience.ie/media/pdfs/col/dpsm_traffic_lights_activity.pdf)
Title: Re: Traffic light circuit
Post by: Zero999 on June 12, 2018, 09:30:48 pm
http://www.primaryscience.ie/media/pdfs/col/dpsm_traffic_lights_activity.pdf (http://www.primaryscience.ie/media/pdfs/col/dpsm_traffic_lights_activity.pdf)
I agree. That's the sort of thing I started out with, except it was an old doll's house, which my father installed a light in. I think the average 7 year old, perhaps even younger, will be able to understand the concept of a circuit and switches Then it becomes easy to introduce them to electromagnets and relays: the most basic active component.