WifiCar v2

The original Wificar was long overdue for an update. Recently, I've been able to do it.

There were a few problems with the original car. Its software was, to say the least, lacking. Also, using the GPIO pins straight from the router, it was limited in what it could control, and required one wire per GPIO pin, plus ground. The driver chip also couldn't handle the current for the drive motor. Another often-requested feature was video, which the WRT54G wasn't very good at. The new WifiCar addresses all these features, and possibly more.

I decided to center the new car around the WGT634U from Netgear. It's got a Broadcom BCM5365 CPU @ 200MHz, 8MB Flash, 32MB RAM, 2x serial, 1x mini-PCI with an Atheros wireless card, 5x ethernet, and - here's the kicker - USB 2.0 Host. It's that last feature, along with the $40 (refurbished) price tag, that led me to chose this device. The USB port has endless possibilies, for storage, audio, or, in this case, a cheap, $10 webcam for streaming video.

Hank Austin was generous enough to donate a Hummer H2 (1/10th scale) as the hardware base for the project. It comes with treads that you can put on instead of the wheels, so it can drive over snow (imagine that...) Initial testing showed that the drive motor draws up to 4A continuous, and nearly 10A peak (when driving up a hill, for example)! This melted the shrink-wrap on two of my battery packs! Also, I'd need a driver board that can handle this current!

Another initial stumbling block was the lack of GPIO pins. My initial plan was to use the serial port to talk to an Atmega or similar microprocessor to handle the GPIO and control of the H-bridge. But this required designing a custom board, and I was dragging my feet for months on this (I'm an INTP, I get caught up on the tinyest imperfections).

Finally, Chuck Harrison discovered GPIO pins that could be used to drive an I2C bus. This was indeed great news! I hooked up a MCP23008 I2C 8-bit GPIO expander, and was soon able to drive the output bits. Quite sweet!

Now that the interface to the router was complete, I had to work on the interface to the motors. I stole some TIP120 and TIP125 power transistors (5A continuous, with good heat sink) from one of my school's electronic labs and, after hours of toil, managed to get a working H-bridge! I hooked it up to the I2C chip and ... voila! Motor controllable from the router!

I also wrote a better server program. It handles connections better, has a config file (so you don't have to recompile it if you change the wiring), and uses an LED on the board as a status indicator. The LED is off when there's no connections, on when it's receiving data, and flashing when connected but has not received data.

I built two copies of my H-bridge on the same breadboard as the I2C chip and was soon able to control two motors via TCP from a laptop! I cut up the old WifiCar (it hasn't worked in months, I think...) as a test platform, since most of the work was already done (removing the 27MHz board, etc.). I alligator-clipped the drive motor, steering motor, and battery power to the breadboard and tried it out.

With a very long ethernet cable (the wireless on that WGT is broken), I managed to ... drive the car! Steering, drive, everything - worked.... it was quite sweet!

The Downfall

I headed out to find a video camera, and found a friend who had a video-capable cell phone. Meanwhile, another friend had some fun driving it back and forth. During one of these runs, he drove over the alligator clip supplying power, and it stopped driving. No matter, i'd just clip it back.

There were two unused wires hanging off the breadboard. One was the power to the H-bridge, which in this case was +11V from a freshly charged 9.6v pack. The other was the 3.3v from the router that powered the I2C chip, and which I was using to make sure the router didn't die. So, I simply clipped the loose lead back to the power lead, and was surprised when it didn't drive.

A cursory examination revealed that I had attached this +11V to the +3.3v from the router, which goes straight into the CPU, the FLASH, RAM, and various other critical components of the router. It no longer gives out DHCP IP's, doesn't display on its front LEDs when an ethernet cable is connected... in short, it's fried beyond repair. I haven't tried fixing it yet, but I'm not keeping my hopes up.

Fortunately, I bought some extra WGT's before they were EOL'd so I have some more around here. I just have to solder an I2C bus to it, and I'm off to get this thing working!

Pictures! here.

 - Yasha


Page Created by Yasha Okshtein
    flyashi@gmail.com