>>13635796I just recently did this in Physic. What you need are:
-A compass
-A roll of thin copper wire looped into a coil
-A power suppy (voltage doesn't matter) with setting for variable electrical current adjustment that go into precision ~ 0.01A.
-A ruler
Steps:
-You loop the copper wire into a coil (take notes of how many turns you loop, the less loops you do, the more current you have to pump in). You will need around 0.01-0.2A for 40loops, maybe 0.02A-0.4A for 20loops, etc...
-You put the compass in the middle of the coil
-Pump some electricity through the coil, vary the Amp to see how the needle change.
Formula/Theory:
-By pumping electricity through and controlling for Amp, you create a magnetic field within the coil that influence the compass. This is represented in a formula of:
Magnetic field= (1.257*10^-6)*(number of loop)*(Electrical current)/(length/diameter of coil)
Length/diameter of coil is basically choose whichever is higher
Once you worked out the magnetic field of the coil, you can use Pythagoras to workout the Earth magnetic field. If no electricity is flowing, the compass is basically pointing to the Earth natural magnetic field