Using band pass filter to read data

Thread Starter


Joined Jul 19, 2015
Ok so my friend is a computing student and he's asked me for help with his project, basically he's doing something with RC cars and needs them to recognise traffic lights. He wants to control the traffic lights using an arduino.

The arduino has about 9 GPIO pins and my plan would be to run one set of traffic lights off each pin.

My plan is as follows;

for green the arduino outputs a 10hz square wave
for amber a 100hz wave
and for red a 1khz wave

The waves would then go through a band pass filter, into a rectifier and then to the led.

I was wondering if this would actually work and if its the most practical solution?

All I can say is, if it works, it would give him the ability to control 9 sets of lights simultaneously.

Would he be able to run multiple leds off one rectified signal?


Joined Oct 2, 2009
How many total traffic lights do you want to control?

I can't help but think that it would be easier to use several pins and multiplex all the traffic lights to that group of pins (digitally).

On a 1 light per pin basis, I would use PWM:
100% duty-cycle high=red,
100% duty-cycle low=green,
50% duty-cycle high/low=yellow.

Much easier to filter and then decode with a window comparitor compared to using frequency to encode the information.

Thread Starter


Joined Jul 19, 2015
There would be approx 100 traffic lights (300 leds)... I've very little experience with multiplexers, only moving onto them properly next semester of college....

Could you give me an idea of the circuit i'd have to use and what signal would be needed from the arduino?


Joined Oct 2, 2009
Expanding on Blocco's idea:

Suppose you have a single 100bit long shift register (SR) made up of 8bit chips. It takes only two Arduino pins to control the SR; one is data, the other is the shift clock. The problem is that when changing only one of the bits, you must reload all 100 of the bits. To prevent flicker, the reloading time must be very short relative to your eye's flicker fusion rate....

The basic idea is explained here.

blocco a spirale

Joined Jun 18, 2008
The LEDs will need to be blanked when the shift-register is loading and this may cause a noticeable blink every time a light changes but a little capacitance across each LED will probably be sufficient to mask this.

Or, with a little more complexity, every time the shift-register is reloaded its outputs could be loaded into a set of corresponding latches.


Joined Aug 1, 2013
How are you going to wire up this system? The two basic ways are home runs (4 wires to each 3-LED set, 132 wires total ), and distrbuted (the same 3 wires star or daisy chain to all light sets, with a decoder driver at each set). For the distributed system you could use any serial protocol: RS-232, RS-422, I2C, SPI, USB, or something proprietary. You need only 3 wires because there is no data coming back from the lights. A minimalist receiver with 10 mA per LED would be one 8-pin PIC. The messy part is that each PIC has to be programmed with a unique address.

An alternative to the shift register method above is to use I2C port expanders. 8 LEDs per chip, and the chip has built in latches so the blanking issue is solved without additional parts.