Let's Make Robots!

Raspberry driven TB-2? Or better RPI-TB-2

Drives around controlled by a web interface and streams video
tiny_driver.tar.gz8.58 KB

Hey all,

I finish building this about 2 weekends ago but I never got to actually post it so here it is: Raspberry Pi tracked bot or short RPI-TB-2 :)

Built this one for several reasons:

  1. Wanted to test my tracked base 
  2. Wanted to make use of the PI 
  3. Intending to add some form of autonomous navigation based on webcam ... someday

The mechanichs is the same as TB-2 not much else to add except it's printed properly this time (blog here) :D

From TB-X


The electronics consists of a Raspberry and a custom driver I have build for the olde C.R.A.B which was never the same after seeing Berlin. The driver consists of an ATTiny2313 and a L293. The tiny listens for commands over I2C and controls the motors based on them. Five commands can be sent currently for left,right,forward,backward,stop. 

On thing I had to workaround is the level shifting for i2c from 3.3v on Pi to 5v on tiny. I have found this on the arduino playground, and tryed the simple resistor hack. I works great.

From TB-X

On the Pi usb port I have a Logitech webcam and an old ugly wifi dongle. 


From TB-X

The Pi is great but it is also power hungry drawing about 700mA by itself, add to that the usb devices and you get around 1 A just for the brainz. This is a bit on the high side for the 7805  regulator causing it to heat up considerably (read burning fingers).

So to solve that I have split the load, on regulator for the Pi one for the USB. To power the usb I'm infusing 5V in the cable directly.

With that done I have all hardware powered.

Now on to software ... I could have used one of the linux distros already out there but most are very bloated, way too generic to be useful on a robot. 

So I decided to build my own using Buildroot which is a linux filesystem and kernel build collection of scripts and make files. Somebody did this before me so all credits go there . After a few hours including configuration I had my little Linux all built, installed it on the SD card and booted the Pi. Success.

Next was to configure the kernel to have the needed drivers for my webcam and wifi dongle. Once that was done I had to hack some scripts into connecting the robot to my local network. 

Next thing todo was to get the webcam streaming to the network. I used mjpg-streamer to do this. 

Last was to create a little server which presents a webpage with the video stream and a form with buttons which send I2C commands when pushed. I wrote that in python ... it's  really basic and security is inexistent. 

I'm currently having issues with the stupid wifi dongle... it's completely unstable and most of the time the coonection drops. Because of this I never really got to actually do a video on it :/ 

Will have to find some other dongle or another way to connect.


From TB-X

Update - Think I fried the linears :/

The Pi needs power ... so I got 2 mini SBEC's to fix that ... coming near christmas probably.

Wifi is fixed though, found a post about adding  a kernel parameter to fix it. Thanks for mogul, and the others hitting my stream while I was load testing :)


Update - Linears won't do? SBECS man :) 

Ok so I got me SBECS from ebay. 

Put the thing back together ... and had FrankNeon drive it around me house :) Video added :D


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Are you or have you tried to stream the webcam's video to the internet?

Unfortunately my wifi dongle sucks, needs a replacement before I can try again.

You might not have had to worry about level shifting. The Tinies work down to 2.7 v (1.8v for the 2313v.). Was it an issue with the 293 having to be that high? I was able to see a Tiny 85 on the Pi i2c bus using the Pi's GPIO 3.3v, but that was as far as I got.

Had the driver already rigged on 5V :)

Can I talk you into doing a walkthrough of the I2C communications between the Tiny and the Pi?  I was having some difficulties when I last put it down.  Having one of my Linux gurus nail it down would help.

Think I'll do a more torough one.

Thanks for sharing. Getting to see video of this in action will be cool. :)

yes :)