ArduPi Webcam Tankbot

This is my first robot project though I have been working with Microcontrollers and Embedded Linux for a little while. As of writing (3/1/13) this is still very much a work in progress, but most of the hardware construction has been completed. This robot will provide a remotely controlled, mobile platform for a pan/tilt webcam. It is based on the excellent Tamiya Tracked Chassis Kit with the Dual DC Motors connected to the Arduino Motor Shield R3 via the Screw Terminal. The Pan/Tilt function is provided by two Tinkerkit Servos which also allows them to be connected to the Motor Shield without taking up additional pins. The webcam is connected via USB to the Raspberry Pi and streamed to an online server using MJPG-Streamer and an Edimax wifi dongle. Control for the Arduino can be provided via Bluetooth Bee, or XBee but the eventual goal is to connect and control the Arduino from the Raspberry Pi. As the RPi USB ports will be filled up with the webcam and wifi, connection will likely be achieved via GPIO.

 

Side view Ardu-Pi v1.3

Web controllable mobile platform for webcam mounted on pan/tilt turret

  • Actuators / output devices: Tamiya Dual DC Motors, Tinkerkit Micro Servo, Tinkerkit Contin-Rotation Servo
  • Control method: Bluetooth Bee, XBee or Edimax Wifi Dongle
  • CPU: Raspberry Pi Version B
  • Operating system: Raspbian Linux
  • Power source: 9v for Arduino, seperate AA pack for motors, Cell phone charger for RPi
  • Programming language: Python, Arduino C++, Firmata, 12c, node.js
  • Sensors / input devices: MJPG-Streamer, Arduino Uno, Arduino Motor Shield R3, Rocketfish Webcam
  • Target environment: indoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/ardupi-webcam-tankbot

Looking good!

I’ll be following your progress, since I aim at doing something like this myself (still waiting on the wifi dongle).

 

You might want to take a look at:

https://www.robotshop.com/letsmakerobots/node/36331

and

https://www.robotshop.com/letsmakerobots/node/35363

Keep on the good work!

 

Yeah I just found the

Yeah I just found the RPI-TB-2 build right after posting when I searched for similar tags.  I actually found Livebots last night while searching for other Robot Webcam projects.  Both projects are pretty much exactly what I’d like to do, the only difference might be in the addition of the Pan/Tilt servos for the webcam off the same shield (Arduino Motor Shield R3) as the motors.  Its quite possible that this would be too much for the little 8-Bit Uno board to handle… Such a scenario might finally give me a chance to test out the new 32-Bit Arduino Due board, for which little has been written since the media blitz accompanying its release in October…  According to this tutorial, the Motor Shield R3 is one of very few shields that is actually compatible with the Due which uses 3.3v instead of the 5v used by most other Arduino Shields. I have not yet seen any confirmation if the Due has been tested with the Tinkerkit outputs on the Motor Shield, but it shouldn’t be a problem.

 The Raspberry Pi,is also 3.3v and the extensive level shifting involved in connecting the GPIO to a standard Arduino Uno is tricky enough that most tinkerers seem to avoid connecting the two and thus fall far short of both platforms’ potential capabilities (IMHO).  I have seen it mentioned occassionally that the RPi and Due should be able to connect directly without any level conversion, but have yet to see it confirmed… 

Well I haven’t explored the

Well I haven’t explored the Rpi GPIO yet, but regarding driving two servos and a couple of motors an arduino e proper motor shield should be more than enough. Like TinHead I plan to make my own *duino board and motor shield, the motor shield I’ll use one like I’ve been using previously… as for the *duino like board I still have to check if an ATtiny 2313 is sufficient to handle command juggling + servos… pins it should have enough (I think – really need to check) however I have serious reservations that I can fit a sketch to my liking in there… in any case I can just go with an ATmega8. Regarding level shifting I guess I can just drive my *duino with an atmega328p (or other that supports it) board at 3.3V… it’s just a question of setting fuses properly I guess.

But so far, I’m only in the part of collecting parts and vague ideas on how I will achieve my objectives :slight_smile:

Separate the power lines?

  So I’ve been reading mixed messages regarding how best to supply power to the DC Motors in the Tamiya Dual Gearbox- http://www.pololu.com/catalog/product/114/specs

  Most tutorials for the Motor Shield recommend separating the power by “cutting the “Vin Connect” jumper placed on the back side of the shield” (http://arduino.cc/en/Main/ArduinoMotorShieldR3) but the F-130 DC Motors run on relatively low voltage (3v) and draw around 1.5 amps so I’m wondering what the best way to power the motors and the servos might be?

  I actually ended up with an extra Motor Shield, so I suppose it wouldn’t hurt to cut the vin connect jumper on one of them and see which one works better?  Anybody have experience with this configuration?

Suddenly I don’t feel so original…

Wow this guy did exactly what I wanted to do, only with his own H-Bridge instead of an Arduino Motor Shield…

http://youtu.be/l1RJf-XwoIE

https://github.com/mirceageorgescu/raspi-tank

Ddon’t worry about overall

Ddon’t worry about overall originality. The thing with many people already having done a similar project is that a lot of “heavy lifting” is already done. Also, one can always make one’s project original through little details :) 

Yes, Thank you. I didn’t

Yes, Thank you.  I didn’t mean it to sound like I was disappointed.  Rather I was quite excited (and relieved…) to see that the path has been blazed to a certain degree! Besides, like I mentioned in the initial post, it looks like he’s using an H-Bridge instead of an Arduino+Motor Shield, and thats not an insignificant difference.  So I’ve still got a good deal of work to do on my own…

  It is reassuring to know that almost the exact combination of Tamiya Tracked Chassis, RPi, node.js, websockets and even mjpg-streamer actually works for somebody before I try it all.

  BTW- I’m doing most of the programming work via the Adafruit WebIDE so if anybody would like to check out or contribute to the repo its at-https://bitbucket.org/cribstone/ardupi-webcam-robot

