row column scanning of photocell array with bs2
K.Camarata
Posts: 6
I have an 8 by 8 array of photocells that I would like to scan using a bs2. The rows are being scanned through an 8-bit shift register and the columns can be scanned using up to 10 bins of the bs2. Any ideas on how to pull this off?
thanks
thanks
Comments
It's not quite clear what the input to the Stamp is going to be. Is this a set of only 8 bits representing the active (1) or inactive (0) state of these photocells, or is this a numeric value (voltage perhaps)? It's also not quite clear if there are multiple shift registers, or only one?
A simple diagram of how this is set up externally, would be real helpful. The implementation is fairly straightforward once the format of the data is known.
Regards,
Bruce Bates
The system has a basic stamp and a shift register to control the row scan and 10 free pins to control and read the columns. (The system also has leds being powered by the same row shift register and being lit by pulling their own shift registers low, but that part works and may only confuse the topic).
So - 3 pins are talking to the cascaded shift registers, 3 pins are reserved for future RF communication, and 10 pins are available for reading the 8 columns of photocells.
See attached jpg for a schematic of the arrangement that I tested
I was trying to read the columns using rctime. Unfortunately, the readings from this arrangement were unstable (was rctime charging all of the caps?).
Thanks for your help!
Ken
I am building a set of interactive tables. We can call them the red and the yellow table. When you wave your hand over or place objects on the red table, red leds in it and in the yellow table light up as a visible shadow. The same is true with the yellow table. When you place an object on it or wave your hand over it yellow leds light up in it and in the red table. As a result, the tables carry a sort of telepresence relationship.
So, what I have is a basic stamp2 and what is really an 8 by 24 array. 8 rows by 8 columns of red leds, 8 columns of amber leds, and 8 columns of photocells. The basic stamp is driving 3 cascading 8 bit shift registers (3 pins), talking to a surelink rf module (3 pins), and reading the 8 columns of photocells (10 available pins).
thanks
Ken
I should offer this disclaimer first. I'm really more of a software guy than a hardware guy but I don't see how you're going to accomplish what you're trying to do with a shift register. Additionally it's a bit difficult to understand your set-up without seeing where the Stamp is in that circuit, and where the shift register you're talking about is fitting in. I presume the items on the right are the photocells?
Are you sure you didn't mean a multiplexer rather than a shift register?
A bit more information would be helpful.
Bruce
The same shift register that is row scanning the leds is also powering up the columns of photocells. So, now I need to figure out how to read the photocells in each column.
Does that make sense?
K
When you used the word "scanning" I was envisioning an input or reading operation, not a output or writing operation. I'll wait to say more until you re-vamp the schematic so the picture is more clear.
Where does the RCTIME operation you spoke of come into play here?
Bruce
The row driver that is high charges the single capacitor through the photocell, while the rows that are low have their photocells isolated by the diode.
LOW 0
RCTIME 0,0,mytime
LOW 0
I didn't understand the purpose of the transistors in your circuit.
There are a couple of problems with this though.
It will be hard to compensate for ambient light. Using RCTIME will give you some flexibility there, but the photocells would have to be pretty well matched. Otherwise it will be a mess of numbers.
The RCTIME scheme will be slow. RCTIME is single tasking, so you have to do one point at a time. Allowing 0.1 second per point, and 64 points in the array, that is 6.4 seconds per scan.
On the other hand, if you use a fixed threshold, you can query each row in parallel and do the whole scan in a small fraction of a second. But that leaves you with the problem of adjusting the threshold for ambient light. For that scheme, you'd be replacing the capacitor in the above diagram with a resistor for each column. Maybe you could make the resistor variable, a digital pot perhaps, and adjust it in firmware for ambient light.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
resistive cross talk to adjacent photo-cells. With this setup you can still use your 11 I/O's.... 8-I/O's would control the +5V or High
supply to the LED's and the "photo resistor-diode" leg. One 4051 would be used as providing the GND power to the LED's, while the
other 4051 would be used to supply the resistive photoresistor value to a single capacitor in an RC configuration to the stamp. Both
4051's would have their select lines (3 I/O's) tied together for stamp control. I can put together a schematic later if you wish.
Do the LED's and photoresistors need to be powered at the same time? In other words are the LED's driving the photoresistors?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe - Mask Designer III
National Semiconductor Corporation
Latest Company News
(Communication Interface Division)
500 Pinnacle Court, Suite 525
Mail Stop GA1
Norcross,GA 30071
Post Edited (Beau Schwabe) : 4/11/2005 6:58:50 PM GMT
The transistor was an attempt to isolate the photocells from the signal line because it looked as if they were acting in parallel and affecting each other during reads. The problem REALLY was that each cell needs its own diode (not just a diode per row) to keep the power from working its way from one row to the next (through the photocells further down the row).
The schematic below uses 3 8051B's and a total of 7 stamp pins. For size I only drew a 3x3 matrix,
but this circuit can handle an 8x8 and still only use 7 I/O pins
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe - Mask Designer III
National Semiconductor Corporation
Latest Company News
(Communication Interface Division)
500 Pinnacle Court, Suite 525
Mail Stop GA1
Norcross,GA 30071
Post Edited (Beau Schwabe) : 4/12/2005 1:16:58 AM GMT