Friday 26 October 2012

The (tiny) first steps to a deadly weapon...

It all begins with an evil laugh:

MWAHAHAHAHA!

...and so I embarked on a quest to design a mini sumo robot to annihilate its opponents (victims)! This evil genius doesn't work alone, though. I'm responsible for the circuitry and the intelligence of the thing, and my partner's supposed to get the mechanical stuff done. I decided, gone are the days of point to point wiring on a $2.00 prototyping board (although these can turn out quite well, if done right), like in some of my early circuits.

This was a simple board that controlled a small obstacle avoiding robot with two modified servos. The MCU has been ripped out (it was either that or wait a couple of days for one to come in the mail, and I'm not the patient type!). I tried to make a more advanced platform with a set of (expensive) SparkFun mecanum wheels, which failed miserably. However, the circuit worked great!
Despite the ugly soldering and a design that sort of built itself as I went along, the thing worked! In both the boards, I couldn't be bothered to add a simple 7HC595 shift register to drive the LED displays, so I just hooked them up to standard output pins.

The rat's nest below. Imagine trying to stick a soldering iron in there.... I still shudder at the memories of cold joints and singed plastic.

I decided for this project, I'm going pro. Yep, that means a proper PCB. And to make it even more awesome, I added some surface mount components in there too, chiefly an FTDI FT232RL chip to add some USB functionality to the thing, because that's just cool. I planned to make it Arduino based (yes, that means AVR), and I thought instead of just buying an Arduino and a bunch of 'shields' (what's up with their stupid names, anyway?) I'm going to make a nice all-in-one board! I still wanted to use the Arduino programming environment for this project, as it's just seamless to work with, but I enjoy programming in straight-up C (with AVR-GCC), so I decided to make something not too Arduino-specific (so I'm not going to confine the board to the idea of having 'set' PWM pins, and having D0 to D13). Of course, any self-respecting board, Arduino or otherwise has some sort of serial communication, hence the FTDI chip. Since this was my first my first SMD experience, I took a crack at some surface mount soldering, which required a soldering iron upgrade.

This was my old soldering iron, and was surprisingly good, despite the nasty mean things people say about gun type irons like this. However, with SMD work, and lead-free solder (lead scares me), I needed one of those fancy temperature-adjustable machines, so I got one fairly cheap off element14, (around $120, with a giant 500g spool of lead-free solder and a brass sponge to clean the tip). 



I could feel the difference right away, soldering with my shiny new iron! It was just so much easier, especially since all the heat didn't wick away the second it touched a pad. The results of my first SMD work were actually pretty good, even though I started with a tiny SSOP-28 package.


I did heat the thing too much though, as I tried to remove a couple of jumpers without solder wick (forgot to buy it!), but everything went better than expected.

Another thing I had to use was some sort of motor driver. Since the robot's probably going to have tank treads (or some other form of differential drive), two motors should be just right. However, I wanted to stray away from the motor driver I'm used to:














The Toshiba TB6612FNG! It's an amazing little thing, and it's dead simple to use: pull the standby (enable) high, pull either IN1 or IN2 high to set the direction, and sprinkle a little PWM! However, it can only supply a measly 1A per motor, and no deadly robot can run on these tiny motors:













So, I decided it's time for a little hardware upgrade...











...the L298N! This guy can give not 1, but 2 amps of current per motor! Okay, it's still not mind-blowing, but it's something, right? And the some of the boards I've seen with this look sexy! I tried to figure out why they looked so cool, and I figured out it's the big heat sink that really stands out.















The final 'big' part I absolutely had to include was a 16x2 alphanumeric LCD display (standard HD44780 controller). These things just look amazing when hooked up right, and can be quite useful for debugging purposes, especially for a robotics competition, where hooking up the board to a computer for serial debugging can be impractical. So, for just around $2.50, including shipping, I picked up one of these from eBay:


It works perfectly, and comes in a cool blue colour! I saw literally the exact same thing in a local store selling for $20.00, and I almost bought it. Good thing I didn't! Came to my doorstep in just under 2 weeks (from Hong Kong). I also picked up a couple of smaller 8x2 screens, but those are a little too tiny for my taste.

Now for the next challenge... drawing up a schematic and designing a board!

-nanohex
























No comments:

Post a Comment