Make a magnetometer for under $10!
We describe one way to make a simple tool that can measure the strength and direction of a strong magnetic field near neodymium magnets, using off-the-shelf components and items you might already have.
There are a number of off-the-shelf electronic components that measure the strength of a magnetic field. They’re used in all sorts of devices, so the cost is very reasonable. We chose an Allegro A1302, a “Ratiometric Linear Hall Effect Sensor IC.” It’s commonly available for under $2.
The Hall Effect sensors we discussed in a previous article were simple on-off switches. When they “see” a magnetic field that’s strong enough, they switch on. Remove the magnetic field, and it switches back off.
The A1302 sensor operates differently; it is not an on/off switch. You supply it with power at 5 Volts, and it gives an output voltage that’s related to the magnetic field it sees. That's what "ratiometric" means: the voltage coming out of the sensor is directly proportional to the magnetic field it reads.
That’s it! That's all that's needed. We also used a soldering iron to solder wires together.
The next few sections describe how we wired this sensor to our multi-meter. If circuit design doesn't interest you, scroll past to where we show what the finished sensor can do.
To power the sensor, we need a steady 5 Volt supply. For something inexpensive, we used the end of an old USB cable. By plugging it into the front of a PC, we get a great 5 Volt supply.
A USB cable has 4 wires inside. Two of them are 5V and Ground, and the other 2 are for data (which we won’t use).
We soldered wires to the ends of the 3 pins on the sensor. Wire the ground pin to the ground wire of the USB cable (usually black), and Vcc to the 5V line (usually red).
By placing the two probes of a multimeter on points A and B of that circuit diagram, we can measure the raw voltage output of the sensor.
The output varies from 0 to 5 Volts, where the no-magnetic-field point is in the middle at 2.5 Volts. With no magnets nearby, you should see 2.5V.
When exposed to a magnetic field normal to (into) the flat face of the sensor, the voltage will vary away from that 2.5V midpoint. A conversion table to convert this voltage to a field strength expressed in Gauss looks like this:
While that setup does work, the output is somewhat less than intuitive. One has to do a lot of math in their head to convert the number on the meter to a field strength. It would be better if we could make the voltmeter read zero when there is no magnetic field, and give positive or negative values depending on the direction of the magnetic field.
We do this by adding a few resistors, as shown in Circuit 1B. By using 2 identical resistors, we can expect the voltage at a point between them (point C) to be 2.5V above ground. We chose resistors large enough to keep the current flow fairly low – the USB port on a PC can only supply so much power. We used two 330 Ohm resistors, for a current of about 7.5mA (only about 0.04 Watts).
Now, by placing the voltmeter on points C and B, we can see readings that are zero when there is no field. The meter is comparing the output voltage to 2.5V, instead of comparing the output voltage to ground. You still need a table to compare the numbers on the meter to actual field strength expressed in gauss, but at least zero equals zero.
Use the table, or divide the number on the meter by 0.0013 (Volts per Gauss). So, if you see 1 Volt, that’s 1 Volt / 0.0013 V/G = 769 Gauss.
As long as we’re fiddling with resistors, we might take this one step further. Some judicious use of a few more resistors can scale the number the meter shows, so that 1V = 1,000 Gauss. This we can read without having to do any math!
We used much larger resistor values in this leg, to minimize affecting what we’re measuring. We used 47,000 Ohm resistor for R3, and 11,000 (A 10k and a 1k) Ohm value for R4. You could use other values, but this ratio is what we needed to make 1 Volt on the meter correspont to 1,000 Gauss.
(How did we choose those values? Because in the "1B" circuit, 1.3V corresponded to a field strength of 1,000 Gauss. To make it work out, we wanted to measure about 1/1.3 or 77% of the voltage across that leg. Since 47 kOhms is about 80% of 47+11 kOhms, it works out.)
By placing the leads from our multi-meter on points C and D now, we get a number that relates to the field strength and is easily read. Now 1V equals 1,000 Gauss, 1.5V equals 1,500 Gauss, 2V equals 2,000 Gauss, etc.
This sensor can read field strengths up to about 1,750 - 2,000 gauss. If exposed to stronger magnetic fields, the sensor wouldn’t be damaged but the output is limited to or “pegged” at this number.
Below about 10 gauss you won’t get any reading at all. Consider the accuracy as decent but rough numbers. We wouldn’t use this as a calibrated setup to test magnet strength, but it’s a great way to study and compare the relative strength of magnetic fields.
A magnetometer is a great way to help see what a magnetic field is at a point. It's a good way to put some numbers to something that is otherwise invisible. There are a number of ways this might be used by hobbyists, magnetic enthusiasts, and engineers. Anytime you want to know the field strength at a point, it’s a great tool. Uses might include:
Don’t treat the readings as perfect numbers. The sensor only operates in a narrow range. You can find stronger field strengths near neodymium magnets. It also has a pretty rough tolerance. Note: the resistors we added to adjust the readings all have 5% tolerances. Expect your results to be in the right ballpark, but not calibrated or exact.
In fact, we used a variable resistor and tweaked that R4 value to get our device closer to reality.
You won’t see listed Surface Field numbers when pressing this sensor directly on the surface of a disc magnet. Why not? The actual sensing portion of the sensor is located about 0.5mm behind the face of it. When pressed against the magnet’s surface, the sensor actually measures the field strength at this 0.5mm distance, not at the surface. This can make a big difference in the values you see, especially with small magnets.
The sensor only senses the magnitude (strength) of the magnetic field along one axis. It senses magnetic field strength in the direction that’s into the flat surface of the sensor. Twisting it will change the direction you’re measuring.