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.

Comments

  1. svofski says:

    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. Anonymous says:

    Homebrew ROB the Robot, anyone?

  3. Simon says:

    My bank uses something very much like this to talk to the TAN generator. As of now it’s pretty wide spread in germany and has a lot of advantages, total portability for example.

    See it at ~45seconds in this video:

    Cheers

  4. Jerry says:

    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.

  5. matt says:

    Not entirely related, but you could also hook the uC to the DDC lines on the VGA or DVI bus, its I2C.

    http://en.wikipedia.org/wiki/Display_Data_Channel

  6. Gary says:

    Now I wonder how quickly the NUM/CAPS/SCROLL LOCK LEDs could be flashed on a keyboard in order to send data.

  7. malikai says:

    I miss my DataLink. Ah, nostalgia.

  8. Stefan says:

    My guess is that the browser renderer is having a hard time keeping up. Try something more low-level like a fullscreen native application.

  9. The Geekiest Guy says:

    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.

  10. The Geekiest Guy says:

    Parallax has a light to frequency convertor (8 pin DIP) I’ve used that was pretty damn reliable, could probably find an equivalent part on the cheap too…

  11. Andreas says:

    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…

  12. Neoxy says:

    This could be used to decode hidden messages in flashing GIF images… Anyone thought of that?

  13. leprosexy says:

    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.

  14. Stevo says:

    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

    • The Geekiest Guy says:

      I just came back to post that very point, checking to make sure that the cell is hitting its threshold is the next logical step if you haven’t checked. Good call…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,528 other followers