linear1 forums
[part of the linear1 network]
+ [linear1 case mods]
+ [LED Center]
+ [privacy policy]
Welcome, Guest. Please login or register.
March 20, 2010, 05:59:02 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Login Register

linear1 forums  |  LED discussion  |  LED questions and discussion  |  Topic: LED Arrays as Sensors « previous next »
Pages: [1] Print
Author Topic: LED Arrays as Sensors  (Read 3736 times)
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« on: November 16, 2005, 05:28:54 PM »

As part of my continuing effort to develop LED sensor technology, I've been trying to tackle the problem of expansion... My original brute-force method was an army of PIC microcontrollers, discretely controlling individual LEDs.  While this method worked and was rather simple from a hardware stand-point, there were several drawbacks.  The most ADC ports I was able to use was ten... there are microcontrollers with more than this, however they have certain drawbacks that make them unsuitable for my application.  Knowing the limit of 10 leds per slave, to build an array of a useful size, say 3x10, would require three slave microcontrollers.  Although not enormously expensive, each mcu costs at minimum $3, which adds up quickly.

The method I am currently exploring involves linear logic chips, specificly the 74HCT595N 8 bit serial load latching shift register.  Here is the idea, and I'll throw up a schematic shortly.  The cost of a 595 for hobby purposes is roughly 75 cents.  Even a modest quanity of 20-25 shifts that price down below 50 cents a piece.  Far better than the cost of individual microcontrollers.

The 595 is used to source current, driving the anode axis of the array (column).   I fill the register with 1's, which sets each output as a current source.   While filling with 1's, I clear the bit for the column which contains the LED I want to sample.   The 595 holds this state indeffinately, until it is changed by the microcontroller.   The microcontroller, which is directly interfacing the cathode axis of the array (rows), then samples each LED in that column by applying a reverse bias charge and then switching to a high-z input for the A2D reading for each row.  This is done one bit at a time (each bit equals a row), so neighboring rows are left "on" at are lit, allowing a good amount of light to be reflected into the led currently being read.

This new arrangement allows a single microcontroller to handle a matrix of 'unlimited' columns by ten rows (each row needs to be connected directly to the microcontrollers unique tri-state IO port).  A 160 pixel array of 16 columns by 10 rows needs only one microcontroller and two shift registers.  Of course, the actual size of the array will be determined by how fast the PIC can scan through the columns, since one column is always 'dark' to allow for the reverse bias and read operations.  Currently my microcontroller can scan my 3x3 array at a rate of 27kHz, which gives me a WIDE margin, since anything over 70 hz is practically impreceivable.

Here is where I need help -->
There are some flaws I need to sort out, mainly power related.  The 595 can source 35mA and sink 75mA.   35mA is fine for a 3x3 array, but it won't cut it for anything much larger.  I need to find a way to increase the current handling abilities of each port, without a huge component count or complexity.  If I build an array with 10 rows, each column needs to source 200 mA of current.  But it also needs to retain the ability to sink a small amount of current.  I figure I can solve this with a pair of transistors, one small npn for sinking, one larger pnp for sourcing.

Secondly, my microcontroller can source 25mA of current which is more than enough to reverse bias an led quickly, but it can only sink 35mA of current.   So, when sinking a row that may be 16 or more columns long (at 20mA per led), some serious power handling capacity comes into play here.  A simple TO92 mosfet can sink an amp of current without breaking a sweat, but I also need the ability to source current and the ability to go "high-z" to allow the microcontrollers internal circuitry to do the A2D sampling.

I'll get a schematic up a bit later, but I think I'm close to lickin this issie

More to come.
Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #1 on: November 16, 2005, 11:54:00 PM »

Here is the schematic, basicly the setup I have on the breadboard.


Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #2 on: November 17, 2005, 11:26:31 AM »

If I build an array with 10 rows, each column needs to source 200 mA (10 @ 20mA leds per column) of current.  But it also needs to retain the ability to sink a small amount of current.  I figure I can solve this with a pair of transistors, one small npn for sinking, one larger pnp for sourcing.

