Circuit Notebook

Interactive Toy Traffic Lights
Multipurpose Flipflop Timer
Automatic White-LED Garden Light
Picaxe-Based Bicycle Odometer

 Advertisement
Advertisement 
Interesting circuit ideas which we have checked but not built and tested. Contributions from readers are welcome and will be paid for at standard rates.

Interactive toy traffic lights

This toy traffic signal uses a single low-cost hex Schmitt-trigger inverter IC (IC1a-IC1f) to directly drive three coloured LEDs (red, green and amber).

At switch-on, the circuit lights the red signal for 30s, then shows green for 6s, then amber for 3s. It then repeats the sequence. Interaction is provided by pushbutton S1 which abbreviates the red period to a further 3s only, if it is pressed while the red signal is showing.

Sequencing of the three LEDs is controlled by inverters IC1c, IC1d & IC1e, while the electrolytic capacitors at the inverter outputs and their associated 2.7MΩ resistors determine how long each LED stays on. Diodes D3, D4 & D5 discharge the timing capacitors for the next two LEDs in the sequence while the current LED is on.

Note also the 10kΩ resistor at the input of each inverter. These protect the inverter inputs from being damaged by the negative voltage produced when the previous output goes low while its timing capacitor is fully charged.

The circuit is forced into the red state at switch-on by IC1f and its associated circuitry. What happens is that IC1f briefly pulls the negative end of the amber timing capacitor (C4) low via D6 at switch-on. As a result, IC1e's output goes high and turns the amber LED (LED3) off.

Contribute and win!

As you can see, we pay good money for each of the "Circuit Notebook" contributions published in "SILICON CHIP". But now there's an even better reason to send in your circuit idea: each month, the best contribution will win one of these superb Peak Atlas LCR Meters - valued at around $195.00.

So don't keep that brilliant circuit secret any more: send it to SILICON CHIP and you could be a winner!

The red timing capacitor (C5) is in a discharged state at power-up because D5 and the 10kΩ resistor at the output of IC1e discharge it when the power is off. As a result, when IC1e's output goes high, IC1c's output goes low and turns LED1 (red) on.

This also pulls the input of IC1d low, so IC1d's output goes high, turning the green LED off.

The amber timing capacitor (C4) at the output of IC1d charges rapidly when it receives the negative pulse from IC1f. That's because its positive end is high when the green LED is off and the pulse takes its negative end low.

When pin 12 of IC1f subsequently goes high at the end of the switch-on pulse, this remains charged and holds the input of IC1e low, so the amber LED (LED3) remains off.

Pushbutton operation is controlled by IC1a and IC1b, which rapidly charge the red timing capacitor (C5) 3s after switch S1 is pressed. This works as follows: pin 2 of IC1a is high when the red LED is on, so pressing S1 during the red period rapidly charges C1. C2 then charges slowly from C1 via a 2.7MΩ resistor.

After about 3s, C2 reaches IC1b's trigger threshold and so pin 4 of IC1b switches low. Because the red LED is on, the amber LED is off. This means that pin 10 of IC1e is high and so the positive end of C5 is also high. When IC1b's output goes low, it pulls the negative end of C5 low via D2, thereby rapidly charging this timing capacitor.

This ends the red period and so the red LED (LED1) turns off. As a result, IC1a's output goes low and C1 and C2 discharge via D1, ready for the next time switch S1 is pressed.

Andrew Partridge,
Kuranda, Qld. ($45)

Multipurpose flipflop timer

This particular timing circuit can be used to time one-shot events from a few seconds to a few hours. And in standby mode (ie, with RLY1 and LED1 off), its power consumption is very low.

The heart of this circuit is a low-cost CMOS 4011 quad NAND gate, with IC1a & IC1b configured as a standard Set/Reset flipflop. Briefly pressing switch S1 to start the timing sequence pulls pin 1 of IC1a low and, as a result, pin 3 switches high.

Two things happen while pin 3 is high: capacitor Cx begins charging via potentiometer Rx; and (2) pin 11 of IC1d will be low, which means that transistors Q3 and Q1 are both on. As a result, both LED 1 and relay RLY1 are also on.

RLY1 and LED 1 remain on until Cx has been charged up to about 70% of Vcc (ie, the supply rail). At this point, pins 8 & 9 of IC1c are pulled high and so its pin 10 output goes low and resets the flipflop by applying a low to pin 6 of IC1b. This causes pin 3 of IC1a to go low and so LED1 and RLY1 switch off and the timing period ends.

At the same time, pin 4 of the flipflop goes high and this turns on transistor Q2 while ever the flipflop is held reset. This ensures that Cx is discharged, so that the circuit is ready the next time S1 is pressed.

Diode D1 and its associated 10μF capacitor reset the flipflop when power is first applied, so that LED1 and RLY1 remain off until S1 is pressed. D4 is included to protect Q1 against the back-EMF that's generated when the relay switches off.

