Microcontroller Comm With A Computer Monitor

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.

[youtube=http://www.youtube.com/watch?v=NGbpC91oZJ4&w=470]

16 thoughts on “Microcontroller Comm With A Computer Monitor

  1. 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.

  2. My guess would be that the CDS cell (LDR) is too slow to catch the needed edges. I’d try with a phototransistor per the first post, or maybe even a solar cell as a sensor. These react much more quickly to changes in light levels than a CDS cell.

    Cool project, though. Good luck.

  3. Maybe try sampling with a harmonic of 60Hz, or whatever frequency your power lines are, I had a similar problem with something a project and ended up using a harmonic of 60Hz because my controllers PWM interface ended up picking up RF interference.
    Just a thought, good luck.

  4. Browser rendering!!! definitely!! I am working in a company, developing those codes for online-banking applications. Our stuff is completely JS driven and is about the size seen in the video.
    if you resize this code generating thing to large, the browser rendering engine cant get it. you definitely should try just flashing a little area!!

    maybe thats not the solution, but it keeps you from running into another source of error…

    with smaller sizes its possible to send multiple data flashes at once, like seen in the video at 0:55

    this is even slightly slower than it could be…
    But using the resize function, or trying that on a netbook (like my asus eee901) realy sucks…

  5. Back when I was a kid I had this tiny little rinky-dink monotone LCD touchscreen PDA about the size of two books of matches side by side (if the device was on its side, in terms of physical dimensions). Although it was pretty lame and didn’t have much functionality, you could run software on your home PC that could download games and programs, and then hold this little device up to the screen and it would download the data and compile it into a running program.
    Almost all of the time unless my arm got tired holding the damn thing up to the screen, (when I was binge downloading apps and games) it would transfer completely. I can’t say I know how much data was being passed and how much was redundant, but it worked on a laptop screen that was running a max of 60Hz refresh rate.

    Also, Neoxy, awesome idea but you’d need to coordinate your color scheme well in the gif and have a well defined tolerance for accepting certain colors as a signal or just fluff.

  6. Dude hook up 4 – 8 of them and flash sections of the screen then you can send one char at a time! Much faster data rate.
    Also have you hooked a scope up to the CDS cell to see if it interprets the flashing cleanly? Maybe its not hitting the Vih threashold of the micro sometimes

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.