Android Talks Pulsewave

Serial communications are a mainstay of digital computing. They don’t require much physical infrastructure and they exist in variations to fit almost any application. The behaviour of serial communications lines, varying from high to low voltage in a timed pattern, is analogous to a 1-bit DAC. Using a whole DAC for serial communication would be a waste in most cases, but the [RobotsEverywhere] team found an exception which you may have encountered already.

Since the audio output of the Android is accessible and addressable, [RobotsEverywhere] wrote source code to use the left and right channels as separate serial communication lines. This circumvents the need to bust into the device and muck about with the hardware which is great if you want a no-risk hack that allows communications to an RS232 port. Any hardware on which you can write to the DAC (and control the sampling rate) is a potential target.

There are some external electronics required to convert the audio signal to TTL, but it’s not very complicated–a couple of comparators and change. You can see it in action after the break.

As a bonus, when you’re done for the day you can plug in your headphones and listen to the soothing poetry of pulse waves all night long.

41 thoughts on “Android Talks Pulsewave

  1. I’d like to see this take a step back to the 80s next, with that audio recorded onto cassette tapes…

    I’ve started myself wishing that I still had my old Amstrad CPC to play Head Over Heels on, even if it did take forever to load.

  2. I’m pretty sure its common practise to use an op-amp without feedback as a comparator, its just a differential amplifier with very high gain, so any difference between the inputs pegs the output to one supply or the other (if its a rail-to-rail output op-amp).

  3. Wow horribly designed circuit. Example of a N00b that knows nothing about op amps using them wrong.

    Please get a feedback resistor in there.

  4. Spiritplumber from Robots Everywhere here. I have a degree in electrical engineering. Not using a feedback resistor is actually what lets you have a rise/fall time that is fast enough to make some finicky serial inputs accept the signal at all, at least when using a LM324, which isn’t a great op-amp to start with.

  5. smoker_dave >> the Op-Amps are used as comparators here, no feedback necessary (or even recommended). The whole point is to have them saturate as fast as possible.

  6. Why is it that some people are trying to be all-knowing of somebody’s design?

    Giving comments like that without proving something by themselves hah…

    Great design by the way and a lot of possibilities…

  7. There are comparator chips designed specifically to work in open-loop mode, such as the LM339. LM324′s running as comparators are painfully slow.

    1. Hi there – great video. Where can I find schematics + source code? I would like to do something similar with Windows Phone.

      Thanks!

  8. Would like to see a port to iOS!

    I wonder if the mic-in can be used as a serial input, too. with some software processing on the input signal (software-comparator..) that should be possible?

  9. I’m working on serial input — it’s doable, and right now I have it running at 9600bps, but it requires the phone to do nothing else in the meantime (so everything freezes, etc. it will not even ring if there’s a call). That’s not really real-world usable, so I’ll keep messing with it for a while before I release anything :)

    Agreed on the 324 not being very good as a comparator. However, it’s easy to find (Radio Shack still has them in their parts bins). If you look at my other schematic I try to prioritize part availability over efficiency, unless it’s something I am selling prebuilt.

  10. He also did it way before me albeit at lower baudrate. Mike, am I crediting you visibly enough in the app?

    Again, the choiche of a LM324 was simply due to the fact that it’s possible to go out and buy one without having to order it.

  11. @spiritplumber
    Well, looks like I’ll go port your sources to plain C ASAP. I have an old HP VectraPC (i486DX2@66Mhz+8mb ram) running linux from 4GB CF card, stuffed with 2 LPT ports, 4 RS232, 10mbit network card, and I still have 2 ISA slots free. This may add some more TTL level uarts there definetely, since I have several ISA sound cards lying around. Really looking forward for your input handling code. Thanks.

  12. This doesn’t really modulate anything (other than to fool the phone’s DAC into behaving). I am working on a version that does modulate a standard Hayes 300bps signal to be used with packet radio, though.

  13. That’s really amusing. I’d look at old tarbell tape interfaces before I tried anything like this, too. Hahahah.

    Spiritplumber: you should be able to find an LM339 anywhere (Radio Schack) you can find an LM324 for sale retail. A tiny bit of feedback to create hysteresis is good idea in general in comparator circuits to prevent “motorboat” oscillations but you probably won’t have any trouble in this specific application since I assume you’re just cleaning up and level-translating a square wave?

    Necromant: you can probably get all kinds of wild ISA multi-port RS232 cards, digital I/O cards, data acquisition cards, etc on ebay for less money and hassle that it would take to try and rig sound cards as general purpose I/O.

  14. @ spiritplumber

    Yep, I’ve already hooked those and have a full-blown software stack running in it, supporting most of the hardware. And still 3.5mb memory free. The PC is headless with klone for the web-based ui and some wrapper scripts on my main pc) (eg. remote-avrdude)
    However there’s a real shortage in uarts, since the existing ones are already used for several programmers, DIY lab power supply, and etc.
    And I’m too lazy to reconnect that, when I need something else. Since old sound cards acually have a plenty of outputs and inputs that can be selected. (CD-IN, AUX-IN, etc) this can really extend the interfaces of this unit.

  15. @Brent I have a sh*tload of ‘em around, I got them for free several years ago. If you live somewhere near Moscow/Russia – I can even share some.
    It’s just the pc that doesn’t work with more than 2 LPT ports (1 internal and 1 on the expansion card) and 4 RS232 (2 internal + 2 external). I can use jumpers to configure LPTs as LPT1, LPT2, LPT3 and BIOS even thinks that’s OK, but just linux doesn’t see one of the ports then and I cannot actually use it, so that looks like the max.
    I’ll do more testing, this hack is still work in progress… May be I’ll even take some photos and send ‘em to HaD someday.

  16. Hey let’s send serial data over lines designed to carry audio. We could even modulate it in such a way as to provide error recovery by using coding techniques…
    …I bet this has never been done before :/

  17. Wonder if the opto-coupler approach could be used with an analog phone line to do DTMF…? (Need the mic in as well of course). “Ana-droid-a-log” phone anyone? :)

  18. I love the idea of dtmf exceptI I can’t find a good source of decoder chips and am unwilling to write the dtmf decoding code on an arduino (I’m lazy).

    when the code is so simple why not use the builtin uart system, its got buffers and everything you need!

  19. thanks a lot hackaday for posting this article and even a bigger thank to robotseverywhere. i tried to build and program the connection to arduino over sound by myself but gave it up. now i can use this easy solution. thanks a lot!

  20. So, could you use something like this, paired with an appropriate circuit on a line in or microphone in to talk to something like a 1-wire bus?

    (Specifically thinking of an XO-1, which is lacking in things like I/O ports. Thought it might be interesting if a simple circuit and some software would let you set it up to talk to sensors.
    Make a nice little data logger/display.)

  21. Sorry,no PCB for noobs?

    -Fascinating the idea of programing devices without a pc…

    -Simply Amazing…Thanks robotseverywhere

  22. This works differently than what flakelabs did — a lot fewer parts for one. You can get the serial port demo app on android market by searching “serial out”, it’ll be in the first five results.

  23. @spiritplumber
    Great and cheap solution.
    I am just new with electronics and need help.
    S you are saying that only this circuit that you have given in the link below can be used with some device .
    like i want to use it with arduino UNO.
    Please reply i really need this

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