Tuesday
Jan072014

Room roving robot - phase 1

My second holiday project was a bit more fun than just blinking lights. I decided to tear apart a $10 RC jeep and control it with the Arduino. For this project, I added a motor shield on top of the Arduino that I purchased at the same Radio Shack where I found the RC car (Who would have thought that Radio Shack would get back to the hobby electronics game, after they seemed to be turning into a cell phone store!). The shield is the Seeed Motor Shield V1.0, which sits on top of the Arduino and passes through the Analog input pins as well as Digital pins 1 through 7. The shield is a bit clunky, because it has to sit on top of a shield stack but it served it's purpose.

Starting with the car itself, I stripped it down to just it's bare essentials, including clipping the battery connector wires off of the RC circuit board to remove that board (but reuse the 3x1.5V AA battery casing). The front steering and rear drive motors were connected to the RC board via nice little female connectors that happen to easily accept small gauge pins from the seeed ARDX experimentation kit I started this whole process using. The battery casing took a little finagling to get wire leads connected to the exposed leads, but I just pushed a long section of wire into the coils.

After snipping off a bit of plastic from the frame, I managed to get a pretty flat surface for the Arduino (with motor shield) to sit on top of.  A little electrical tape, and bam...  easy mounting is always the best for quick projects.  I was also able to use the space directly above the rear drive motor to nestle a 9V battery that feeds the Arduino.

Here are some photos of the project:

The first photo shows the whole contraption with everything but the 9V battery attached (the little guy comes to life when that's attached...  I guess I need an on-off switch).

Next is the underside where you can see that I'm reusing the 3 slot battery casing for the motor power source. Also notice that little red dial on the front, which comes in handy. It's a front wheel alignment device, which was needed after all the handling I did of the car to take it apart.

Next is a closer look at the electronic stack from the front of the car. This shows one of the female plugs from the motors, and how nicely the experimentation kit wires fit right into it.

Last is the electronics stack from the rear of the car. The four wires coming out of the green terminals on the motor shield are the wiring for the two motors. The space above the rear drive motor that I use for the 9V battery that powers the Arduino is visible as well. You can also see that, when the 9V isn't on the car, there's easy access to the Arduino's USB port for uploading programs.

The circuits for this project are (again) fairly simple, since the Arduino / Motor shield combination makes it easy to use PWM functionality from the Arduino to control current flowing to the two motors. The only other connections are the two battery power sources. I actually started by feeding power from a 9V into the motor shield, and setting the passthrough jumper on the shield to allow it to send power down to the Arduino. After playing with that a bit, I realized it was better to isolate the power source for the controller from the power for the motors.

For the initial program, I hard coded a path for the car that moves it forward while executing an s-curve, then stops, then reverses a bit, and then starts all over again.

Last, here's a short video of the car in action (and getting a reaction from my dog!).

Next up, I'll be adding an ultrasonic distance sensor to the front grill of the robot (the PING))) sensor) and two infrared reflective sensors to let me do line tracking (here).

Monday
Jan062014

Holiday Amusement with Simple Arduino Circuits

I had some spare time over the holidays, and decided to break out an Arduino that I had been sitting on for over a year.  Since this was my first time playing with the microcontroller, I decided to start with some very simple LED cirtuits and programs.

For example, here's one where there are 2 LEDs on the breadboard, one standard blue LED and one RGB LED.

Circuit Diagram:

Arduino Sketch:

Video of it in action (don't mind the mess of wires and extra parts on the breadboard...  I was playing with lots of different circuits):