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

  4. 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…

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

  6. @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.

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

  8. @ 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.

  9. @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.

  10. 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 :/

  11. 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!

  12. 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!

  13. 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.)

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.