North Paw Bug Fix

February 4, 2013mrericboyd No Comments »

We’ve recently discovered a small problem with the compass modules included in the most recent lot of North Paw kits. For some reason, in the default sensitivity setting (1.3 gauss), about 1/3 of the time now, the x axis will overflow, and report -4095 instead of whatever the reading should be. This shouldn’t happen, since the earth’s magnetic field is only about 0.45 gauss, but apparently in the new modules, when they say “1.3 gauss”, they don’t mean on each axis, they mean over all. So it’s now possible for the sensitivity to be like this:

x axis – 0.2 gauss
y axis – 0.8 gauss
z axis – 2.3 gauss

or similar, i.e. crazily lop-sided. It seems to always be the x-axis which gets the bad treatment. Anyway, long story short, some compasses no longer spit out reasonable data in the default sensitivity state, so the code actually need to set the compass module to a less sensitive state. We’ve chosen the 4.0 gauss sensitivity state.

Anyway, the net-net of that is that some North Paw 2.0 kits needs a one-line change to the code which is flashed in the ATMEGAs. The one line to be added to the setup() function is:

compass.setMagGain(LSM303::magGain_40); // set to mid-sensitivity

We are in the process of reworking the kits we have on hand, and we’ll be contacting all those kit purchasers who might potentially have this issue to offer help in fixing it (either instructions in how to reflash the chip, if they have an FTDI programmer, or trade electronics units – we can simply reflash them here, so this will not cost money other than the postage and time).

If you’ve got a kit in the field, the symptom of this problem is generally that the North Paw always turns on the same motor, i.e. motor 1 will always be on, regardless of which way you face. On some units, if you rotate the device up so that the x-axis is out of the plane of the magnetic field, you can get the motor to change, because the x-axis won’t be overflowing and ruining the readings. If you’ve got a misbehaving unit, and an FTDI programmer, you can get the updated code here: North Paw V2.01 Arduino Code. Or send me an email eric at

Join the discussion