Sound card microcontroller/PC communication

Diablo

New member
soundcard.jpg


The usual way send data from a microcontroller is either over RS-232 with MAX232 serial ICs, crystals, and a relatively ancient computer, or by bit-banging the USB protocol and worrying about driver issues. Not content with these solutions, [Scott] came up with sound card ?C/PC communication that doesn’t require any extra components.

[Scott] bought a cheap USB sound card dongle on eBay (although a built-in sound card will do) and wired up the tip and ring of the plug to the microcontroller. The data is sent from the microcontroller a lot like Morse code – a short gap between pulses is a zero, a long gap is a one. This is parsed by a Python script using PyAudio.*Synchronization, timing, and calibration is automatic because of a 10-bit ‘packet header’ explained in this video.



After he had a really great way of sending data from a microcontroller to a PC, [Scott] asked himself if it would be possible to have bidirectional communication. Using the same sound card setup, he managed to get bidirectional communication off an ATtiny44a. You can see his demo video of this here.

The cleverness of hack is overwhelming, and we’re kind of amazed that this technique isn’t in the standard repertoire of solder monkeys. After looking at this, we’re tempted to throw out the half-dozen USB/RS-232 adapters we have lying around. They never worked anyway. Check out [Scott]‘s highly informative video of his build below.

Filed under: Microcontrollers
b.gif



38T4x1ch1GI
 
Back
Top