Introduction: Twinkle_night_lights

This project is an automatic light activated counter which comes to life after dark and switches LED’s in a binary sequence. As the LED’s are free wired, they can be placed in any order to highlight the item to which they are attached.

The circuit has a PCB design which was created in EagleCAD and manufactured as OSHpark although the circuit could have been built on Veroboard with through hole components.

The circuit will then be used to light a 3D printed object.



PCB or Veroboard to mount through hole components.


3D Printer

Translucent Filament

Step 1: Circuit Description

The circuit consists of an oscillator made using an ICM7555 timer configured in the Astable mode. The oscillation frequency can by adjusted using the 500k variable resistor giving a frequency range of 1.5Hz to 220Hz, this controls how fast the counter sequence changes.

Light control of the circuit is accomplished using an LDR in conjunction with the 50k variable resistor for sensitivity adjustment. This potential divider network is connected to pin 4 (reset), of the timer and disables operation of the timer when the voltage at this point is <0.7V.

When the LDR is exposed to bright light its resistance drops to ~170R and in the absence of light 1.3MR

Therefore, in bright light the reset voltage is <=120mV and the timer is disabled and the counter is stopped. In the absence of light, the reset voltage is =>4.8V and the timer is enabled.

The oscillator output is fed to a CD4024 (Seven stage ripple counter), were each output is connected to an LED. Low voltage high efficiency LED’s are recommended making RED the most suitable colour although other colours may be used, they have a tendency to be less efficient.

The output current of the CD4024 in source mode is in the order of 5mA at 5V, the output will be clamped at the LED voltage and the current will be significantly less than nominal, negating the need for a resistor in series with the LED. This reduces the component count and simplifies the circuit.

When the counter is stopped by the absence of clock pulses from the timer the counter output will remain in whatever count was present at that time, this could be with or without a count value.

In order to ensure that the counter output is always zero when the timer stops a dynamic reset is applied.

Therefore, when the timer is enabled in the absence of light the counter is enabled and when the timer is disabled in the presence of light the counter is reset.

This counter reset is provided by a charge pump voltage doubler which is also connected to the timer output.

A resistive pull up is connected to the counter reset pin and also to the charge pump output, when the timer is disabled the counter is reset by this pull up resistor.

Once the timer starts the charge pump, ramps up to ~3V which turns on the N channel FET, pulling the reset pin low and enabling the counter. When the counter stops the FET switches off and the reset line is pulled up to VCC via the pull up resistor resetting the counter outputs low.

Step 2: PCB Asembly

The majority of the components on the PCB were SMD with resistors and capacitors being 1206 types.

The IC’s were mounted first as they would be surrounded by components and this would make it more difficult to access the pins for soldering.

Then the resistors, capacitors, diodes, transistors and finally connectors.

As with anything a few simple checks to ensure there are no solder bridges or open circuits prior to a power up test to verify that the timer and counter both work.

Further assembly would continue with the LED’s once we had an object to connect them too.

Now that we have our lighting circuit, we need something to light up.

Step 3: Object Selection

With that in mind a garden night accent light was decided upon and at the same time a straw poll was conducted and the butterfly won.

For the following reasons:

1: Something that would create a symmetrical LED layout.

2: It fits in with the location.

3: It’s shape would accommodate the PCB without is distracting from the object.

4: The object could be 3d printed.

Step 4: Object Design

Using BlocksCAD I designed a basic butterfly shape.

The shape consisted of a head, abdomen, thorax and 2 pairs of wings.

The head would be used to mount the LDR and the wings would hold 8 LED (2 per wing), although in the final version due to the counter only having 7 outputs and to maintain symmetry only 6 outputs would be used.

To support the LED’s which would be 5 mm leaded types, mounts would be included on the wings.

In order to hold the PCB 2 holes were included in the 2 forewings for M2 screws.

Once the design was complete it just had to be printed out.

In this regard the selection of the filament was important in that it had to be translucent to show the LED’s mounted on the back of the wings, such that they would be visible from the front.

Step 5: Final Assembly

Butterfly printed the LED’S are fitted to the mounts and wires long enough to reach the PCB are attached.

The PCB is screwed in place and the wires from the LED’S soldered to the PCB then the LDR which is fed through the 2 holes in the head are soldered in place on the board.

All that remained were the final tests to adjust the frequency for optimum display and the light sensitivity to determine when the display switched on.

Now dim the lights and watch the show.

Lighting Challenge

Participated in the
Lighting Challenge

Be the First to Share


    • Make it Fly Challenge

      Make it Fly Challenge
    • Fruit and Veggies Speed Challenge

      Fruit and Veggies Speed Challenge
    • Summer Fun: Student Design Challenge

      Summer Fun: Student Design Challenge