Tuesday, February 26, 2013

Gray scale LCD data transfer

The other day hackaday.com posted about Connor Taylor and others that uses a computer screen to transfer data to their micro controllers. I immediately thought, wow that is just so cool, no more cables for firmware updates. Just add a photo transistor to each project and you're done!
But the projects mentioned all suffer from the same problem: 60Hz refresh rate only gives you a few bits of data per second. Uploading just a few kb of data would take hours.
So after pondering this I thought why not use gray scale? The following is my proof of concept in the hope that someone will take it further and make it truly useful.

My goal would be to make a firmware update tool that can be used by any user on any computer. Ambitious, but either it works everywhere or another solution is needed.

 To test my idea i grabbed an old photo transistor from the parts bin and hooked it up to my multimeter that is set to read resistance. A quick Google search for gray scale turned up this image.

By holding the photo transistor to the screen I was able to get different readings for all the 19 fields on top. The darkest measured 533k, the second darkest 518k, somewhere in the middle 407k and the whitest one 57k. The transistor could be used in  a voltage divider  and then connected to an ADC.
Depending on the light sensor used some kind of logarithmic conversion might be necessary, preferably in hardware to maximize the usable range of the ADC.

Now this worked on my screen, but what about people with different brightness settings or white balance? It wouldn't be that hard to flash the whitest white and the blackest black for a few seconds before the data stream starts. Then the receiver can either set limits in software(cheap) or adjust some external offset/amplifier circuitry(more advanced) to get the most dynamic range.
To achieve data synchronization some kind of predefined flash pattern could be used to calibrate a timer on the receiver. The timer could then be continuously adjusted as data comes in. There should be enough variation to detect individual frames.

4bit nibbles shouldn't be any problem to transfer. Depending on the external circuitry 5 and 6 bits could also work. 8 would be ideal but might be hard to get to work accurately without to much external circuitry.

Someone mentioned using the back light for flashing data. Though harder to control and with fewer steps the possibly higher data rate might be more than worth it.

Google "gray scale 256 steps" for the real challenge.

Please take this and improve it, I would love to be able to drop the USB dongle on my next project!

No comments:

Post a Comment