The magnetic field created by a current


To see how currents running through wires can create magnetic fields, and how the strength of those magnetic fields depends on distance from the wire.

What's the Point?

Even if you don't have a magnet, you can still create a magnetic field. The current passing through a wire will create a magnetic field near the wire. Ampere's Law can help you to figure out the strength of such a field in some circumstances.

Background Reading

Cutnell and Johnson, Chapter 21.7



Set up a current through a straight section of wire
Find one of the very long patch cords, plus an ordinary cord. Connect them to a power supply so that there's a straight section at least two feet long which sits as far from the power supply as possible, like this:

Weigh down the long patch cord with tape, books or other items so that it won't move around on the table.

Turn on the power supply. Because the patch cords provide only a very small resistance, a large current will run through them. The power supply's built-in current limiter should activate -- you'll see the red bulb above "C.C." light up -- preventing the current from rising too high. Set the toggle button on the front of the power supply to the "Low" setting. Use the ammeter display on the power supply to read the current running through the wire. Adjust the power supply so that the current running through the wire is as close to 3 Amps as you can make it; do not go over 3 Amps.

Prepare the magnetic field probe
Turn on one of the lab computers, and connect it to the Vernier controller. Plug in the magnetic field probe. Make sure that the toggle switch on the probe's black box is set to "Amplification = high x200". Start the Logger Pro program, and prepare to acquire data in the following manner: 20 samples per second, for 3 seconds. Verify that you can collect a set of data with the probe just sitting anywhere on the table. Use the Statistics function of Logger Pro to calculate the mean value of the magnetic field. What are the units?

Place the probe so that it lies parallel to the straight section of the wire. Twist the probe so that the white dot is pointing straight up, as shown. It may help to have one person look at the probe end-on in order to determine when the flat portion of the probe tip is exactly horizontal.

When the current is flowing, it will create a magnetic field around the wire. Which way will the magnetic field point? Indicate the direction of the magnetic field near the position of the probe in the figure above.

Measure the magnetic field when the power supply is turned off; you are detecting a "background" consisting of the Earth's magnetic field as well as components generated by electrical appliances in the room. Then turn the power supply on and measure the field again; your probe now detects the "background" plus the field generated by the current running through the wire. The difference between the two readings is the magnetic field created by the current in the wire alone.

Measure the magnetic field strength at a range of distances
You may have noticed that the magnetic field probe is very sensitive to its exact location and orientation. You are going to move the probe to different places near the wire, and that will cause the baseline reading of the probe to change. Go ahead and move the probe around on the tabletop, and watch its reading vary. How large are the changes from place to place?

In order to determine only the magnetic field produced by the wire, and not the changes in the ambient magnetic field, you need to make a differential measurement like so:

Start with the probe on the side of the wire away from the power supply. Place it a distance of r = 12 cm and measure the field strength B. Write down your results. Then acquire more measurements at distances r of 10, 8, 6, 4 cm.

Move to the other side of the wire
So far, the probe has always been on the same side of the wire, on the side far away from the power supply. What will happen if you move the probe to the other side, so it sits between the wire and the power supply? Predict the measurement you will obtain at a distance of 4 cm away from the wire on that other side.

Now, actually move the probe to the other side of the wire. Make sure that the white dot still faces straight up, and make the measurement. Was your prediction correct? If not, can you explain what changed as you moved the probe from one side of the wire to the other? Perhaps it would help to draw the direction of the magnetic field on both sides of the wire in the diagram above....

Make measurements on this other side of the wire at the same set of distances: 4, 6, 8, 10, 12 cm.

Analyze your results graphically

Start by drawing axes on the graph paper provided. Place "Distance from the wire" on the horizontal axis, and "Strength of magnetic field" on the vertical axis. Use the absolute value of the magnetic field strength, so that all your measurements become positive numbers; do the same for your distances, too, if you recorded distances on the two sides of the wire with different signs. Figure out how large you'll have to draw each axis to contain all of your measurements, plus leave a little room for clarity.

Plot all your measurements on this graph. You should have two values at each distance, one from each side of the wire.

Now, how can we compare the models to the data on this graph? We will normalize all three mathematical functions,

             B  =  k1 / r^2

             B  =  k2 / r

                         - r 
             B  =  k3 * e
so that they match the graph exactly at one point, somewhere in the middle of the range. We'll use r = 4 cm as the point in common. Calculate the average value of your magnetic field strength at this distance. For each of the three functions,

If one of the mathematical models is a good match to reality, then it ought to follow the actual measured values pretty closely. All of the lines will run through the data at r = 4 cm, but which of them does the best job of matching the data at other distances?


  1. Which of the three functions was the best fit to the actual strength of a magnetic field created by a long, straight wire? Is there another function you can devise which is fits the data better than any of the three?

  2. Can you find any equation in your textbook which relates the current through a long wire to the magnetic field going around it? Does this equation have the same dependence on distance r as you determined empirically?

    The equation in your textbook includes a number of factors which your empirical function lumped together as a single constant (k1 or k2 or k3). In a perfect universe, those factors would exactly equal your empirical constant; in other words, if you plugged into the textbook equation the values for the current through the wire, etc., you'd end up with exactly the magnetic field strength you actually measured.

  3. How close does the textbook equation come to predicting your measured magnetic field values? Plot the textbook values as you plotted your measured values. Do you see a simple offset difference between the textbook values and your data, or a slope difference, or both? Calculate the percentage error between your measurement at r = 4 cm and the textbook's claim.

  4. The most likely cause of this error is the absolute calibration of the magnetic field probes. Is your probe set to be too sensitive (gives a reading larger than the textbook prediction at r = 4 cm), or not sensitive enough (gives a reading smaller than the textbook prediction). Check with other groups in the room. Are all the probes mis-calibrated in the same direction, and/or by roughly the same amount?

Last modified 5/13/2004 by MWR