Choosing appropriate values for Cx & Rx for a given time delay is straightforward. The formula is T = 1.24 x Rx x Cx, where T is the delay time in seconds.

As an example, let's assume that we require a time delay of 10s using a value of 100μF for Cx. Now we just need to calculate the value of Rx as follows:

Rx = 10s/(1.24 x Cx) = 80,645Ω

In this case, an 82kΩ resistor would be the closest value.

You can use either a fixed resistor for Rx or you can use a potentiometer (or trimpot) which can be adjusted to give the required time delay. Note that the value of Rx should not be any more than a few megohms.

Power for the circuit can be derived from any 12V DC source. This is then fed to 3-terminal regulator REG1 to derive a 9V rail to power the circuitry. The exception here is the relay circuit, which is powered from the 12V rail. Diode D3 protects the circuit against incorrect supply polarity.

Trent Jackson,
Dural, NSW. ($40)

Automatic white-LED garden light

This white-LED driver circuit is ideal for use in a garden light. It automatically turns the LED on at night and runs from a single 1.2V nicad cell which is recharged by a solar cell during the day.

The prototype used the existing casing and solar cell from an old garden light but you could also use a solar cell from a solar education kit.

Diode D1 allows the solar cell to charge the battery during the day and prevents it from discharging back into the solar cell at night. Transistor Q1 controls the LED driver circuit. This transistor is normally on during the day (ie, when there is output from the solar cell) and so Q2 and the LED are off.

At night time, Q1 is off and this allows a simple blocking oscillator circuit based on T1, R2 and Q2 to operate. This circuit in turn drives LED1 via a 1W resistor which limits the peak current into the LED.

T1 is wound bifilar, with the two windings configured to produce a centre-tapped winding. Winding AB is the main primary winding and winding BC is the feedback winding. The number of turns and the core used are not critical. The prototype worked with a toroid scrounged from an old computer power supply, as well as with a small ferrite suppression bead and an Altronics L5110 core.

The toroids were wound using 10 turns of 0.25mm wire, while the ferrite bead worked with just five turns of 0.25 mm wire through the hole (that's all that would fit).

The oscillator works like this: when Q1 turns off, current flows through R2 and turns Q2 on. This causes current to flow through winding AB and the core produces a magnetic flux. And that in turn causes end C on the transformer to rise above the battery voltage and turn Q2 on hard.

When the core saturates, the voltage at C drops back to the battery voltage, thus reducing the current in winding AB. As this happens, the flux in the core starts to fall and this causes the voltage at C to drop below 0.6V. As a result, Q2 turns off and because there is now no current in AB, the flux in the core starts to collapse.

What happens now is that the voltage on end A of the windings rises above the battery voltage. When it gets to 3.2-3.6V with respect to ground, LED1 "fires" and current flows from the battery via BA, through the LED and back to the battery.

When the flux is spent, LED1 turns off and end C returns to the battery voltage. Current now flows through R2 and into the base of Q2 and the whole cycle starts over again.

Finally, when the Sun rises the following morning, Q1 turns on, robs Q2 of its base drive, the oscillation stops and LED1 goes out.

Nick Baroni,
Willetton WA.

Picaxe-based bicycle odometer

This bicycle odometer has a 100-metre resolution and is based on the Picaxe08 microcontroller.

A magnetic reed switch fixed to the bicycle frame is used to detect the wheel rotations. This reed switch is activated by a magnet fixed to the wheel spokes and triggers an RS flipflop based on IC1.

The "Q" output of the flipflop is coupled to an input (pin 4) of IC2, the Picaxe microcontroller chip. The Picaxe program (see next page) waits for a high on pin 4 and when this occurs, the program branches to a counter which is incremented with each wheel revolution.

Subsequently, the program sets a high on pin 5 which resets the flipflop to a low state. This prevents retriggering on a single pass of the magnet past the reed switch. It also prevents retriggering in the event that the bicycle is stationary but the magnet is adjacent to the reed switch.

My bicycle has a wheel diameter of 700mm, corresponding to a circumference of 2.2m. This corresponds to 45.5 revolutions over a distance of 100 metres. As a result, the program alternately counts 45 revolutions and 46 revolutions to give the necessary 45.5 revolutions/100 metres.

Each time a count of 45 or 46 is reached, the program sends a 1ms pulse to pin 3 using the 'Puls' subroutine. This increments the digital counter by 1, corresponding to 0.1km.

The prototype used a 3-digit LED counter to provide a readout for the odometer but a cheap calculator could also be used to perform the counting function (see SILICON CHIP, May 2003).

Tony Verberne,
Ivanhoe, Vic. ($40)

Bicycle Odometer Program

Copyright © 1996-2009 Silicon Chip Publications Pty Ltd & Web Publications Pty Limited. All Rights Reserved