How to Make a Arduino+Raspberry Pi Robot Platform
Intro: How to Make a Arduino+Raspberry Pi Robot Platform
UPDATE: Lets Make Robots, my home digital hackerspace, was purchased by RobotShop. I don't want to go into, but the new owners banned myself and most of the veteran members. That stated, most of the links there will be broken. Luckily, I was able to make a copy of my content (the reason they banned me) and moved it to a Github site--it was a hurried move, so the content maybe a little rough right now.
This is not the definitive story on Pi and Arduino orchestration. Just my version.
STEP 1: Berryboot
STEP 2: SD Card Preperation
STEP 3: Berryboot
2. Setup RPi with Raspbian Wheezy (first option).
STEP 4: WiFi Dongle
If you have difficulty with manual WiFi dongle setup, you might try this video.
Lastly, if you are looking for a WiFi dongle for cheap, with good range, and uses very little mAhs (the Pi can only feed about 700mAhs through the USB port). You might try this one, $6.17.
STEP 5: SSH
You have to plug in your Pi's network number. You can find this by pulling up your wireless hub's configuration page. You should see what address your Pi is listed at. For some strange reason, if it doesn't list the device name, just view the page while the Pi is up, then unplug your Pi and refresh the wireless hub configuration page. The device that disappeared is your Pi. I've never had to change the port number, but beware you might need to depending on your setup.
STEP 6: SSH
If you want to know whether your have the correct information, try login' in and if you get a screen like this, your good.
Your username and password are by default: pi, raspberry
Remember! In the case of a Raspberry Pi, always share your password, 'cause everyone has it anyway :)
STEP 7: SSH
STEP 8: VNC
6. Setup a VNC Client on your Desktop Computer. Real VNC. There are many different programs, I happened to end up using Real VNC.
Once you have VNC setup on both machines, PuTTY into your Pi and start the VNC server.
$sudo vncserver
STEP 9:
You should end up with at a windowed version of your Raspberry Pi desktop. One more note, somewhere in the video it gets you to setup the "geometry" of the VNC desktop. The limitations you put there will be reflected in the quality of the desktop you see in the window. In essence, if you put in 640x480, that's the resolution this desktop will end up. So, please, take advantage of the Pi's GPU :)
Use something like this, "-geometry 1024x728 -depth 24"
STEP 10: SD Card Resize
STEP 11: GIT
Install the git manager:
At Raspberry Pi prompt: $sudo apt-get install git
The way to use it is like so,
At Raspberry Pi prompt: $sudo git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
STEP 12: SMBus
At Raspberry Pi prompt: $sudo apt-get install python-smbus
STEP 13: Useful Robot Packages
Useful for keystroke, GUI, and other interfacing needs:
Pygame (should come with Raspbian). (sudo apt-get install pygame)
Lady Ada's Python codes for an array of I2C sensors:
Adafruit I2C library (git)
Access your Raspberry Pi from iDevice web based GUI:
PiUi (git)
Control serial devices:
pySerial (sudo apt-get install python3-serial)
STEP 14: Arduino IDE on Pi
STEP 15: WinSCP
STEP 16: Make an I2c Optoisolator
STEP 17: I2c Between Pi and Arduino
Once you have the board setup, you can run:
$sudo i2cdetect -y -a 1
This should bring up a list of active I2C registers. You should find your Arduino at whatever address you set in your Arduino code.
STEP 18: I2c
STEP 19: Tie It Up
So in theory, you can skip the optoisolator all together. But that's you, I'll stick with my optoisolation.
15. Download my code--or someone cooler's.
UPDATE: 8-12-13: User Buckleybw has let me know the code I put together is unstable. It'll run for 7-8 minutes before giving an error on Pi (Python) side. Poor guy had to troubleshoot it; this has been confirmed by another builder. As soon as time permits I'll troubleshoot the i2c code. Of course, this can all be done over a serial connection :)
Note, my code is really just the base for a robot. Right now, my it is nothing more than a very, very complex radio controller for a RC car. But someday, I'll make a real robot :)
16. Tweak and gut the code as you see fit.
17. Ask questions: Pretty much everyone on this site is smarter than me, they'll know the answer.
Some other stuff I've done with this platform--
Battery Powered USB Hub
OpenCV on the Pi
(The bot)
10 Comments
DuartmaN 2 years ago
GreenCrackar 6 years ago
I am planning to make something similar myself. However, I am confised as to how you are powering the pi and arduino. Please could you clarify?
k.v.n.such 3 years ago
xiculan 8 years ago
hello, is there the code for controling the bot by command line? or how do yo do?
thanks
ruhliar 9 years ago
immaturespartan 10 years ago
Ladvien 10 years ago
Pretty much. It's a bit of a step-up from an Arduino UNO by its lonesome.
buckleybw 10 years ago
http://pinkypibot.blogspot.com/
Ladvien 10 years ago
buckleybw 10 years ago