• Milestones

    Bertrand Selva3 days ago 0 comments

    Milestone 1: Functional Platform & First Data Collection (8/12 weeks)

    • Make the mechanical assembly work, with two rotational degrees of freedom.

    • Write or adapt the driver for the PNI RM3100 magnetometer.

    • Develop the acquisition code and start collecting a first dataset.

    • Tune the Kalman filter on PC (using MATLAB) with the experimental data.

    • Implement the Kalman filter (as defined on PC) on the ESP32.

    • Set up the display using the LVGL library.

    • Test the device outdoors!
      (First milestone: have my own ultra-precise magnetometer.)

    Milestone 2: Deep Learning & Real-Time Detection (1 year)

    • Collect data over several months.

    • Train a neural network to correlate, for example, the “K factor” and my experimental measurements.

    • Deploy the trained network on the ESP32 for real-time inference.
      (Second milestone: personal solar storm detector!)

    Milestone 3: Power Optimization & Field Robustness (few weeks)

    • Power management: implement sleep cycles on the ESP32.

    • Reduce the number of acquisition cycles with movement, without degrading measurement quality.

  • Circular Breakout Board Carrier —Fits in 100mm PVC Tube

    Bertrand Selva3 days ago 0 comments

    This PCB is designed to host several breakout boards and to simplify the assembly of a device intended to fit inside a 100 mm PVC tube. Its circular shape allows for direct mechanical integration into the lower part of the enclosure, with no wasted space.

    Key features:

    • ESP32-S3 (WROOM module) mounted on headers, making replacement or reprogramming easy.

    • u-blox NEO-M6 GPS also mounted on headers (plus hot glue for mechanical security).

    • All other components (connectors, screw terminals, filters) are directly soldered for robustness.

    • Two separate ground planes: one for logic (ESP32, GPS, sensors), one for power (LM2596, servos), connected via a ferrite bead to limit electrical noise between sections.

    • LM2596 regulator to provide 5V required by the servos.

    • Connector for SPI display (ILI9341 controller).

    • SD card reader for data logging.

    • Connector for a magnetometer sensor.

    • Screw terminals for servos, with MOSFETs for power cut-off.

    • USB and JTAG connectors for programming and debugging.

    This approach makes it easy to use standard modules (ESP32, GPS) while maintaining a solid, reliable structure suitable for integration in outdoor environments.

  • Update: Adding a Second Rotational Axis to Resolve Z-Axis Bias

    Bertrand Selva3 days ago 0 comments

    While revisiting the geometry and simulation of sensor excitation, I realized that rotating the sensor around the (1,1,1) axis is not sufficient to fully resolve the sensor bias — especially the component along the Z axis.

    A single degree of freedom in rotation doesn’t provide enough information to separate sensor bias from the actual field vector in all three dimensions. In particular, the Z component remains insufficiently excited during this motion, making it difficult to reliably estimate its offset through averaging or Kalman filtering.

    To overcome this, I’ve decided to add a second rotational axis. A second servo motor will be integrated into the base of the rotating assembly, and its motion will be transmitted to the upper turret via GT2 belts.

    Mechanically, this second axis will rely on an aluminum shaft and a bronze sleeve, press-fitted into a PLA structure. This ensures mechanical rigidity while avoiding paramagnetic or ferromagnetic materials in motion near the sensor, which could otherwise corrupt the magnetic readings.

    This upgrade should allow the sensor to explore a much larger portion of the 3D orientation space, improving the ability to identify and compensate for biases on all axes, including Z.

  • Next Step: Designing the PCB

    Bertrand Selva05/08/2025 at 14:31 0 comments

    The PCB, with a circular shape, will sit at the bottom of the system and will include:

    • an ESP32-S3,

    • a MOSFET transistor (IRLZ44N ?) to cut the servo’s power supply (minimizing disturbances during measurements),

    • a NEOM9 GPS to timestamp and precisely geolocate the readings,

    • connectors for the sensor, servo, and a 2.8-inch touchscreen with a 9344 controller.

    🙏 A big thank you to PCBWay, who agreed to support this project and help along the way!

  • Reboot, Finding a Better Sensor : the PNI RM3100

    Bertrand Selva05/08/2025 at 14:21 0 comments



    Eventually, after revisiting the literature, I found another sensor, the PNI RM3100 (a bit more expensive, ~€30 on AliExpress), characterized by:
    ✅ very low thermal drift,
    ✅ very low pink noise,
    ✅ and, most importantly, a native RMS noise of just 13 nT.

    And that reignited the project!
    Here’s my plan:
    1️⃣ Still use the statistical approach: 1,000 measurements → noise reduced to about 0.4 nT.
    2️⃣ Rotate the sensor around the (1,1,1) axis to eliminate internal biases.
    3️⃣ Design a waterproof, robust enclosure capable of long-term outdoor measurements.

    For points 1 and 2, I plan to implement data fusion with a Kalman filter directly embedded in the microcontroller, like I had already done in this Hackaday project.

    Current Status: CAD and Mechanics

    I’ve already purchased the sensor (not yet received) and completed the CAD for the mechanical parts.
    The setup is designed to fit inside a 100 mm diameter wastewater pipe, offering both waterproofing and low cost.

    Instead of NEMA17 motors (which generate too much magnetic disturbance due to their strong permanent magnets), I chose a GM995 servo, much smaller.
    I also took care to minimize metallic parts in the assembly. Remaining metallic components include:

    • small 623ZZ bearings (to relieve the servo and ensure guided rotation),

    • and some metallic screws, but fixed relative to the frame (thus creating a static, acceptable perturbation).

  • First Attempt: the MEMS sensor MMC5603

    Bertrand Selva05/08/2025 at 14:16 0 comments

    I first explored low-cost MEMS sensors and came across the MMC5603, advertised with an RMS noise of 400 nT. I even wrote an ESP32-compatible library: available here.

    My idea was simple: use a statistical approach → take massive numbers of measurements to reduce the noise. For example, 10,000 measurements lower the variance by a factor of 10,000, and thus the standard deviation by a factor of 100 (thanks, law of large numbers!). It’s a technique I had already used to measure Earth’s rotation with BMI160 sensors: explained here (FR).

    So, on paper, by running 40,000 measurements (at 100 Hz → 100 seconds of measurements with 4 sensors in parallel), I should be able to reduce the noise from 400 nT to 2 nT. Bingo, right? Well… no.

    While digging through the literature, I found Marcel Ochsendorf’s thesis: Development of a Permanent Magnet Characterisation Framework for Use in Low-Field MRI Systems.

    He reports that the MMC5603NJ, in the context of ultra-low-field nuclear magnetic resonance (using the Earth’s magnetic field), exhibits a background noise of 15 nT, mostly due to 1/f noise.

    And here’s the big problem: the statistical approach works well with white (Gaussian) noise, but not with 1/f noise. In this case, averaging does not reduce the standard deviation following the usual  1 / sqrt(N)

  • First Step: Building Mechanical Parts of a High-Precision Magnetometer

    Bertrand Selva05/08/2025 at 14:14 0 comments

    I’ve been dreaming for a long time about building a magnetometer precise enough to capture fine variations in the Earth’s magnetic field:

    • the daily variations linked to circadian cycles,

    • small local anomalies caused by buried metallic objects,

    • and, of course, the disturbances triggered by solar activity.

    In the long run, I’d like to pair this magnetometer with an automated monitoring system capable of detecting solar storms, since they strongly disturb the magnetosphere and can be detected locally. Maybe I’ll even embed a small neural network directly on the ESP32 to analyze the time series data (I’ve already done something similar in another context, for example predicting frost events using a small weather CNN: https://selvasystems.net/deep-learning).

    But I quickly discovered this isn’t an easy measurement.
    To give an idea:

    • at my latitude, the Earth’s magnetic field is about 50,000 nT;

    • the daily variations are roughly harmonic, with an amplitude of about 10 nT, mainly due to the absence of solar radiation at night;

    • a metallic object buried 1 m deep (for example, a large piece of steel) can cause a local disturbance of a few nT;

    • and solar storms, depending on their intensity, can influence the field up to a few µT.

    This kind of measurement is, in fact, almost impossible today for an individual. Normally, you’d need either a proton magnetometer (which measures total intensity but is heavy, fragile, and expensive) or a fluxgate magnetometer (precise, sensitive, but costly and not easily accessible). Trying this with low-cost MEMS components is a real challenge.