UPDATED and FINISHED* on May 3rd, 2014
*With 'finished' meaning that I built what I had envisioned, then played around with it and learned stuff, and then took it apart to re-use parts for something else. I plan to 'finish' all of my bots this way, unless I find one that is permanently useful around my house. Otherwise, they're just temporary.
Please know that I'm willing to help people copy this project if they ask.
Hi everybody, this here's my first time posting a bot. I've had proof-of-concepts and simple motor control before but i didn't find those to be worth posting about in general. Some of you may have seen me over in the shoutbox asking a lot about where to start or where to buy things, and I finally got through the phase of wondering what to order. Now that I actually have something that does stuff, I'm typing things up.
The Boring Stuff About How It Started
So my bot is called Arpy and is meant to do stuff around my house. IDK what yet. The name is my version of 'R P' meaning raspberry pi, which is the brains of the operation. I unexpectedly got my hands on one and i put opencv on it, (after a lot of searching online for how to do that. id be happy to share if anyone asks, but lets get back on track.) but then i realized that after using c++ for a while id have to learn python for opencv. that went pretty easily, actually, everything's very similar. so i got the pyserial library and thought 'hey maybe i could connect an arduino to the serial port and get info going back and forth (courtesy of this tutorial http://blog.oscarliang.net/connect-raspberry-pi-and-arduino-usb-cable/ ). That worked so i decided i would program the pi to do stuff with opencv and a webcam for input, and then make the arduino handle the physical stuff like moving. Currently, I'm not using opencv because it slows the program down and I'm debugging a lot so i don't want to wait again and again. But I've proven already that things still work with opencv running, just very slowly. Maybe later when things are a bit more together I'll bring the opencv back.
Before I came upon the pi, I did my first soldering when i made a board for the L293D (yes i know, bad idea, but im the type to start with level 1 and skip tutorials, yknow? ) that would basically just connect the pins that are supposed to be hooked up to the same place, and then arrange pins so that any battery connections are on one side and chip connections on another, and then the motors go elsewhere. This picture is fuzzy because i dont have a good camera on me right now but
the wires on the left go to two DC motors,
the three on the bottom go to ground, motor power, and ic power,
and the five on the right are four for steering and one for enabling both motors. those connect to arduino pins.
This board is completely based on chickenparmi's youtube tutorial on the h-bridge, so i give my public thanks for that.
What I've Got (Update 4) (As of April 13th, 2014)
So I have an arduino Nano now that has five pins controlling the motors. The Uno kept cutting off the serial connection and it may be the board's design or it may be my mistreatment of it. (I played around with the uno and excessive voltages and stuff back when I was young and foolish a few months ago) Then i have it serially connected to the raspberry pi which is telling the Nano what to do. While opencv worked, it was frustratingly slow and I've decided to make the bot work a little better before I involve opencv, which slows down the pi. Coding-wise, I've got a little dance routine for the bot to move around in a square on the floor. The big issue there is letting it turn for the right amount of time so it can turn 90 degrees and not like, nearly 360. (I'm not doing encoders, I'm doing it by timer. This bot is for indoors so if it gets its wheels snagged and can't turn properly, that's for me to fix, and it's not its job to be immune to that.) I think there is an issue with something along the lines of the serials being out of sync. Only when I get lucky do i have pi serial output and the arduino check for serial input at the exact same time. To get around that, I just have the pi send the signal a good ten times and that flurry of messages is enough for the nano to catch one and be like 'ok i got it!' This works out becaue Arpy's reaction time is still pretty quick from pi command to real action. IDK why the Uno cut off the serial every few seconds though, that's still not making sense. Anyway, I made the knex chassis smaller now that I went from an Uno to a Nano. This is a picture of a semi-disassembled Arpy,
and here it is put together and turned on:
and finally, I have a video of it wandering around on the floor, supposedly in a square.
I scrapped the LED board, and it turned out that it wasn't all about crossed wires, I had just messed up the LEDs a while back and hadn't realized it.
Done~ (Update 4)(As of May 3rd, 2014)
LED Board: After scrapping the board, I found that I had messed up the LEDs anyway. But since I did get them to work before I attempted a board for them, I'd say I technically DID get that aspect to work.
Webcam: The pi is simply slow with opencv running, and there's nothing I can do to make it quite fast enough to meet my standards. Slow but it works.
Battery Pack: Found one and it worked fine. There isn't much more to say here, except that it was pretty heavy compared to everything else on the bot, so it slowed down movement a little.
I'm over and done with this bot, and I'm moving on to the next on the list: a little box that would light up, navigate the house, and make noise as an alarm to wake everyone up in the morning. It might evolve into something further, but that's the starting point I'd like to hit before adding stuff. This time no pi, just an arduino.