Over the few months I have been using my lunchtimes to work on converting a Radio Controlled car to WIFI control so that it can be driven using a smartphone from a simple web interface. I wanted to experiment with using the Raspberry PI’s I2C interface and camera board, integrating an ADXL345 accelerometer in to a project and using ultrasonic “Ping” sensors.
I have designed a simple web interface served using node.js and some other modules. These include socket.io, I2C, ADXL345 and the express framework. The interface allows any device with a browser to connect the Cars WIFI access point and use dual thumb sticks to control the car. The Car transmits video, accelerometer and ultrasonic data back to the webpage.
Web Interface
To achieve this I used a Raspberry PI that communicates with an Arduino and accelerometer over I2C. The Arduino is used to control the servos using PWM, this could not be done with the PI alone as it only has one PWM output and the Car uses two servos, one for speed control and one for steering. I decided on the Arduino due to the huge amount of existing resources and library’s available. For example there is an Ultrasonic sensor library that uses to interrupts to avoid unnecessary polling of the sensors. The Arduino and breadboard are mounted onto the topside of my electronics plate and the Raspberry PI is mounted on the bottom side.
I have used a powered USB hub to power the Arduino and Raspberry PI, the power for this is provided by a rechargeable USB battery designed to charge up your phone when away from a mains power source.
RC Car Top
In future my plan is to implement some control algorithms to allow the car to navigate autonomously using the Ultrasonic Sensors and possibly even a GPS module.