[From the last episode: We saw how a gyroscope measures rotation acceleration.]
There’s one more sensor we should look at before we take a step back: the magnetometer. This measures a magnetic field. There are lots of ways in which this can be useful, but we’re going to focus specifically on sensorsA device that can measure something about its environment. Examples are movement, light, color, moisture, pressure, and many more. that measure your orientationThe direction someone or something is facing. This may be different from the direction of motion. with respect to the earth’s magnetic field.
Yes, I said “orientation.” I know, I know: that’s what gyroscopesA sensor that detects when it changes direction. are for. So why do we need this? Bear with me for a minute – let’s talk about this sensor first, and then we can start talking about which sensors help when and – most importantly – how they might work together.
The earth has a distinct, if weak (relative to refrigerator magnets) magnetic field. There’s one pole up near the geographic north pole; the other pole is near the geographic south pole. Yes, near, not at. If you’re trying to use, for instance, a simple hand-help compassIn its electronic version, a magnetometer that has its reading compensated by a tilt meter (done by an accelerometer). way up above the arctic, it’s likely to point you in the wrong direction if you’re trying to get to the geographic north pole.
But most of us don’t go orienteering up there, so let’s not worry about that and restrict our considerations to temperate and tropical zones.
There are actually quite a few ways to measure a magnetic field. And many of them are electric, since electricity and magnetism are two faces of a single phenomenon, electromagnetism. That means that, strictly speaking, we might not need classic MEMS technology at all: we can use wires and circuits.
Here’s one example of a magnetic sensor. It’s called a Hall-effect sensor. It’s based upon the fact that electronsA fundamental particle found outside atoms. It carries a negative charge. It can move easily in a conducting material, which gives rise to electrical current. feel a magnetic field, although, unintuitively, the magnetic field doesn’t push and pull directly on the electrons; it makes them go sideways.
Making a Wire
A currentThe amount of electrical flow. Measured in amperes or amps (A). in a wire is really a flow of electrons through the metal. We think of a wire as being this uniform cylindrical thing, but, especially on an integrated circuitAn electronic device made on a piece of silicon. These days, it could also involve a mechanical chip, but, to the outside world, everything looks electronic. The chip is usually in some kind of package; that package might contain multiple chips. "Integrated circuit," and "IC" mean the same thing, but refer only to electronic chips, not mechanical chips., it’s more of a flat thing. That’s because, as we saw, we can dig a groove for the metal to go in, deposit the metal, and then literally grind away the excess – leaving a long, rectangular wire in a trench. (There are other ways to make a wire, but they all tend to result in a rectangular cross section.)
Measuring Magnetism
Now we can run a current down that wire. For the purposes of this discussion, we can think of that current, which is made up of flowing electrons, as evenly distributed throughout that wire.
But here’s the thing: in the presence of a magnetic field, those electrons – and therefore that current – will get pushed to one side. Electrons have a negative charge, so if there’s more charge on one side than the other, then you end up with a voltageVoltage is what gets electrons to flow. It's analogous to water pressure, which gets water to flow. Voltage is measured in units of "volts." across the width of the wire. If you can measure that voltage, then you’re measuring how strong the magnetic field is.
(A note for any engineers reading this: yes, that magnet in the drawing has both north and south poles together. It’s not to be taken literally; it just indicates the presence of a magnetic field.)
So this works in the direction shown. Of course, a magnetic field could come from any direction, so you’d need three of these in all three directions to get a complete picture of things – just like we did with accelerometersA sensor that measures acceleration and deceleration. and gyroscopes.
Anomalies
One of the issues with a magnetometer is that it’s really hard to get a pure measurement of the earth’s magnetic field. Things nearby can affect the reading – like big, iron-rich rocks. Geologists literally take advantage of this to figure out what’s under the surface of the earth. On the other hand, if you’re using a sensitive compass inside a building and pass by the elevator bank, all those hunks of metal going up and down the shaft can affect the reading.
These are called magnetic anomalies, and you have to take them into account when interpreting the readings. If you have the luxury, you can take readings in several places to note where there might anomalies and to adjust your interpretation of the readings. But if you have a magnetometer in your phone (which you may well have) and it’s telling you where it thinks north is, it may or may not be correct.
In addition, magnetometersA sensor that detects magnetic fields -- from the earth or from anywhere else. can react more slowly than gyroscopes.
So, in preparation for our next discussion, let’s note some gotchas with each of the sensors we’ve looked at:
- Accelerometers: well, not much in the way of gotchas here.
- Gyroscopes: they consume energy and they drift over time.
- Magnetometers: they can be thrown off by anomalies and they may be slow to react.
Both of the last two have weaknesses. Can we use them together to get an overall better reading of our orientation? Can accelerometers help us lower powerThe rate of energy consumption. For electricity, it’s measured in watts (W).? Yes and yes. As we’ll see over the next couple of weeks.
Leave a Reply