Mixed laterality since 1968

29 Dec 2012, 18:45

Share

When Santa told me that he was getting an i-Racer remote controlled car for Fionn, I was very excited. This is a remote controlled car that, on the surface looks very crude. Heck it doesn’t even come with a remote control.

That’s because it’s Bluetooth-controlled! You can install a simple Android App, pair with the car and control it either with on-screen controls or using the accelerometer in the phone.

As a standalone present it is pretty neat but like all remote controlled toys, I’m sure would be discarded after a few days use. However Santa didn’t want to spend a fortune on a full-blown Arduino-based robot platform or an even bigger fortune on Lego Mindstorms.

It’s when you start thinking about what is possible over time with the i-Racer that things get really interesting. Forgetting electronics for a minute, you could have huge fun making new shells for it out of different materials. Imagine a Foldify template for it so you could make printed paper shells. Lego might be a bit heavy but K’Nex plus some Sugru could work very nicely. Or what about bamboo food skewers or ice-pop sticks? Maybe just some stickers.

Then there is the code running on the car. The source is available so you can play around with it. Now this isn’t the easiest thing in the world to do since the car is not Arduino so you need compilers and special programming dongles, but the option is there.

Taking that one step further, you could clip on other bits of electronics. I have a temp sensor, a PIR detector and an Ultrasonic distance detector all winging their way from China. You could use these to give the car a lot more “intelligence”. There is also someone working on porting the car’s code to Arduino since the microcontroller is compatible.

But that stuff is hard and more long term and wouldn’t actually involved Fionn doing much. Always have to keep your focus on the “customer”! So I thought about it some more and realised that you could have enormous fun with how you control the car. The use of Bluetooth gives you a giant range of pretty cough easy possibilities.

So I started playing with some Python code and after a ton of dead-ends, Linux bugs and system problems I was finally able to talk to the car from my Ubuntu PC with a $2 Bluetooth dongle. (Details below)

Then I realised that this would be no use over Christmas as we spend it travelling to family houses around the country without the Ubuntu PC. My Windows laptop should work with tweaks but that’s not for games! So I started looking at the Raspberry Pi. Whatever problems I had run into on my PC were 10x worse on the Pi. (More details below)

After a ton of messing I got keyboard control working the way I wanted over USB on the RPi. Which leads to the piece de resistance - MaKey MaKey control. MaKey MaKey is a beautifully simple idea. It’s an Arduino-compatible board you plug into a PC and it emulates various key-presses and mouse clicks. You then connect whatever you want, as long as it is vaguely conductive, and use that for input. It famously uses bananas, pencil drawings and buckets of water as inputs to various fun software.

The Cheese Controlled Car (CCC)

So Fionn finally had the ultimate car controller. 5 Pieces of Christmas Cheese connected to a Raspberry Pi via MaKey MaKey talking to a car over Bluetooth. Check it out in action:

httpv://www.youtube.com/watch?v=qb9wso0pB4o

If you want to try this yourself and run into any problems, pop a comment in below.

Otherpossibilitiesinclude grapes (GCC):

And Barbie (BCC):

Now for the nasty details. Whilst these steps are quite short and the code is very simple, it took a week of evenings cursing, hacking and googling to get everything working right.

Note that this is extremely simple control with fixed speed just to prove the idea works. Real code will go up on GitHub when it has much more usable controls with automatic acceleration/deceleration etc and after I make it configurable with any i-Racer and with the MaKey MaKey on any USB port.

What’s next?

Apart from extra sensors and new outer shells, I want to do more playing with controllers. I have an Arduino Joystick shield, Arduino Nano and serial Bluetooth breakout board coming from China. It’d be cool to make some sort of interesting custom controller case with the Arudino controlling the car. I may also get an Arduino Esplora.

The other really obvious one is to stick with the RPi and pair a Wiimote to it too. That could be the ultimate controller for the car.

One downside of the i-Racer is that Arexx, the Chinese manufacturers, have not released the source-code to their Android App, only to the car software itself. Given how trivially simple the control protocol is, it should be very easy for someone to create Open Source equivalents for Android and iOS or even WP8 or BB10. I’m currently poking around inside PhoneGap’s Bluetooth support (this plugin) to see if a simple cross-platform Mobile Hybrid App could be created.

If this is a success, with success being defined as Fionn remaining interested, then I’ll bite the bullet and start getting the parts for one of the good Arduino robot kits out there. A good intermediate step might be the Sparkfun Protosnap Minibot Kit. After that, the sky is the limit: