Fuel Tank Trainer Calibration Manual

Part 1: Quick Start Guide

1. Wi-Fi Connection & Access

The system hosts its own wireless network to provide a visual calibration dashboard. Please follow these steps to connect:

2. Startup Sweep Self-Test

3. Calibration Workflow

  Figure 1                                                               Figure 2

Part 2: Technical Reference

1. Hardware Pin Configuration

The hardware input/output mapping is defined as follows:

2. HTTP API Protocol

The built-in Web Server provides RESTful HTTP GET endpoints for front-end interaction:

API Endpoint

Parameters

Description

/status

None

Retrieves a JSON payload containing all current ADC, PWM, and configuration parameters.

/setTank

id(0-3), e(empty), m(mid), f(full)

Saves the 3-point ADC calibration values for the specified tank to NVS memory.

/setGauge

id(0-4), min(minimum), mid(middle), max(maximum)

Saves the 3-point PWM calibration values for the specified gauge to NVS memory.

/calibrate

id(0-3), type('empty'|'mid'|'full')

Commands the system to record the current real-time ADC value as the specified calibration type.

/test

None

Triggers the global 5-second gauge sweep test animation.

3. JSON Payload Memory Map

When the front-end calls the /status endpoint, the system returns a JSON payload structured as follows:

JSON

{
 "tanks": [
   {"adc": 2048, "e": 20, "m": 2000, "f": 4000},
   {"adc": 1500, "e": 50, "m": 1800, "f": 3800},
   {"adc": 0, "e": 20, "m": 2000, "f": 4000},
   {"adc": 0, "e": 20, "m": 2000, "f": 4000}
 ],
 "gauges": [
   {"pwm": 200, "min": 40, "mid": 200, "max": 410},
   {"pwm": 150, "min": 50, "mid": 210, "max": 420},
   {"pwm": 40, "min": 40, "mid": 200, "max": 410},
   {"pwm": 40, "min": 40, "mid": 200, "max": 410},
   {"pwm": 0, "min": 40, "mid": 200, "max": 410}
 ]
}

Parsing Guide:

4. Mapping Algorithm

The system eschews simple linear mapping in favor of a Midpoint-based piecewise linear interpolation. The algorithm automatically detects whether the sensor utilizes forward resistance (Empty -> Full = resistance increases) or inverted resistance (Empty -> Full = resistance decreases):

April 2026

REV A

docs.hycdgx.com