1
\$\begingroup\$

I'm trying to build an LED matrix (32x16) that lights up in certain areas in response to movement, as detected by another matrix (8x16) of infrared phototransistors.

Here's where I'm at:

  • Main controller: I chose the Raspberry Pi. It would give me the ability to control the LED matrix using other, more complex methods (ex/ drive from music, over the internet, etc) as compared to a simpler controller (Atmega, PIC, etc).
  • LEDs: single color LEDs in a matrix configuration, each column controlled by a transistor that allows the power to that column to be controlled by the Raspberry Pi. The matrix will use 74hc595 shift registers so it can be controlled using only 3 pins from the RPi.
  • Detectors: Will consist of 2 arrays; one of infrared phototransistors, and one of infrared LEDs. The IR emitters will be connected to power through a single transistor, giving the controller all on/all off options for the IR emitters. The detectors will consist of a matrix (8x16) of IR phototransistors. An object near the detectors will reflect IR light from the emitters onto the detectors, thus changing the resistance of the phototransistors, triggering action from the RPi.

So that seems great, but here's where I'm stuck: I don't know how to get the RPi to read that many values. For the outputs (digital) it was as simple as using shift registers. Does anyone have any ideas of how to get that many analog inputs into the RPi?

*An important piece to note is that the RPi lacks an ADC, so I would need to add my own IC for that.

\$\endgroup\$
5
  • \$\begingroup\$ Do you know how to interface the phototransistors to an ADC? Might you need 8 transconductance amps with 1 of 16 column selection? If you do, do you know how commoned (but unselected) columns of phototransistors may still produce a few nano-amps though they may appear to be unconnected? Whay are you using several infrared LEDs? One will illuminate the target more than likely - it's not likely you will get some kind of image due to dispersion I believe. Answers? \$\endgroup\$ – Andy aka Apr 11 '13 at 18:25
  • \$\begingroup\$ I was just planning on pairing 1 LED with 1 phototransistor so that the values between phototransistors would vary wildly. \$\endgroup\$ – K. Barresi Apr 11 '13 at 19:11
  • \$\begingroup\$ How far apart are the phototransistors, versus how far away is the illuminated target? \$\endgroup\$ – pjc50 Apr 11 '13 at 19:52
  • 1
    \$\begingroup\$ fairchildsemi.com/an/AN/AN-3005.pdf will probably be useful. \$\endgroup\$ – pjc50 Apr 11 '13 at 19:54
  • \$\begingroup\$ I'm thinking somewhere close to 6 inches. I will modify the design in terms of detector amounts when I get a basic version working \$\endgroup\$ – K. Barresi Apr 12 '13 at 0:38
1
\$\begingroup\$

You can get ADCs that have multiple inputs and speak SPI, eg: http://cds.linear.com/docs/en/design-note/dn274f.pdf (randomly selected example, in general Linear are good for this sort of IC)

So, build a matrix of phototransistors. Put the ADC across the columns and energise a row. Read off a set of values.

(This solution may require investigating what the minimum response and sample time of the phototransistors is)

\$\endgroup\$
4
  • \$\begingroup\$ Ah ok, so it's almost like a shift register with a built in ADC? \$\endgroup\$ – K. Barresi Apr 11 '13 at 19:11
  • \$\begingroup\$ Yes - although I'd describe it as an ADC with a shift register, as that will enable you to find it in parts catalogs :) SPI is basically a shift-register based protocol. \$\endgroup\$ – pjc50 Apr 11 '13 at 19:50
  • \$\begingroup\$ Awesome, thank you! \$\endgroup\$ – K. Barresi Apr 12 '13 at 0:37
  • \$\begingroup\$ Since that includes an ADC, then that might be better, but analog multiplexers are also viable. \$\endgroup\$ – Passerby Apr 12 '13 at 5:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.