Propeller-Android Communications Using Debug Mode

Here’s a new way to connect an Android phone and a Propeller microcontroller. It’s called the PropBridge and uses a very simple circuit with a voltage regulator, a couple of transistors, and a few resistors. The trick to this method lies in creative use of software features that already exist on Android hardware, the Android Debug Bridge (ADB). The ADB was added with development in mind, but since it provides low-level control of certain parts of these devices it was just waiting to be incorporated into a hack.

The Propeller itself uses firmware to make Android think it is one of two different externally connected hardware devices. It can act like a PC running the ADB client or it can mimic a TCP connection. There’s still plenty of room on the uC to add your own firmware, and the majority of the I/O pins are unneeded for the basic connection. Check out the video after the break for a quick overview of the system.

If you need a little help with Android programming before you’re able to use this in your own projects, check out our Android development series.

[youtube=http://www.youtube.com/watch?v=QcR0ZG_7YC8&w=470]

17 thoughts on “Propeller-Android Communications Using Debug Mode

  1. im not a big fan of Propeller but its nice!

    i did work with communicating via bluetooth with an arduino to control a coffee maker … ill throw it up on the forums when i get time

  2. I saw this on their forums, it looks like a great way to maybe integrate one of those cheap knock off tablets with a touch screen to a microcontroller.

    I just happen to have both of these lying around!

    Thanks

  3. Note that the transistors on the schematic are just for the programming cable, the only hardware needed that doesn’t usually come with a proto board are the USB connector and the four resistors! Also, you need a 6Mhz crystal (usually propeller boards ship with 5).

  4. >>The ADB was added with development in mind,

    Um.. it’s been there since the start. Debugging stuff is generally part of any decent development environment..

    >>but since it provides low-level control

    Um, I don’t think it does.. unless you have a rooted phone, then you have control of stuff via the normal kernel interfaces. ADB itself is just a bridge.

    >>of certain parts of these devices
    >>it was just waiting to be incorporated
    >>into a hack.

    You could have used bluetooth.. there’s nothing special that ADB has access to that you don’t have access to from Dalvik or native code.

  5. Actually one pretty powerful thing is that even on nonrooted phones, an adb shell has permission to reboot the phone via commandline — that allows the microcontroller to watchdog the phone.

    Also, ADB uses less power than bluetooth and has less latency (and doesn’t have to share spectrum with wifi, so you can actually use all your wifi bandwidth).

  6. Finally, ADB will work on anything that has android on it. Bluetooth wasn’t really in the API until 2.2 and there’s still a lot of 1.x phones out there, plus it needs the hardware. This lets you use bluetooth for something else ;)

  7. @cantido: USB is much more reliable than BT and cheaper too in most cases. Spiritplumber used a propeller, but there are many cheap USB host enabled dev boards out there (micropendous, vinculo, fez domino, etc.) that can interface with an Android device using this protocol.

    For robotics, it’s also nice that you can provide VBUS from the main power supply (i.e. an ESC) and power the phone from it.

  8. ps: this is a port of MicroBridge (code.google.com/p/microbridge) to the Propeller chip. MicroBridge uses an Arduino in combination with Oleg Masurov’s USB host shield (sparkfun sells these for $25). So if you already have an Arduino and just want to play around with Androidmcu connectivity, you can always go that route.

    Note that MicroBridge is C code though, no Wiring language crap :)

  9. @spiritplumber: btw, please don’t claim this as your work. You ported my code without giving proper credits and without stating that a) this is a port of another project, b) providing people with a link to said project.

    Please give people credit for their work. Saying “this guy did it first” is not the same as saying “I took this guy’s source and ported it to another platform”.

    Before MicroBridge there was no easy way to connect Android devices to microcontrollers, I put quite a bit of work into getting the ADB protocol to work correctly and all I ask is a little recognition for that.

  10. I’m not going to get into an argument about this. I understand where you’re coming from re: attribution (I’m usually on the other end of the problem), just tell me what you want the wiki to say and I’ll gladly put that there. That said if you look at the code, I had to take a different direction than microbridge. If you still feel my work derives from yours you’re welcome to feel that way and I will acommodate you, just please tell me what you want the wiki to say.

  11. @Inopia: Gees, get over yourself man! The ADB protocol is an open protocol from Google, @spiritplumber has just made that usable on a Propeller. I’m sure you did spend a lot of time making it work on an Arduino – well done – but the Propeller code doesn’t seem to follow your code to any great degree, so – to my mind – there’s been no copying here.

    @spiritplumber: Well done man, and thanks for giving us Propeller folks a wired Android link.

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.