Update-

Slowly getting the battery packs together while teaching myself the Johnny-Five framework for node.js.  Its somewhat of a pain in the neck to find good up-to-date information about compiling node on the Pi because its so new, but definitely looks worthwhile considering the capabilities.  Now the only issue is how to go about connecting the wifi, webcam AND arduino to the Pi when there’s only two USB ports.  Obviously a powered USB hub would normally be the answer, but that means yet more battery packs.  Best outcome would be to connect wifi and webcam through USB and Arduino through the GPIO.  I’ve done enough experiementation with the RPi GPIO to know its anything but “plug’n’play” and normally requires some tricky level shifting when connecting to a 5V Arduino.  

   Again…  Unless I can find confirmed documentation that the Arduino Due can connect directly to the RPi GPIO… 

Level shifting is not that

Level shifting is not that all complicated… take a look at https://www.robotshop.com/letsmakerobots/node/34444


Also I might query you later on details regarding your node.js adventures later on :stuck_out_tongue:

Version 1.3 is Complete!!!

  I would mark this progress as “Completed” but i’ve really only acheived half of my goals.  I have successfully configured the robot to

  • livestream video via a Raspberry Pi
  • Control the Dual DC Motors via the Arduino Motor Shield R3
  • Respond to Serial Commands sent via Bluetooth from an Android App

  I have managed to power the vehicle through two seperate power sources.  A 9V Battery connected to the Arduino Uno Power Port, and a Battery Pack of 4 AAA Rechareables connected to the Vin, GND on the Motor Shield Terminal.  The Raspberry Pi is powered through a Kodak Battery Backup Pack.

  Version 2.0 will include full web control via node.js/Johnny-Five Framework/Websockets/Firmata, but before I can accomplish that I still need to add the code to control the two servos on the Pan-Tilt Bracket for the webcam.

AWSOME

Keep up the good work, really cool too.

node.js via GPIO vs. Battery Powered USB Hub?

 

   After reading your post it occurred to me that it might not be so simple to use the node.js Johnny-Five protocol to control an Arduino running Firmata through the GPIO…  At least there isnt much documentation that I could find.  Because it is so new, most Johnny Five examples connect to the Arduino through USB…  So if I were to try that option I would need to find a means of powering a USB hub since the existing two ports are occupied by the Webcam and WiFi dongle.  Powering a USB hub with Batteries is somewhat tricky, especially if the purpose is to use it for the data connection and not solely power…  The only other alternative might be if there’s a way to connect the WiFi dongle through the GPIO?

 

Well I even barely know what

Well I even barely know what node.js is, someone just linked me it, told me it was cool, I gave a peek at the website and as all tl;dr; :stuck_out_tongue: So now that I see it mentioned again I think it might be useful to me, but then again it might not. I’m progressing slow… :slight_smile:

Awesome!

Now you just need to put it LIVE on Livebots :stuck_out_tongue:

Another Great Example Build…

It looks like these guys figured out the whole node.js>Pi>Arduino via Serial setup…  and its certainly not what one would call a simple configuration…  But it definitely does appear to be possible!

http://www.linuxcircle.com/2013/02/19/controlling-arduino-motors-via-raspberry-hosted-website-part-1/

http://www.linuxcircle.com/2013/02/20/controlling-arduino-motors-via-raspberry-hosted-website-part-2/

  The other thing I can’t stop thinking about is how to optimize the physical design.  I really like what these guys did with the same Tamiya Motor set-up- https://www.robotshop.com/eu/dfrobotshop-rover-tracked-robot-basic-kit-7.html

  Amongst other things, what I really like about this kit is the way they make use of the space on the bottom for the motors and batteries.  Such a configuration might work well should I find a way to incorporate a wireless induction battery which could be “parked” on the charger without having to plug anything in.

  I can’t bring myself to buy a whole new setup though, especially when I already have almost all of the components other than the board and side brackets.  even if I did have $100 to throw around I generally have a rule to never spend over $75 on a single device/component…  So unless they sell the board by itself, it looks like I’ll be playing around with some different chassis configurations too…

 

Basic tutorial to start scripting
Http://Www.linuxcircle.com got some really good source code for controlling the robots from a web browser.
It also shows a simplet tutorial to feed live video using rapberry pi as the web server which broadcast the feed via a public ip address.

The componets required for the robot are:

  1. DFRobot Romeo
  2. 4wd chassis
  3. Raspberry Pi

Other components including webcam, usb hub and wifi dongle.

Have fun robot scripting!

Gear Ratio ?

Hello !

I build a similar robot.

… as are the transmissions oriented?

Gear ratio is 12,7:1,  36,2:1,  114,7: 1 or 344,2:1 ??

 

Thanks

Gerhard

Gear Ratio ?

Hello !

I build a similar robot.

… as are the transmissions oriented?

Gear ratio is 12,7:1,  36,2:1,  114,7: 1 or 344,2:1 ??

 

Thanks

Gerhard

**12.7:1 Type “A” Transmission **

I just used the standard configuration from the Tamiya Manual for now, but that’ll change if I decide to rearrange.  A lot depends on whether or not I can find a battery pack which can be charged wirelessly, like the ones they use for cell phones.  If possible, I’ll rebuild with the Battery and motors on the bottom akin to the DFRobot Rover so the battery can be “parked” on the charger.