Pages

Wednesday, December 20, 2017

Making A Robot

For the last couple of months I've been working on a robot.
I started with the body:

The body & wheel modules
The body is basically just four wheels connected by popsicle sticks. It doesn't sound like it would be very strong, but it managed quite a large load, as the following video demonstrates.

For this setup I just directly connected the wheels
to a crude semi-remote control with a couple of wires.

I decided to use my Arduino for the brains of my robot, but it turns out using an Arduino to power motors is harder then I thought.
After some research, I decided I needed a couple of 'H-bridges', which are basically a couple of switches wired together to form a motor controller. After a month or so, I actually went out to buy them.
What I ended up getting was actually a 'shield' for my Arduino (it plugs in the top), which is better then an H-bridge because it can run a lot more motors, and be controlled directly by the Arduino. All in all, it should be a lot easier to figure out, and work better.

Or so I thought.
Before I started playing with it, I decided to research how to use it (logically, I think). And after half an hour or so I had found... nothing.
Well, nothing very useful at least. After a while more of researching, tweaking and coding I came up with this:


The pink and blue wires lead to the motor. 

I know, not remarkable. And it didn't even work.

After a couple days of sulking (OK fine, not only sulking), I decided to try again.
This time, instead of trying to write my own code for it, I copied someone else's. It still didn't work. Then I decided to check the polarity of the power source wires (these provide the power for the motors).

This is embarrassing. The polarity was backwards. 😬 After switching those wires around, the motor ran fine! FINALLY!!!

Now that I had the shield working, I programed it to drive my robot. This was pretty easy, since all I needed to do was test out the system. I made a program that made it drive in circles.

Then I connected the Arduino and motor shield to my robot, made a simple power supply circuit, and started driving.
Here is the robot in it's current state:














Next Steps:
  1. Find battery and charger for robot and install battery into robot
  2. Find and attach some sensors
  3. Make a program to run the robot with the sensors
  4. Possibly at a Raspberry Pi and use it to run a neural network
Time spent (approximately): 7 hours

No comments:

Post a Comment