Part 3

Circuit 7 – Emergency Lights

Schematic

Don’t be alarmed, this circuit isn’t as complicated as it looks. Let’s break it down.

IC1, a NE555, is configured in the astable mode to deliver a squarewave of 55% duty cycle. This is achieved through some deliberate wiring. R1, R2 and C1 are sized accordingly to deliver a 55% duty cycle.

The operation of the NE555 in astable mode will be omitted for brevity. It has been discussed in detail in the first iteration of this article

The output (Pin 3) of IC1 connects to three transistors.

Q1 is an NPN transistor, BC337.

Q2 is a PNP transistor, BC327

PNP transistors operate when current can flow from the emitter, out through the base, and to ground. We want BOTH Q2 and Q3 to conduct in order to illuminate the red LED string.

This is where Q3, another NPN transistor enters the picture. It connects Q2 to ground when it is conducting.

The output of the second NE555, IC2 connects to Q1 and Q3. The result is that each transistor will conduct separately. This pattern repeats, resulting in the rapid flashing of the two LED strings. This mimics the flashing lights of emergency vehicles such as ambulances, police vehicles and firetrucks, albeit to a lesser degree.

IC2 is configured to produce a squarewave, exactly like IC1. It determines which LED string illuminates. HOWEVER, R13 is a potentiometer. This allows you to adjust the duty cycle and hence the rate of flashing of the emergency lights. As mentioned previously, the output of IC2 connects to Q1 and Q2.

When IC2’s pin 3 is high, Q2 conducts (if Q3 is conducting).

When IC2 is low, Q1’s base emitter junction is grounded, thus it conducts. There is no current to Q2’s emitter because the path through pin 3 is a lower resistance than Q2’s base-emitter junction.

The order of Q1 and Q2 is significant for this functionality. If they were the other way around, current could flow out Q2’s base and into Q1’s base, to ground. The voltage drop from base to emitter and the 1kΩ resistors help make sure that, when connected the way they are, the path through IC1 is the lower resistance and current will not flow from Q2’s base up to Q1’s in that part of the cycle.

To summarize, Q1, BC337 (NPN) acts as a current sink whilst Q2, BC327 (PNP) acts as a current source

This circuit can easily be appended to an existing vehicle toy.

Circuit 8 – Pulsing LED

Schematic

This circuit produces a sudden pulse of LED light which then decays slowly over time. The BC327 is rated for ≥500mA so you can have:

  • 6 LEDs@30 mA
  • 25×@20 mA
  • ~50×@10 mA

IC1 a NE555 is configured in astable mode to deliver a squarewave with a 91.3% duty cycle. The ON time is 1.68 seconds and the OFF time of 0.16 seconds. This can be inferred by the sizing of R11 and R12. R12 is 10 times smaller than R11 resulting in a significantly shorter OFF time.

Q1 is a PNP BC327. For a PNP transistor, in order for a large current to follow from emitter to collector, a small current must be applied between emitter and base.

When pin 3 of IC1 goes high, D2 blocks that current. When low, C1 discharges into (sinks) into pin 3. During this stage, Q1 conducts. The emitter current from Q1 flows into the capacitor, charging it. The more it charges, the less the current that flows, so the capacitor charges even more slowly.

R10 is included to manipulate the RC time constant to ensure a gradual decay, producing the desired LED effect.

When IC1 is low, the base current slowly drains which results in the emitter-collect current reducing. This achieves the gradual decay in brightness.

NOTE: The LED are connected in parallel with its own resistor to ensure uniform brightness.

Circuit 9 – Daylight Switch

Schematic

This circuit triggers a LED string when it gets dark enough or vice versa, if you want them to turn off when it gets dark enough. Can be configured to turn off once your room lights go out when you want to sleep.

An LM311 illuminates an LED string dictated by an LDR in a voltage divider configuration.

The LM311 is a comparator.

If the voltage at the non-inverting input (+) is greater than the voltage at the inverting input (-), the output is off

If the voltage at the non-inverting (+) input is less than the voltage at the inverting input (-), the output is on.

The output of the LM311 is open collector/emitter. This simply means that rather than the collector and emitter being connected internally to VCC or GND, it is accessible via the pins.

See the following image for a visual depiction:

Pinout of the LM311

The collector (pin 7) is connected to the base of Q1 via R4. The PNP transistor will conduct when pin 7 sinks current. R4 limits the base current.

D1 drops the input voltage to a safe level for the store-bought LED string which is usually 4.5V (x3 AA’s).

A voltage divider comprised of R1 (a potentiometer) and R2 (and LDR) connects to pin 3, the inverting input. A potentiometer (R3) connects to pin 2, the non-inverting input. Adjust its resistance to match the LDR’s resistance in broad daylight.

R1 can be adjusted to set the triggering of the LED string. It’s the “on” point for the comparator.