config.txt Reference
The config.txt file is a plain-text configuration file stored on the FGA Logger SD card. It lets you apply sensor calibration parameters and adjust operating settings without reflashing firmware.
Configuration is loaded once at startup when you power on the device while holding the multifunction button.
config.txt configuration requires firmware v1.0.4 or later. Configurable output rate requires v1.0.5 or later.
File Location
Place config.txt in the root directory of the FAT32-formatted SD card.
File Format
- One parameter per line
- Format:
PARAMETER=value - No spaces around the
=sign - Lines beginning with
#are treated as comments and ignored - Parameters are case-sensitive
Example:
# FGA Logger configuration
S1_X_OFFSET=128.5
S1_X_GAIN=1.0
S1_Y_OFFSET=-45.0
S1_Y_GAIN=1.0
S1_Z_OFFSET=0
S1_Z_GAIN=1.0
Parameter Reference
Sensor 1 Calibration
| Parameter | Type | Default | Description |
|---|---|---|---|
S1_X_OFFSET | float | 0 | X-axis offset correction for sensor 1 (nT) |
S1_Y_OFFSET | float | 0 | Y-axis offset correction for sensor 1 (nT) |
S1_Z_OFFSET | float | 0 | Z-axis offset correction for sensor 1 (nT) |
S1_X_GAIN | float | 1.0 | X-axis gain multiplier for sensor 1 |
S1_Y_GAIN | float | 1.0 | Y-axis gain multiplier for sensor 1 |
S1_Z_GAIN | float | 1.0 | Z-axis gain multiplier for sensor 1 |
Sensor 2 Calibration
| Parameter | Type | Default | Description |
|---|---|---|---|
S2_X_OFFSET | float | 0 | X-axis offset correction for sensor 2 (nT) |
S2_Y_OFFSET | float | 0 | Y-axis offset correction for sensor 2 (nT) |
S2_Z_OFFSET | float | 0 | Z-axis offset correction for sensor 2 (nT) |
S2_X_GAIN | float | 1.0 | X-axis gain multiplier for sensor 2 |
S2_Y_GAIN | float | 1.0 | Y-axis gain multiplier for sensor 2 |
S2_Z_GAIN | float | 1.0 | Z-axis gain multiplier for sensor 2 |
Sensor 2 parameters only apply when a second sensor is connected to the B2 input.
How Calibration Is Applied
The firmware applies calibration to each axis value using:
corrected = (raw_value - OFFSET) * GAIN
For example, for the X axis of sensor 1:
B1x_corrected = (B1x_raw - S1_X_OFFSET) * S1_X_GAIN
This applies before the value is written to CSV or streamed over serial.
Loading Configuration
- Write your
config.txtto the root of the SD card - Insert the SD card into the FGA Logger
- Hold the multifunction button and power the device ON
- The LEDs will light on/off in sequence to confirm the file was read
- Connect via USB serial to verify — the console will output the loaded parameter values:
Config: reading from SD card
config.txt found.
Input 1: Offset(x,y,z): 128.5, -45.0, 0.0
Gain(x,y,z): 1.00000000, 1.00000000, 1.00000000
Calibration parameters are stored permanently inside the logger. You do not need to keep config.txt on the SD card after loading — the values persist across power cycles and firmware updates.
Full Example config.txt
# FGA Logger configuration file
# Requires firmware v1.0.4 or later
# --- Sensor 1 calibration ---
S1_X_OFFSET=128.5
S1_X_GAIN=1.0
S1_Y_OFFSET=-45.0
S1_Y_GAIN=1.0
S1_Z_OFFSET=22.0
S1_Z_GAIN=1.0
# --- Sensor 2 calibration (if connected) ---
S2_X_OFFSET=40
S2_X_GAIN=1.0
S2_Y_OFFSET=50
S2_Y_GAIN=1.0
S2_Z_OFFSET=60
S2_Z_GAIN=1.0
Troubleshooting
Parameters not loading
- Verify the file is named exactly
config.txt(lowercase) in the root of the SD card - Ensure the SD card is FAT32-formatted
- Confirm you are holding the multifunction button before powering on — releasing it too early will skip config loading
- Check the serial console output to see which values were loaded
Unexpected measurement values after loading
- Reset calibration by setting all OFFSETs to
0and all GAINs to1.0, reload the config - If the problem persists, re-flash the firmware and reload
Related Pages
- Calibration Procedure — step-by-step guide to measuring and calculating offset values
- Firmware Updates — firmware versions that introduced config.txt support