This is almost too embarassing to post on Parallax's forum, but here goes...
I'm teaching Spin programming in a high-school robotics class. We're using ActivityBots in the class, and the overall objective this semester is to be able to navigate autonomously using GPS waypoints. The year-long objective is a floating automous vehicle that will survey the local wasting-desease-challenged sea star population using a GoPro or other camera to create a photo-mosaic image of the subtidal seafloor. It's a tall order and an ambitious project, but I think we can accomplish it.
One of the requirements of the project is to know which direction the ASV (autonomous surface vehicle) is pointed, so that it can turn towards the next waypoint before approaching it. (GPS does not provide heading data unless you're moving.) So an electronic compass module was in order. Now, my class has an extremely limited budget for equipment. So I went all erco and scoured eBay for bargain compass modules. Not unexpectedly, I found some HMC5883L modules for cheap. How cheap? Two dollars and change, compared to Parallax's nearly $30 module that uses the "same" chip. The best part was that I could use the same Spin objects that are used for Parallax's $30 compass modules. I ordered 16 of them for the class more than a month ago, and a few weeks later, they arrived via Hong Kong Post.
Fast forward to last Monday. 'Time to prepare the lesson for this week's Thursday and Friday classes, and "navigation by compass" was on deck. So I solder the headers onto all 16 modules, grab one, wire it up, and start to work on the new lesson. Wow! This thing works great! Imagine my giddiness at finding such a bargain! So I prepare an 11-page handout for the kids to use to calibrate their compass modules and even create an online website that takes their raw data and uses Fourier analysis to compute correction factors for the raw X/Y compass data so that an arctangent function can produce reliable heading results. I have never worked so long and hard on one lesson, nor been so happy with the results.
Thursday arrives, and I hand out the compass modules, some printed compass roses, a Silva backpacking compass for aligning their taped-down roses to magnetic North, and the student's worksheets. That's when things start to go downhill and spin out of control. First, the classroom's worktables are made of steel. (Mine are made of wood.) "North" for the students pointed in wildly different directions. Second, and significantly more troubling, several students started reporting that their compass modules were returning data with very low values or no data at all. So far, I've counted seven of the sixteen modules that are defective. There might be more that the students have not discovered yet.
Volunteer teachers without any real authority, like me, maintain a very tenuous grip on their students' attention. When things start to go wrong, that grip loosens pretty quickly. So it's imperative to come to class prepared with reliable equipment, even it you can't afford it, and an iron-clad plan for implementing it. eBay sensors might look like bargains, but caveat emptor still rules the day. And if a deal sounds to good to be true, it probably is. Where young minds are concerned, the lesson is to buy quality. In the long run, it's cheaper than the "bargain" alternative.
Addendum: Who knows what I got from China. Honeywell rejects? Counterfeit chips? The really bizarre aspect of this misadventure is that the defective chips all pass the internal self-test. And this isn't some phony, simulated test either. The chip uses a 10mA current to create its own internal magnetic field against which the sensor is tested. The bad ones all passed. Yet, when the internal field is turned off, they're blind to the Earth's magnetic field.
Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery