Upgrading to Arduino Mega

As the size and complexity of my code grew, I began to get frustrated with the limitations I'd imposed on myself using an ATMega328.  So, I decided to switch to using an Arduino Mega board I had lying around in my parts box.  I also decided to add in an LCD display shield that also had built-in menu control buttons (up, down, right, left, and select) so I could implement so a meaning system for access to the various control parameters I wanted to adjust in the field.  I had also recently joined a new local hackerspace called MakerPlace and now had access to a laser cutter (woohoo!), and other tools I could use to fabricate a better mounting arrangement that the foam board I had used for my first test setup.

And, here's a closeup of the mounting board I laser cut from 1/8 inch birch plywood:

This new arrangement let me mount two 1/2 size breadboards on the front edge and this gave me room to install two GPS units at once, which made some of the GPS comparison tests I describe in another section easier to do.  In addition, the larger code and RAM space available in the Mega 1280 chip pushed away worries about running out of either of those resources.  Plus, since the ATMega 1280 has 4 hardware serial ports, it was now much easier to connect and control the dual GPS units and I even had a spare ports left to use for data logging.  Note: I did, however, have to modify the Arduino 1.0 environment to increase the buffer space allocated to the serial ports in order to reliably read the GPS sentences.

Other Upgrades

I also added a Sparkfun OpenLog module (visible in the right side of bottom photo.)  In the upper right corner, near the wheel in the lower photo you can also see a Pololu MinIMU-9 which replaces the Honeywell HMC5883L I used in my earlier experiments with a gyro and accelerometer-stablized platform designed to compensate for compass tilt.  The reason for this change (which I'll describe in more detail in future sections) is because I began to worry that the compass was not providing accurate reading whenever the car banked to the left, or right in turns.  I had noticed that the car often veered wildly to the left or right in certain circumstances and I became convinced that the compass tilting in turns was to blame for this behavior.  As it turns out, I did have a problem with my compasses, but it was a different problem than I first suspected...

Next: Calibrating the Compass