Skip to the content
PCBKitNew board
2 layers65 × 30 mmMGFieldHAT, the printed circuit board in 3D

Magnetic field measurement software (This software was developed for OCISLY - for more details, please contact OCISLY-ds) - Public dashboard available at https://dashboard.zyzonix.net/

Size
65 × 30 mm
Copper layers
2
Thickness
1.6 mm
Parts
12
Nets
31
Pads
68
Tracks, vias
70, 0
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
26 Apr 2021
Updated
24 Apr 2025

Overview

MGFieldHAT is an open-source printed circuit board by Zyzonix, from the Zyzonix/mgfield repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 65 × 30 mm with 12 parts on 31 nets, routed with 70 tracks and 0 vias.

It is built around the ADS1115. It belongs with the sensors and measurement boards of this library.

Main components

1

README

README.md

mgfield - Magnetic field measurement

This software has been developed with OCISLY-ds to measure magnetic fields with a Raspberry Pi. For more details, please contact OCISLY-ds.

OS-Type [blocked] Python-Version [blocked]

Installation

This software is designed to be run on a Raspberry Pi! First navigate to /opt/:

text
cd /opt

Then install all required APT-packages:

text
sudo apt install mariadb-server git 

If required, also install phpmyadmin and libapache2-mod-php to make PHP work with Apache. After that clone the repository:

text
git clone https://github.com/Zyzonix/mgfield.git
cd mgfield/

Now all required software is downloaded.

To install the service type:

text
sudo cp services/mgfield.service /etc/systemd/system/

Enable the service with:

text
sudo systemctl enable mgfield.service

Install required python packages:

