Skip to content

Making an iPhone-controlled robot

February 19, 2014

We recently presented a list of commercially available robots that use your iPhone (or in some cases, Android) phone or iPod Touch as the robot brains.  This makes a lot of sense, given all the sensors, networking, input/output, and raw computing power you probably already have in your pocket.  But a good robot hobbyist is never satisfied with an off-the-shelf robot; how can you harness this power in your own projects?

The best way, if you can manage it, is one of the official interface cables from Redpark.  These are official (Apple-approved) serial adapters for the older 30-pin connector, or the Lightning connector on newer devices.  Among the 30-pin options are a TTL version, which gives you a 57.6 kbps logic-level serial connection you can easily interface with your other electronics.

If your device has the Lightning connector instead, you can still use this cable with one of the standard 30-pin-to-Lightning adapter dongles.  Redpark expected to have a Lightning version of the cable available “before the end of 2013,” but apparently are running a bit behind schedule.

The biggest drawback to this connector is that all the electronics are at the phone end, making a big, bulky brick that sticks out of your phone.  This limits your options when it comes to mounting the phone, especially if you want to use it as your robot’s face.  However, if you do get the 30-pin Redpark cable and a Lightning device, then this problem is neatly solved by selecting an adapter with a short cable, like this one.

The other problem, for robot use, is the meter-long cable on the Redpark device; that’s a lot of unnecessary weight and bulk for a robot to lug around.  However, in this case having all the electronics at the phone end is a good thing, since it makes shortening the 6-conductor cable a trivial hack.

So, apart from the Redpark cable, what other options are there?  Well, if feeling bold you could build it yourself, as shown here (click on the right-arrow on the image to get to the actual content).  Since on a robot you just want logic-level serial (rather than true RS-232), you can skip many of the steps shown.  This approach requires you to jailbreak your phone, and runs a higher risk of damaging it, but if you’re both brave and short on cash, it could be a viable option.

Another option is to connect to your phone via Bluetooth.  More specifically, Bluetooth Low Energy (BTLE), often called Bluetooth Smart by marketing types.  Unlike regular Bluetooth, which you can’t use from your apps unless you’re a registered Apple hardware developer, any software developer can use BTLE to talk to any BTLE device.  This connectBlue device might be just the thing for interfacing with your projects; connection speeds up to 115.2 kbps are claimed.  I’ve worked with BTLE in iOS, and it’s not like a serial port; it’s all very event-driven and based on very small packets without guaranteed delivery.  So it’s a bit of a pain in the neck, but it could work.

Finally, you could replicate the trick that several of the off-the-shelf robots use: communicate with your iPhone via the audio port.  This audio jack modem (which is better documented here) gives you about 1200 bps (yes, that’s baud, not kilobaud), and occasionally corrupts the data, but if you don’t need to move back and forth and you include some error checking in your protocol, it may do the trick.

And that’s about it.  There only a few reasonable ways to get data in and out of your iPhone to a nearby device: the sync connector, the Bluetooth radio, and the audio port.  Of these, the sync connector via the Redpark cable is probably the best bet in most cases.

But what do you think?  Have I missed any other good options?  If so, please share your thoughts in the comments below!


From → Reviews, Tips

  1. I just heard from the guys at Redpark; they’ve confirmed that a Lightning version of the logic-level serial adapter is still in the works, and that it will have a short cable (similar to their L2-DB9V product). So that should be pretty ideal when it comes out; till then, we’ll have to make do with the 30-pin version plus a short Lightning-to-30-pin adapter.

  2. DLC permalink

    There is always good ol’ internet WiFi for sending and getting UDP comms back and forth. Talking over the ‘net does not require additional Apple squeeze for the hardware access and allows you to use your iPhones processing power. Sadly, you still need to get the App Store to bless your project!

    That blessing alone is enough to drive the hobbyist to an Android using a Java app!


  3. You don’t need App Store blessing for a personal project — you can build right to your own device. It’s also easy enough to share with a handful of friends (this is how apps are tested before they’re released). If you want to distribute an app beyond a handful, though, then you’re right, you would need to put it in the App Store.

    WiFi is an interesting idea I hadn’t given much consideration, because I don’t know of a good way to speak to it from an embedded controller (on the robot side). But now that you mention it, I bet there’s a gadget for that!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: