Shop OBEX P1 Docs P2 Docs Learn Events
Project question — Parallax Forums

Project question

tbennertbenner Posts: 2
edited 2012-08-01 22:18 in BASIC Stamp
I'm thinking of building a project where I can detect an led light which is moving about in an area around 9 by 9cm. I'm thinking of using an array of 16x16 photo detectors to do this, which would be connected to a Basic Stamp 2p40 module. From what I've read, the 2p40 module has 32 I/O pins, which I'd be using 16 for output and 16 for input. I just want to be sure all 32 I/O pins can be used(there isn't any gotchas somewhere). I would rather use a Basic Stamp as opposed to an Arduino, since I have not used an Arduino before and this needs to get built fairly quickly.
Also what external circuitry would be needed to power up and run the 2p40? Does Parallax have a schematic drawing of what I would need? I guess I would use the professional development board if I wanted to prototype the 2p40?

Thanks

[Tim]

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-23 12:55
    There are some limitations on the use of the 32 I/O pins of the BS2p40. Specifically, your program can only access 16 pins at any one time. There's a pair of statements (MAINIO / AUXIO) that switches back and forth. As far as your program is concerned, it has 16 I/O pins. The other 16 I/O pins save their output state, so that helps. It would be fairly easy to use 16 for inputs and 16 for outputs and switch back and forth. The MAINIO and AUXIO statements are quick, so pairing one of these with statements that access I/O pins is not a big burden.

    More commonly, people use something like the 74HC595 and 74HC165 for I/O expanders (output and input respectively). These can be cascaded and should be more than fast enough for your project. You'd have two 74HC595s for 16 outputs and two 74HC165s for 16 inputs. You could use a BS2p24, use 3 I/O pins for the 74HC595s and 3 I/O pins for the 74HC165s (serial clock, serial data, and latch clock). There's plenty of sample code in the StampWorks Manual.
  • tbennertbenner Posts: 2
    edited 2012-07-24 11:26
    Mike

    Thanks for the info, this is helpful.
    Ideally it would be nice to have a sheet of material which is sensitive to IR light. This material would have a voltage output for the two axes. The voltage would go from say 0 to 5V on each axis, depending on where the light struck the material. Given that we have touch sensitive tablets today and such, I would think something like this would be possible, but have not found anything.
    Anyone else ever heard of something like this?

    [Tim]
  • LeonLeon Posts: 7,620
    edited 2012-07-24 11:35
    16x16 IR detector arrays are made, but they are very small and are intended for image-processing using a germanium lens to focus the scene on the array. They are rather expensive.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-08-01 22:18
    You might find some useful info here. http://www.boselec.com/products/detir.html
Sign In or Register to comment.