Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I built a Raspberry Pi/Android driven toy car
64 points by doctoboggan on Dec 9, 2012 | hide | past | favorite | 22 comments
I am not sure if this is fits the HN community, but I am posting it here if people are interested.

This is the current iteration of the car: http://i.imgur.com/ko8YBh.jpg

Details:

I wrote a simple android app that streams the accelerometer data from the phone to the pi over a simple socket. The pi then uses this data to drive the DC motor and the servo motor. Tilting the phone to control the car feels very natural.

In this[0] pic you can see the wifi dongle I've used. I am using Adafruit Occidental v0.2[1] as my OS because it has support for my wifi dongle. It also makes some hardware interaction easier and comes pre-installed with some good python libraries.

Here[2] is a picture of the breadboard. I am using the L293DNE[3] hbridge chip for DC motor control. The two black wires you see coming off the board connect to the motor.

In this[4] pic is the battery pack I am using to power the pi. I purchased it on amazon here[5]. Here is a pic[6] of the battery pack I am using for the DC motor.

Here[7] is a closeup of the steering servo. It is an HS-55[8] and I power it directly from the pi's 5v rail. To control it I use the servoblaster kernal module[9].

My next plans are to add some sensors and make it autonomous. Let me know what you think.

[0] http://i.imgur.com/w0PIk.jpg

[1] http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2

[2] http://i.imgur.com/hhogr.jpg

[3] http://www.mouser.com/ProductDetail/Texas-Instruments/L293DNE/?qs=sGAEpiMZZMtYFXwiBRPs0wSafWlCmJbc

[4] http://i.imgur.com/3t6NG.jpg

[5] http://www.amazon.com/PowerGen-External-Blackberry-Sensation-Thunderbolt/dp/B005VBNYDS

[6] http://i.imgur.com/zpgyj.jpg

[7] http://i.imgur.com/b8Qnc.jpg

[8] http://www.servocity.com/html/hs-55_sub-micro.html

[9] https://github.com/richardghirst/PiBits




Fascinating project. This is definitely HN-worthy.


Agreed, this is really cool. Can you post a video that shows you driving it while tilting your phone?


I just had my roommate film me controlling it. Here is the video: https://www.youtube.com/watch?v=tfuv-B1X3ck


That is really cool! Seems to me you're close to having a product you could sell. Nice work!


I'm actually on the brink of getting into amateur robotics... I just bought "Robotic Explorations: Hands on Introduction to Engineering" (http://www.amazon.com/Robotic-Explorations-Hands-On-Introduc...), and am planning on getting a HandyBoard kit.

I was wondering if there are any K'Nex or LEGO Technic kits that are particularly well-suited for this type of endeavor? I have found plenty of kits to build a wide variety of vehicles, but it's hard to anticipate what will comprise a good assortment of build pieces for a more free-flow introductory robotics project.

Any thoughts or advice on this subject would be greatly appreciated!

Thanks in advance.

EDIT: Awesome project, by the way :)


The hardest problem on the mechanical side was connecting the motor to wheels. You will often need to gear down a motor before you connect it to the wheels. Without the ability to custom manufacture parts it is very difficult to cobble something together. The simplest solution is to buy a motor with a prebuilt gearbox, axel, and wheel. I don't remember where I got mine but something like this should work: http://www.amazon.com/KNex-Dragster-Racecar-Rally-Series/dp/...


Thank you for the tip! I was actually just reading about gearing in an article called "The Art of LEGO Design" (http://cheme.eng.wayne.edu/neuron/LEGO_ROBOTICS/artoflego_ar...)!

Was also looking at Technic kits (such as http://shop.lego.com/en-US/Tractor-9393) with a preference towards those with more pieces, and thus more flexibility.


That paper is great, thanks for sharing! It looks like I need to buy some lego technique parts.


Checkout the gearboxes from Tamiya.


Brilliant project. Thanks for sharing. You should send this to the people at raspberrypi.org and/or adafruit.com as I'm sure they would feature it. I'm going to reblog it at www.recantha.co.uk and put all the images inline to make it easier to read. Nice one!



Great project! I'm really curious about robotics/automation stuff and this is one of that awesome projects that show how it's really unlimited what you can do in that area


I've been thinking about doing something similar with an air swimmer, but mounting the pi on the actual swimmer would weigh it down too much to fly. Instead I was hoping to break open the RC unit and trigger the signals via the GPIO pins or something. I don't know much about electronics so it's a pipe dream, any ideas how feasible this is?


I would have to see the remote controller before I can say for sure but that seems feasible.

Most often joysticks in controllers use potentiometers (variable resistors). You can simulate the effect of a potentiometer using PWM, or you can buy a digital to analog converter.


Just saw the video it's awesome idea to control bot by accelerometer.


Hi, very interesting project! Could you tell me how you have connected the phone to the raspberry and shared the accelerometer data? Thank you very much


I implemented a socket server in python on the raspi. I wrote a very simple android app that opened a connection to the pi and continuously streamed the x, y, and z coordinates.

You can see all the raspi code here: https://github.com/jminardi/RobotBrain And the android code here: https://github.com/jminardi/RobotBrain-Controller


Has anyone had success driving motors directly from an Android device?


I'm doing this with Arduino. We should talk.


Definitely, my contact info is in my profile. I found my biggest pain point was real time control, specifically for the servo. The arduino is a much better real time controller, but you lose the modern OS.


Well, you can always use Arduino for the main control loop and use Pi on top of that for telemetry and other things. This is probably the approach I'm going to use in my quadcopter... A non real time OS just won't cut it for a UAV.


Awesome ...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: