Using band pass filter to read data

Discussion in 'Embedded Systems and Microcontrollers' started by Hbreslin, Jul 19, 2015.

  1. Hbreslin

    Thread Starter New Member

    Jul 19, 2015
    3
    0
    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?
     
  2. Hbreslin

    Thread Starter New Member

    Jul 19, 2015
    3
    0
    Just a quick outline of the idea, easier to represent as a picture!

    [​IMG]
     
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.
     
  4. Hbreslin

    Thread Starter New Member

    Jul 19, 2015
    3
    0
    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?
     
  5. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    It would be relatively easy to implement using a shift-register; no bandpass filters or multiplexing necessary.
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.
     
  7. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    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.
     
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,523
    1,247
    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.

    ak
     
  9. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    761
    CD4094 comes to mind. Used it for years.
     
Loading...