We are now required to collect sales tax in several states. Learn more about tax exempt status for your business.
 
All orders placed & paid online by 1PM ET (M-F) will be shipped the same day!
Details

Make a Magnetometer

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.

Built around an off-the-shelf, inexpensive sensor

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.

This part is available from many online electronics parts vendors, such as Jameco, Mouser, Digikey or Newark.

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.

Materials needed:

  1. Allegro A1302 Ratiometric Linear Hall Effect Sensor IC
  2. USB cable: steal one from an old device, as long as it has the plug that goes into your PC’s USB port.
  3. Resistors: a few values.
  4. Multi-meter: Use a multi-meter you might already own, which measures voltage.

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.

Circuit Design 1A

Circuit 1A

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:

Vout (V) Gauss (G)
0.2 -1769
0.3 -1692
0.4 -1615
0.5 -1538
0.6 -1462
0.7 -1385
0.8 -1308
0.9 -1231
1 -1154
1.1 -1077
1.2 -1000
1.3 -923
1.4 -846
1.5 -769
1.6 -692
1.7 -615
1.8 -538
1.9 -462
2 -385
2.1 -308
2.2 -231
2.3 -154
2.4 -77
2.5 0
 
Vout (V) Gauss (G)
2.6 77
2.7 154
2.8 231
2.9 308
3 385
3.1 462
3.2 538
3.3 615
3.4 692
3.5 769
3.6 846
3.7 923
3.8 1000
3.9 1077
4 1154
4.1 1231
4.2 1308
4.3 1385
4.4 1462
4.5 1538
4.6 1615
4.7 1692
4.8 1769

Circuit Design 1B – Make the zero field strength read zero on the meter!

Circuit 1B

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.

Vout (V) Gauss (G)
-2.3 -1769
-2.2 -1692
-2.1 -1615
-2 -1538
-1.9 -1462
-1.8 -1385
-1.7 -1308
-1.6 -1231
-1.5 -1154
-1.4 -1077
-1.3 -1000
-1.2 -923
-1.1 -846
-1 -769
-0.9 -692
-0.8 -615
-0.7 -538
-0.6 -462
-0.5 -385
-0.4 -308
-0.3 -231
-0.2 -154
-0.1 -77
0 0
 
Vout (V) Gauss (G)
0.1 77
0.2 154
0.3 231
0.4 308
0.5 385
0.6 462
0.7 538
0.8 615
0.9 692
1 769
1.1 846
1.2 923
1.3 1000
1.4 1077
1.5 1154
1.6 1231
1.7 1308
1.8 1385
1.9 1462
2 1538
2.1 1615
2.2 1692
2.3 1769

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.

Circuit Design 1C – Make 1,000 Gauss Appear as 1V on the Meter

Circuit 1C

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.

What is this makeshift magnetometer capable of?

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.

What is it good for?

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:

  • Measuring the strength of a magnet by measuring the magnetic field strength at a fixed distance from the surface
  • Evaluate the effectiveness of shielding by measuring field strength before and after adding shielding to an assembly.
  • Help visualize the strength and direction of a magnetic field.

Cautions and common questions:

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.

Need a more capable instrument?  Consider these instruments: Here’s links to Trifield, Lakeshore and Magnet-Physics.

 

 

 

 





Full Article List: