Tuesday, June 15, 2010

Arduino

So I'm back at it again. I hadn't done anything with my stepper-motor powered Lego car for a few months because I had burned out one of my power supplies. Then, in the process of upgrading my computer's video card, I swapped out my motherboard to get a PCI-E slot and the new motherboard didn't have a parallel port. It's a bit risky pulling out all the power supplies and delicate components with the now-walking toddler. But, I decided to do it anyhow.

I got the serial communication working with my stepper motor driver, and programmed up a simple Visual Basic application to control it. The stepper-motor driver uses an ATMega168 microcontroller to drive an H-Bridge to push enough current to drive the motor. The unfortunate part is that the Australian company I bought the controller from will not provide the source code. So, I can't do much to modify the microcontroller at all. Well, I could, but no guarantees I could get it back to the original if I goofed up.

So, instead, I purchased an Arduino Duemilanove from www.sparkfun.com. (It's only $30 plus shipping!) Had I known about this board originally, I would have bought it first and simply added an H-Bridge chip to run my motors. I'll probably end up doing this now anyhow. But once I have it working, I can gleefully pull the ATMega168 out of the other stepper motor controller and re-program it. Hopefully it will fit in the socket on my Arduino.

Meanwhile, I've dissassembled a cd-drive and an inkjet printer and salvaged several stepper and DC motors, as well as some gears and axles. These will be great scrap components for my future gadgets.

I've been looking into what it would take to add WiFi to my Arduino. There's several solutions, all of which cost about $80. I may be able to work around the cost factor using my computer as a base station to gain access to the network. I can connect a RF transmitter / receiver combo to my Arduino, and another set to the serial port on my computer. Then, with some simple programming, I can connect to my computer via TCP/IP and have my server program relay any information to the serial-connected RF transmitter. It's not a real elegant solution, but it's about the same as using the XBee product.

The downside would be that the car would be restricted to networks that I can run my software and hardware on. I really would like it to be more robust, so I may just have to save up my pennies for a while until I decide to splurge again and by my next major component. Until then, I'll just work on my tethered vehicle.

There's still some major work to be done to get the motor's drive shaft connected to the car's axle without the slippage of a rubber band. I'd really like to get a gear on that axle, but haven't had much luck getting the plastic to stay connected to the metal shaft.

No comments: