Script.Require("jQuery").AtHead()

Turning my Raspberry Pi into a tank...


I got a Raspberry Pi for Christmas from my parents. I bought one fairly soon after the launch, but I broke the SD card holder. The second one is now serving as my DLNA server, running miniDLNA. This means that this one's my third. It's the Model B+ variant, and I plan to turn it into a tank!

Hardware (apart from the Pi...)

  • Tamiya 70108 Tracked Vehicle Chassis Kit

    This will be the chassis (you don't say...). I chose this because it was quite cheap, and it's Tamiya so I should be assured of some decent quality. However, it does only have one motor, so to make it go around corners, I'm replacing the gearbox with the...
  • Tamiya 70097 Twin Motor Gearbox

    This has two FA130 motors, which should be easily powered by 4 AA batteries. The Pi itself will be powered by a rechargeable USB power bank. As the Pi's GPIO port can't directly drive the motors, I'll need to use...
  • SN754410 Quad Half H-Bridge

    Each one of these chips will drive two motors. I'll prototype the circuit on a breadboard which will be connected to the pi with...
  • Model B+ Cobbler

    This is a clever little board which will connect the Pi's GPIO port to the breadboard via a ribbon cable. Speaking of cables, it'd be no good if the tank can only go as far as a network cable, so...
  • Ralink RT5370 based USB WiFi dongle

    This nano-sized dongle is small enough to be powered directly from the Pi's USB ports without a hub. Also, the chipset drivers are already in Raspian, so installation is pretty much plug and play. 

Software

I'm writing the software in C#. I know all the cool kids use Python, but I know and like C#. Besides, a language that uses whitespace semantically seems a bit dodgy to me. Luckily the Mono project will allow me to run C# programs on the Pi, and the Raspberry # library will handle the GPIO port. As for controlling the tank, at first I thought of using a Nintendo Wii controller. Then I figured that as I was learning ASP.NET MVC for Wiresmoke, I'd investigate that. Unfortunately, there's no way I can get the current MVC to run in Mono, as it's too coupled to IIS. Then I saw via Rob Miles' blog Jan Tielens' blog post describing how easy it is to leverage OWIN to self-host ASP.NET code.  Of course I still can't use MVC, but I can use NancyFx, which is very similar and very lightweight. So with a bit of Bootstrap and jQuery, I have already prototyped a responsive UI for the Tank. I'll post how I did that another time...


Comments