Raspberry Pi Wii Remote Robot - Brian Hensley

Raspberry Pi Robot + Wii remote (It’s Alive!)

So i’ve made some updates on my Raspberry pi robot, and the video has been posted for some time now. In this tutorial you’ll see hints on how I built the robot, what is needed. For starters the robot works! It drives, moves, and is fully controlled by the Wii remote. HOW COOL!! check out the video…


Now that you think this is the coolest homemade K’nex Rapsberry Pi Robot with Wii remote lets check out how it came together.

You might need to review some of my previous blog tutorials to learn how to get small parts of it together and working. Here are the links for your help.

My current hardware setup looks like this:

  • Raspberry Pi
  • Digilent Cerebot II (Atmega64 Microcontroller)
  • 2x H-bridges (Digilent)
  • 2x 6 Volt DC Motors (PWM controlled)
  • USB to Bluetooth – this one SABRENT at Fry’s is what I used
  • Nintendo Wii Controller
  • 8x 2AA batteries (6.5V for the Micro, 9V for the Pi)
  • 5V Fixed-Output Regulator (LM7805)

5V Voltage Regulator

So I made a simple linear regulator to help control the power going to the raspberry pi and help give it some life over a good period of time. To do this I took 6x AA (1.5V each) batteries which was about 9 to 9.5V depending if they were new. I put some caps in there to help reduce any noise and to help stabilize it if a small uptick in current draw was needed. Also I set mine up to bypass the normal USB micro B input on the Raspberry Pi, I simply connected directly into the power pins on square header section. This is what my schematic looked like:

Now this doesn’t complete the setup, as I had problems consolidating the two boards power. The digilent cerebot II board (which connects to the motors) drew too much power and kept rebooting my raspberry pi. I attempted to add a higher capacitor to my regulator but this didn’t fully help. So I ended up using 4 batteries to power the cerebot II board and 6 to power the raspberry pi. not ideal, but worked to get this project finished.

Wifi USB setup:

New in this post from my wi-fi pi tutorial is I bought a Edimax EW-7811Un adapter. I had to make some adjustments from my current wi-fi tutorial for this to work without a router. This one I setup a peer to peer connection. This allows me to connect from my laptop directly to the Raspberry Pi Wi-fi module for instant connection and updates about my python program running. I then connected to it over Putty SSH connection on my PC.

First download a new driver.

wget http://www.electrictea.co.uk/rpi/8192cu.tar.gz

Then unzip it.

tar -zxvf 8192cu.tar.gz

Then move it to the right directory location. Might want to check the kernel directory exist first.

sudo cp 8192cu.ko /lib/modules/3.1.9+/kernel/net/wireless/

create/edit the following file

sudo nano /etc/modprobe.d/blacklist.conf

Add the following to the file and then save and exit. This makes it so the default driver isn’t loaded.

blacklist rt18192cu

Run demod

depmod –a

The last thing to do is add the module to be loaded on bootup.

cd~/
sudo nano /etc/modules

Append the following to the list

8192cu

Reboot and plug in the Edimax WiFi moduel.

sudo shutdown -r now

So now you’re done with the WiFi and battery powering the devices.  We already covered the bluetooth connection in a previous post and the last few things are the new code for both boards and the body to hold the robot. My body was made out of some k’nex I had lying around from when I was a kid.

 

 

Links for wifi connection:

Peer to Peer connection PC to PI
http://spin.atomicobject.com/2013/04/22/raspberry-pi-wireless-communication/

http://elinux.org/RPi_edimax_EW-7811Un

wifi on a Pi

Problems with dropping?: http://raspberrypi.stackexchange.com/questions/5364/wifi-connection-gets-dropped-very-often-with-edimax-ew-7711utn

3 thoughts on “Raspberry Pi Robot + Wii remote (It’s Alive!)

  1. Hi, I’m a undergrad student and I’m trying to work with the cwiid module on python. Could help me with the documentation please? I’m really need this.
    Your projects helped me a lot already.
    Thanks

  2. Do I have to pair the Wii remote each time or is there a way to have the Raspberry Pi “remember” the Wii remote for future programs?

Leave a Comment