I started with the body:
The body & wheel modules |
For this setup I just directly connected the wheels
to a crude semi-remote control with a couple of wires.
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:
- Find battery and charger for robot and install battery into robot
- Find and attach some sensors
- Make a program to run the robot with the sensors
- Possibly at a Raspberry Pi and use it to run a neural network