Sunday, September 11, 2011

Monitor-Circuit Interface

For a project, I needed a cheap, simple way to interface a circuit to my computer. The premise was a simple setup for a team-based control-point game. The idea was that code on a laptop computer would be used to keep track of king of the hill style 'control points', connecting to a display box which would illuminate different colors depending on which team currently controlled the point. Each point would have a laptop, and they would communicate with each other over the network to determine whether a team controlled all points and send out victory music if that occurred.

USB control would be ideal, but went against the 'keep it simple' idea behind the original circuit. Searching online for alternate control ideas turned up no useful information - most laptops do not have serial ports, and this would tend to use a micro controller anyway. The novel solution I came up with was to use photo-transistors to interface a simple circuit with a segment of the monitor on which the code would display a series of black and white boxes, with each box representing one bit of data. The circuitry would use this data to control different colored LEDs in the display box, thus indicating which team was currently in control of the area. Because of the simple nature of this setup, a box for each laptop could be made quickly and at little out of pocket cost.




I used Perl/TK to make a simple GUI which would display boxes whose states were controllable via the mouse; the final setup would be part of the overall communications/state-tracking program which was running on each laptop. Below is a sample image of the proof-of-concept test program running on the computer, as well as a brief video showing it in action.



No comments:

Post a Comment