Android + IOIO + Range Finder
Ultrasonic and Infrared distance detection with Android and IOIO. This article will demonstrate a basic proximity and ranging accessory for Android over USB (or Bluetooth).
For additional background information on interfacing Android with IOIO, check out my other introductory tutorials:
Background on Android development, IOIO, and electronics:
- Android Device (1.6+, 2.1 for Bluetooth)
- IOIO (available at Sparkfun)
- Ultrasonic Range Finder – Maxbotix LV-EZ1 (available at Sparkfun)
- Infrared Proximity Sensor – Sharp GP2Y0A21YK (available at Sparkfun)
- Power supply
- Hook-up wire
Connect the red, power lines of the sensors to +3.3v, the black ground line to GND, and the yellow signal lines to the desired desired analog input pin on the IOIO. The example uses pins 34 and 35, but can be used with other pins that support analog input (pins 31 – 46 on the IOIO). Here is a diagram of the completed circuit (created with Fritzing):
Get the source
git clone git://github.com/mitchtech/android_ioio_range_finder.git
If you are building from source, you will also need to import the IOIO Library project, and optionally the IOIO Bluetooth library projects, both available here:
git clone git://github.com/ytai/ioio.git
Install, connect, profit!
Finally, upload the app to the Android device (or browse to this page on the device and download the apk above). Connect the device to the IOIO, and start up the app.