Hackbot in the Morning

Pretty quiet around here at 7 a.m. Maybe I can whip up a quick python-fueled, Pi-based bot? Oh, yeah - hot glue features prominently in this build.

I love coming in to work early; normally I get in around 6:45 a.m. Very few people are here at that time, and the ones that are? They get it. It’s about as close to freedom a working adult can expect.

On a particularly quiet morning very recently, I found myself thinking, “I’ve never made a bot with a Pi… isn’t that one of the things that everybody’s gotta do sooner or later? I wonder what it takes to actually get something up and running.”

So I decided that, with minimal effort and materials expended, I would give it a shot while there was nobody here to tell me otherwise – nothing fancy, just a platform that’ll drive around, to which I can ultimately attach more junk (it started with some junk reclaimed from other projects). Check the end of this post for a consolidated list of items used.

I started off with a Raspberry Pi 3 I mounted to an acrylic plate to try to give it some weight to hold it down when there’s a slew of cables stuck in it. I hit my pile of junk in my basement for more parts… and I came across this old project:

That there (above) is the remains of my “Little Dude” project I did a video for a while back, using servo wheels glued together as pulleys… good times, good times… Anyway, that’s a pair of gear motors (ratio unknown, whatever - let’s rock!) wired up to a TB6612 dual-channel motor driver good to 1.2A per channel. Sweet! This bot was just about building itself!

I figured could mount the motors and driver directly onto the acrylic with hot glue, although if anything got too hot, it would fall off. I decided to just really gum up the motors so any heat couldn’t melt all of the hot glue and stick to the edges of the driver board. This bot wouldn’t be drawing that much current. If I remember right the stall current on the motors is around 330mA, and we’ll be nowhere near that driving this little beastie around the office.

When it came to power, for initial testing I’d have to have all the cables and junk plugged in anyway, but Hackbot needed localized life support if he’s eventually going to romp free… not to mention headless operation. I could have started it with all the junk plugged in, then yank the keyboard, mouse and monitor out and set it on the floor, but that was definitely a short-term solution. I let that part go while I got the rudidments in place. In the meantime, I had to make a little regulator circuit with a 7805 – that should be good to an amp and a half, so it should cover me for the Pi and the motors. But a two-cell lipo is about 8.4V fully charged, and at a guess I’ll maybe draw 500mA average (totally ballparking here), giving me (8.4V - 5V)*0.5A = 1.7W to dissipate on that TO220. It would probably get hot unless I heatsink it.

Programming this in Python was easy enough, as it’s just GPIO manipulation. I wasn’t going to try and PWM the motor driver, as I had the gear motors and I knew they were slow. If they were faster, I might have had to worry about feeding them PWM to control the speed.”

Link

Related Content