text
sudo apt install python3-psutil i2c-tools libgpiod-dev python3-libgpiod ./packages/* 

The usage of pip3 depends on your system's configuration. Python packages on some systems like Debian are managed via apt.

text
sudo pip3 install mysql-connector

Install additional python packages for physical sensor:

text
pip3 install --upgrade RPi.GPIO adafruit-blinka
pip3 install adafruit-circuitpython-ads1x15

Create config directory and move config file:

text
sudo mkdir -p /home/root/.config/
cp config.json /home/root/.config/

And finally create the logfile directory:

text
sudo mkdir -p /var/log/mgfield/

Execution

Directly over the console (the programm will interrupt when the window will be closed)

text
python3 main.py

Or via the system service

text
sudo systemctl start mgfield.service

To view the current status use:

text
sudo systemctl status mgfield.service

To view the log/consoleout in realtime use:

text
sudo journalctl -u MGField.service

Settings

The software can be configured through the config-file named config.json.

  • Thereby that collecting all values from each measurement (x, y, z and out) might be to heavy for a Raspberry Pi, there's a switch called storeAllRawData in the config that can be used to en-/disable the storing of this data.
  • Also a specific path to the temperature sensor must be provided config. If the device can't be opened the return value of the sensor will be 0.00. The right format of the sensor's path is for example: /sys/bus/w1/devices/28-01204b515089/w1_slave

SQL Value Meanings

Each table contains two rows:

Value NameMeaning/Use type
time_utcTimestamp of value in UTC
time_localTimestamp of value in local time (Europe/Berlin/ +02:00)

All other values are table-specific:

TableValue NameMeaning/Use type
mgfieldx_valueX-Value per measurement
mgfieldy_valueY-Value per measurement
mgfieldz_valueZ-Value per measurement
mgfieldout_valueOUT-Value per measurement
mgfieldmeasurement_durationTime delta of the single measurement
netstatshostnameLocal hostname from /etc/hosts
netstatslocal_ipLocal IP
netstatspackets_sentPackets sent
netstatspackets_recvPackets received
netstatserrinIncoming packets with errors
netstatserroutOutgoing packets with errors
netstatsdropinDropped incoming packets
netstatsdropoutDropped outgoing packets
netstatstarget1Any target configured to be pinged
netstatstarget2Any target configured to be pinged
netstatstarget3Any target configured to be pinged
sysstatscpu_speedCPU Speed in MHz
sysstatscpu_usageCurrent CPU usage in %
sysstatscpu_ctx_switchesCPU CTX Switches
sysstatscpu_interruptsCPU interrupts since last boot
sysstatscpu_soft_interruptsCPU soft interrupts since last boot
sysstatsram_totalTotal RAM in MB
sysstatsram_freeFree RAM in MB
sysstatsram_usedUsed RAM in MB
sysstatsram_cachedCached RAM in MB
sysstatsram_free_wcache_percFree RAM in % with cache
sysstatsram_free_wocache_percFree RAM in % without cache
sysstatscpu_thermalRaspberry Pi's CPU Temperature
sysstatsuptimeUptime since last reboot in seconds
temperaturetemperature_valueCurrent temperature in °C

This software was earlier named MGFieldPy.

Parts

12
QtyValueFootprintReferences
4MountingHole_2.7mm_M2.5MountingHole:MountingHole_2.7mm_M2.5MH1, MH2, MH3, MH4
2TO-92-TO92127P495H2044-3DS18B20 Footprint Symbol:TO-92-TO92127P495H2044-3DS18B20, DS18B20
1ADS1115Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalADS1115
1GPIOConnector_PinSocket_2.54mm:PinSocket_2x20_P2.54mm_VerticalHeader
1Resistor 4.7kResistor_SMD:R_0805_2012Metric4.7k
1SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mmConnector_Wire:SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mmFLC3-70

The 10 most common of 12 parts.

Questions

How big is the MGFieldHAT PCB?

It measures 65 × 30 mm and has 2 copper layers, 1.6 mm thick.

What parts does the MGFieldHAT use?

12 parts, built around the ADS1115. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the MGFieldHAT KiCad files?

From the Zyzonix/mgfield repository on GitHub, at the commit this page was made from: the board is arch/MGFieldHAT.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the MGFieldHAT design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers168.9 × 123.3 mmOEM ECU, the printed circuit board in 3D

    OEM ECU

    aeonSolutions/AeonLabs-AI-Volvo-MKII-Open-Hardware

    Volvo MKII Open Hardware

    296 parts161CC0-1.0
  • 2 layers94 × 79 mm5 - Lizard Car, the printed circuit board in 3D

    5 - Lizard Car

    TRD-B/Lizard

    3D printed RC race car with custom electronics

    54 parts129CC-BY-4.0
  • 2 layers54.6 × 33 mmJuntekOnSteroidsTTGO, the printed circuit board in 3D

    JuntekOnSteroidsTTGO

    rin67630/Drok-Juntek-on-steroids

    Extend the possibilities of cheap digital power supplies with a WiFi module

    35 parts62
  • 2 layers155 × 70 mmPayphone v1, the printed circuit board in 3D

    Payphone v1

    sdylewski/Analog-Redial

    A circuit board for old telephones to come back to life. Plug one or two phones in, and you can call the other phone, use bluetooth, connect to others via voip, and do a variety of other things with a plain old rotary…

    137 parts46
  • 2 layers32.4 × 33 mmOpenXsensor, the printed circuit board in 3D

    OpenXsensor

    Ingwie/OpenAVRc_Hw

    OpenAVRc Hardware and addons

    40 parts26
  • 2 layers33.9 × 90 mmBiasPro InputProtection v3, the printed circuit board in 3D

    BiasPro InputProtection v3

    ToneAlchemy/BiasPro

    A professional-grade, dual-probe Arduino Bias Meter for guitar tube amplifiers. Open source hardware & firmware

    18 parts16MIT
  • 4 layers52.5 × 59.7 mmESPHome Indoor Multi Sensor, the printed circuit board in 3D

    ESPHome Indoor Multi Sensor

    mikelawrence/esphome-indoor-multi-sensor-hardware

    ESPHome Indoor Multi-Sensor hardware. This design supports Radar/PIR Presence, Temperature, Humidity, Pressure, Light, CO2, CO, VOC, NOX and PM sensors.

    113 parts14CERN-OHL-P-2.0
  • 4 layers260 × 113 mmCellKeeper, the printed circuit board in 3D

    CellKeeper

    cellkeeper-bms/cellkeeper-hardware

    PCB for the CellKeeper BMS

    480 parts11GPL-3.0