Quozl's Random LED Flasher

| quozl@us.netrek.org | up |

17th July 1999

flasher.asm - a PIC 16F84/12C509 based multi-frequency 24-bit psuedo-random security LED flasher

Quozl has an LED fetish. He likes lights around his abode. His friends think they are security warning devices. It is hoped that potential thieves believe the same thing.

A simple constant duty cycle flasher is now so common as a warning device, that it has begun to lack credibility. Flashing lights are being ignored. But this one is different ... it flashes randomly, and so it is noticed. It can be set for varying apparent frequencies, and can be connected using a diode-OR to increase the duty cycle.

How does it work? Mostly it just sleeps. In between, it updates a 24-bit psuedo random number generator and increments a beat counter. The low eight bits of the current random number are ANDed with the beat counter and then written to the output ports. The result is that each port bit is driven with a random sequence of pulses with an average frequency related to which port bit it is.


16th May 2003

The data sheet for the 12C509 explains the power connections, and the rest of the pins are outputs that are driven at different average but random rates. The PIC is configured by the source code to use the internal oscillator.

It has been years since I made the device, so I opened the box in October 2002 and took a photograph. From that, one of my readers has made a schematic.

The prototype was made on veroboard, with very few components. These might not be the components you need. I used a 5V regulated power supply with a 10cm cable to the circuit. I used two capacitors across the power supply at the veroboard to filter the power supply; one 10uF tantalum, and one 0.1uF ceramic.

Two of the output pins are connected via diodes to the gate of a power MOSFET that has a logic level gate voltage. The MOSFET was a 2SK2175. A resistor was added to ground, so that the MOSFET gate would be pulled low if none of the output pins were high. The MOSFET switches the ground line to the output plug (lower right). I'm not convinced the MOSFET is fully activated at 5V though.

The output plug is connected to a high brightness LED with a dropping resistor suitable for running at 5V.

(The breadboard prototype using a PIC 16F84 directly drove LEDs through 1k resistors, but this veroboard prototype can drive with a higher current because of the MOSFET)

Parts list as observed;

QuantityDescription
1PIC 12C509 microcontroller
1veroboard, 10 columns x 12 rows
18-pin IC socket
4header pins for power and output connectors
2header sockets and cabling
110uF 16V tantalum capacitor
10.1uF ceramic capacitor
11k resistor
21N4148 diode
12SK2175 logic level gate MOSFET
1high brightness LED (not shown)
1dropping resistor for LED (not shown)


| quozl@us.netrek.org | up |