3-Axis Magnetic Field Sensor


Introduction: 3-Axis Magnetic Field Sensor

About: I'm a graduate student at Utah State University. My primary research areas are Wireless Power Transfer and Power Electronics.

Wireless power transfer systems are well on their way to replacing conventional wired charging. Ranging from tiny biomedical implants all the way to wirelessly recharging huge electric vehicles. An integral part of the research on wireless power is minimizing the magnetic field density. The International Commission on Non-Ionizing Radiation Protection (ICNIRP) provides scientific advice and guidance on the health and environmental effects of non-ionizing radiation (NIR) to protect people and the environment from detrimental NIR exposure. NIR refers to electromagnetic radiation such as ultraviolet, light, infrared, and radiowaves, and mechanical waves such as infra- and ultrasound. Wireless charging systems produce alternating magnetic fields which could be harmful for human beings and animals present in the vicinity. To be able to detect these fields and minimize them in a real-world test setup, a magnetic field measuring device like the Aaronia SPECTRAN NF-5035 Spectral Analyzer are required. These devices usually cost upwards of $2000 and are bulky and may not be able to reach narrow spaces where the field needs to be measured. Additionally, these devices usually have more features than required for simple field measurement in wireless power transfer systems. Hence, developing a smaller, cheaper version of the field measuring devices would be of great value.

The current project involves the design of a PCB for magnetic field sensing and also the design of an additional device that can process the sensed magnetic field values and display them on an OLED or LCD display.

Step 1: Requirements

The device has the following requirements:

  1. Measure alternating magnetic fields in the range of 10 – 300 kHz
  2. Measure fields accurately up to 50 uT (Safety limit set by ICNIRP is 27 uT)
  3. Measure fields in all three axes and get their resultant to find the actual field at a given point
  4. Display the magnetic field on a handheld meter
  5. Display a warning indicator when the field goes above the standards set by the ICNIRP
  6. Include battery operation so that the device is truly portable

Step 2: System Overview

Step 3: Choosing Components

This step is probably the most time taking step, requiring considerable patience to pick out the right components for this project. As with most other electronics projects, choosing components requires careful examination of datasheets to make sure all the components are compatible with each other and work in the desired range of all the operating parameters - in this particular case, magnetic fields, frequencies, voltages etc.

The major components chosen for the magnetic field sensor PCB are available in the attached excel sheet. The components used for the handheld device are as follows:

  1. Tiva C TM4C123GXL microcontroller
  2. SunFounder I2C Serial 20x4 LCD display
  3. Cyclewet 3.3V-5V 4 channel logic level converter bidirectional shifter module
  4. Push button switch
  5. 2 position toggle switch
  6. 18650 Li-ion 3.7V cell
  7. Adafruit PowerBoost 500 Charger
  8. Printed circuit boards (SparkFun snappable)
  9. Standoffs
  10. Connecting wires
  11. Header pins

The equipment required for this project are as follows:

  1. Soldering device and some solder wire
  2. Drill
  3. Wire cutter

Step 4: Circuit Design and Simulation


Step 5: Designing the PCB

Once the circuit operation is verified in LTSpice, a PCB is designed. Copper planes are designed in a way that they don't interfere with the working of the magnetic field sensors. The highlighted grey region in the PCB layout diagram shows the copper planes on the PCB. On the right, a 3D view of the designed PCB is also shown.

Step 6: Setting Up the Microcontroller

The microcontroller chosen for this project is the Tiva C TM4C123GXL. The code is written in Energia in order to make use of existing LCD libraries for the Arduino family of microcontrollers. Consequently, the code developed for this project can also be used with an Arduino microcontroller instead of the Tiva C (provided you use the right pin assignments and modify the code accordingly).

Step 7: Getting the Display to Work

The display and the micro-controller are interfaced via I2C communication which only requires two wires other than the a +5V supply and ground. The LCD code snippets available for the Arduino family of microcontrollers (LiquidCrystal libraries) have been ported and used in Energia. The code is given in the attached LCDTest1.ino file.

Some helpful tips for the display can be found in the following video:


Step 8: 3D Printing

An enclosure box for the handheld device is designed as shown in the image above. The box helps keep the boards in place and the wires undisturbed. The box is designed to have two cutouts for the wires to go through, one cutout for the battery indicator LEDs, and one each for the toggle switch and push button switch. The necessary files are attached.

Step 9: Interfacing All the Components

Measure the dimensions of all available components and lay them out using a graphical tool such as Microsoft Visio. Once the layout of the all the components is planned, it is a good idea to try and place them in their positions to get a feel of the final product. It is recommended that the connections be tested after each new component is added to the device. An overview of the interfacing process is shown in the images above. The 3D printed box gives a clean look to the device and also protects the electronics inside.

Step 10: Device Testing and Demonstration

The embedded video shows the device operation. The toggle switch turns on the device and the push button can be used to shuffle through the two display modes.



    • Make it Move Contest

      Make it Move Contest
    • Woodworking Contest

      Woodworking Contest
    • Casting Contest

      Casting Contest

    We have a be nice policy.
    Please be positive and constructive.