Microcontroller comm with a computer monitor
posted Dec 22nd 2011 10:01am by Brian Benchofffiled under: Microcontrollers
Prolific Hack a Day author [Mike S] has been playing in his lab again and he’s come up with a neat way to talk to microcontrollers with an LCD monitor. The basic idea behind [Mike]‘s work isn’t much different from the weird and/or cool Timex Datalink watch from the 1990s.
Despite the fancy dev board, the hardware is very simple – a photoresistor is pointed at a computer monitor and reads bits using Manchester encoding. The computer flashes a series of black and white screens thanks to a simple Javascript/HTML page, and data is (mostly) transmitted to the micro. [Mike] says he has about a failed message about 60% of the time, and he’s not quite sure where the problem is. He’s looking into another kind of Manchester encoding that uses samples instead of edges, so we hope everything works out for him.
This build is very similar – and was inspired by – an earlier post about microcontroller communication with flashing lights. Still, [Mike]‘s build reminds us of the strangely futuristic Ironman watch we had in ’97. Check out [Mike]‘s demo of his computer/micro comm link after the break and his code on github.







A few suggestions:
- start sending with a sync sequence of known chars that would permit the micro to tune the timers/counters to sender’s frequency
- use FSK like in old computers: basically it translates to short pulse/long pulse; there’s almost no way to lose sync this way
- use start/stop bits
- use a photodiode/comparator with hysteresis instead of a photoresistor
As for JavaScript in browser reliability, I’d say it should be pretty good up to some point. Maybe it’s a good idea to flash a smaller square instead of the entire page background.