It occured to me while sleeping, a transistor inverts the signal ... an NPN transistor takes a HIGH signal to go LOW, and an PNP takes a LOW signal to go HIGH ... so I need yet another component, another transistor or one of those compound ICs that contains many inverters... and then, I came up with these ideas.

I'm hoping the anode column driver will work ... the catch is it requires a P Channel mosfet, which I don't have at the moment, so as soon as I get some I'll test it ... unless anyone can point out that it flat-out won't work, save me the trouble Smiley ... UPDATE:  I posted on a more electrical engineering orientated forum, and it was quickly pointed out that the P-Chan mosfet, like the PNP transistor, conducts when the gate low, not high, so this idea is a dud!



-----

I'm pretty sure this will work for providing increased sink current on my row drivers, however, it is not viable because it blocks the PIC from sensing the voltage stored in the led (no input mode support).


« Last Edit: November 18, 2005, 03:15:50 PM by justDIY » Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #3 on: November 18, 2005, 03:23:19 PM »

Anode Column Driver

Basicly this is just a 'heavy duty' version of the output stage inside the IC (except they use mosfets instead of standard transistors).  I found some nice and tiny transistors with 1+ amp of current capacity, yet smaller than an LED - they shouldn't have any trouble driving a large column... it's more parts than I care to deal with, and I'll have to invert the logic in the register, so a 0 = source and 1 = sink... not to mention 16 transistors per 8 columns = a LOT of extra work and expense.

I'm beginning to think discretely controlled LEDs and a large number of microcontrollers may actually be the best solution.
Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #4 on: November 22, 2005, 01:13:23 AM »

darn-it!

I thought I was close with this one ... using a 'push pull' setup for the anode columns, and a mosfet drain for the cathode rows, I had solved all my current problems, except one...

Lets say you have 8 columns, and 8 rows.

you want to sample the led at column 2, row 2... so I reverse bias that led, by setting row 2 = source and column 2 = sink ... the first problem is obvious right there... changing the polarity of that row and column effects 16 leds, one entire row, one entire column.  ok, well that isn't that big of a problem, there are still plenty of LEDs on to provide light for the sensor to see (via reflection)

now for the biggie ... columns 1, 3-8 are all still "on" or sourcing current.  that means when I do a high-z reading of row 2, the voltage potential will read as a constant 3v (5v supply - 2vF).  setting the other columns to an off state will have two consequences ... the first being there will be no light to reflect into the sensor led, and the second being all those junctions on the row will still retain some residual charge, effecting the reading.   the only way I can see doing it is to set the columns to a high-z state, so the junctions attached to the row I'm sampling cannot conduct, and I'll only get the charge that is stored in the led I'm targeting.   I would have to time this so the non-selected columns went 'dead' after I had already reverse biased the sensor led and allowed some time to pass for it to discharge based on the reflected light.  thing is, I have no idea how to do this with discrete components...

tomorrow is another day, and I'll draw up a schematic for a board with a 6x5 array... with 30 pixels, I'll need three of my ten channel slaves, but at least it'll be a simple pcb and hopefully something I can bang out over the 4 day weekend I have coming up... I need to get back to the development side of this project ... all this research in scalability is wearing thin on my patience.

btw, here is 4 hrs of wasted time: (at least I'm gettin really good with Eagle)


click for super-sized version 59kB
Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
SurJector
Smart like tractor
***
Offline Offline

Posts: 107


« Reply #5 on: December 13, 2005, 11:44:13 AM »

A random idea for you: I assume Vcc=5V constant on the whole board. You can drive the cathode of all the LEDs at a constant 2.5V potential, that way to switch between charge and sink is a simple switch from 0V to 5V. It does not solve your row/column problem, but it does simplify the circuit: you only need 1 pin/LED.
Logged
Pages: [1] Print 
linear1 forums  |  LED discussion  |  LED questions and discussion  |  Topic: LED Arrays as Sensors « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.258 seconds with 20 queries.