The Caterham Oil Temperature Gauge: How to Build One and What's Next
Over the course of the last few posts, I've covered the development of a digital oil temperature gauge for my Caterham 420R. What started as a relatively straightforward electronics project has evolved into something rather more capable, with twelve different display layouts, fault detection, temperature alarms, a web interface and the ability to stream live measurements to other devices over Wi-Fi.
I've now made the source code, hardware designs and supporting documentation publicly available on GitHub, so anyone interested in the project can build their own.
In this post, I'll bring everything together, explain what you'll need to build one and walk through getting the software up and running. I'll also cover a change in direction for the project and explain why I've decided not to install this particular version in my 420R.
The story so far
If you're new to the project, the previous four posts cover its development in more detail, in summary they include;
An introduction to the oil temperature sender, how the electronics work and the development and testing of the hardware.
A look at the twelve different display layouts, including the use of colours, temperature alarms and fault indicators.
Wi-Fi, a Web Page and a Data Stream, extending the gauge beyond its own display, allowing temperatures to be viewed on a phone or streamed to a computer.
What does the gauge do?
The gauge makes use of the oil temperature sender already fitted to the dry-sump tank on the Caterham 420R, without requiring any modification to the sender or tank. The sender is essentially a resistor whose resistance changes with temperature. A small electronic module containing a 24-bit analogue-to-digital converter (ADC) measures this resistance, which the gauge's processor then converts into an oil temperature using a calibration table.
The result is presented on a 1.75-inch round AMOLED touchscreen.
Beyond simply displaying the oil temperature, the gauge provides;
Twelve selectable display layouts.
Temperature readings in Celsius or Fahrenheit.
A record of the maximum temperature reached during a session.
Configurable high and critical temperature alarms.
Continuous monitoring for sensor and wiring faults.
A web interface accessible from a phone or laptop.
Live telemetry streamed over Wi-Fi to other applications.
An important part of the design is ensuring that the information presented can be trusted. If the gauge detects a wiring fault or cannot reliably determine the temperature, it displays a fault rather than presenting a potentially misleading reading. Similarly, without a verified calibration for the temperature sender, the gauge will not display a temperature.
A change of direction
Although the current design is working on the bench, I've decided to take the project in a slightly different direction before fitting it to the Caterham. The next version will separate the measurement electronics from the display, creating two independent devices.
Sensing & Logging Unit
A dedicated ESP32-based device will connect to the ADAC and temperature sender, take the measurements, monitor for faults and record the data. Rather than driving a screen directly, it will make its measurements available over Wi-Fi.
Display
The display will remain the same Waveshare touchscreen, retaining the existing layouts and functionality. However, instead of measuring the temperature itself, it will receive live readings from the sensing unit. There are two principal reasons for making this change.
Greater flexibility when installing the hardware.
In the current design, the measurement electronics communicate with the display using a wired connection known as I²C. This is intended for relatively short distances, limiting the cable between the two to approximately 20 cm. Consequently, the measurement electronics need to be housed in a small enclosure close to the display. By separating the two and communicating wirelessly, I can position the sensing unit wherever makes most sense for the wiring to the dry-sump tank, whilst positioning the display wherever it is most convenient for the driver.
Separating measurement from presentation.
Having two independent devices means that the measurement and data logging functionality can operate independently of the display. Each can be developed, modified and tested without directly affecting the other. It also opens up some interesting possibilities. The same temperature readings could be received by the dashboard display, a laptop or even a second display, all at the same time.
Much of the groundwork for this is already complete. As covered in the previous post, the current firmware can transmit temperature readings, fault information, alarm status and the session maximum over Wi-Fi four times a second. The next version will build upon that capability.
Building your own gauge
For anyone interested in building the current version, everything required is now available on GitHub. Whilst I'm moving towards a different architecture for my own installation, the current design is available for anyone who would prefer a self-contained gauge with a wired connection to the measurement electronics. The following sections explain how to get started.
Downloading the software and hardware designs
The project is available here: Caterham Oil Temperature Gauge on GitHub
There are two ways to download the project.
Download as a ZIP file
Open the GitHub page, click the green Code button and select Download ZIP.
Once downloaded, extract the contents into a folder on your computer.
Download using Git
If you're familiar with Git, you can clone the repository using:
The advantage of using Git is that you can easily download subsequent updates using git pull.
I'd recommend placing the project in a directory without spaces in its path, such as C:\esp\ on Windows, as spaces can cause problems with the firmware build tools.
The repository is organised as follows:
Folder | Contents |
main/ | The software that runs on the gauge, including its configuration settings. |
hardware/ | Wiring instructions, hardware designs and bench-testing procedures. |
hardware/option-b/ | The current hardware design, component list, stripboard layout and PCB design. |
docs/ | Documentation covering calibration, installation, safety, Wi-Fi and telemetry. |
scripts/ | Supporting software, incthe calibration tool and a computer-based telemetry monitor. |
The project is released under the MIT licence, meaning you're free to use, modify and share it, provided the original copyright and licence notices are retained.
The project is supplied without warranty.
Core Components
There are a number of principal electronic components at the heart of the gauge.
Waveshare ESP32-S3-Touch-AMOLED-1.75
This is the round touchscreen display that also contains the processor responsible for running the gauge's software. It's available directly from Waveshare or from suppliers such as The Pi Hut in the UK. The software supports the standard version and the -B version, which comes with an enclosure. The 1.75C, GPS (-G) and 2.1-inch versions use different hardware and are not supported by this design.
Adafruit ADS122C04 24-bit ADC (product 6432)
This small electronic board is responsible for accurately measuring the resistance of the oil temperature sender. It's available from Adafruit and The Pi Hut, where it is listed as ADA6432. Availability can vary, so it's worth checking both suppliers.
Additional electronic components
A small number of resistors and capacitors are required to complete the measurement circuit. The reference resistor is particularly important, as the accuracy of every resistance measurement depends upon it. This is one component worth spending a little more on.
It's also important to use the specified C0G/NP0 capacitors rather than X7R alternatives, and not to exceed 100 nF.
Component | Quantity | Specification |
Reference resistor (Rref) | 1 | 2.00 kΩ, 0.1%, 25 ppm/°C or better, metal film |
Resistors (R1 and R2) | 2 | 2.2 kΩ, 1%, metal film |
Capacitors (C1 and C2) | 2 | 47 nF, C0G/NP0, 50 V, 2.5 mm lead spacing |
Other materials and accessories
A number of other components are also required to fit the gauage, some are listed below. Your particular approach my vary.
A piece of standard 0.1-inch stripboard.
Two 4-way, 2.54 mm screw terminal blocks.
An 8-way, 2.54 mm pin header.
Tinned copper wire for the stripboard connections.
A short four-core cable for connecting the electronics to the display.
0.5 mm² wire for the three connections to the oil tank.
A ring terminal and insulated spade connector.
A small insulated enclosure for the measurement electronics.
An ignition-switched USB-C power supply for the car.
A USB data cable for programming the display.
A multimeter for checking components and wiring.
A complete bill of materials, including supplier part numbers where available, can be found in hardware/option-b/BOM.md within the GitHub repository.
Building the firmware
Firmware is simply the software that runs directly on the gauge's processor. Rather than providing a ready-made firmware file, I've made the source code available. This allows you to customise the gauge, including its temperature alarms, Wi-Fi settings and temperature sender calibration. The process involves building the software on your computer and transferring it to the display over USB, a process commonly referred to as flashing.
Install the development tools
The gauge is developed using Espressif's ESP-IDF development framework, which is available for Windows, macOS and Linux. The easiest way to install it is using Espressif's ESP-IDF Installation Manager. When prompted to select a version, choose v5.5.5, as this is the version used to develop and test the gauge. Once installed, open a terminal configured for ESP-IDF, following the instructions provided by the installer.
For anyone using Fedora Linux, I've included my own setup instructions in docs/SETUP_FEDORA.md.
Open the project
Navigate to the directory where you've downloaded the project. For example, on Windows:
cd C:\esp\Caterham-Oil-Temperature-Gauge-ADS122C04Next, tell the development tools which processor the display uses:
idf.py set-target esp32s3This only needs to be done once. Running it again will reset the menu configuration to its defaults.
Configure the gauge
The gauge includes a number of configurable features, which can be accessed by running:
idf.py menuconfigI'll cover these settings in more detail in the next section, along with the configuration files for Wi-Fi and calibration.
Build the firmware
Once you've configured the gauge, run:
idf.py buildThe first build will download some additional software, including the Waveshare display support and the LVGL graphics library used to create the screens. You'll need an internet connection for the initial build. Subsequent builds should be considerably quicker.
Transfer the firmware to the display
Connect the display to your computer using a USB data cable. A charge-only cable will not work.
Run the following command, replacing PORT with the appropriate USB device name:
idf.py -p PORT flash monitorThe port name will depend on your operating system:
Operating system | Example |
Windows | COM5, as shown in Device Manager |
macOS | /dev/cu.usbmodem followed by a device number |
Linux | The device beginning usb-Espressif under /dev/serial/by-id/ |
I'd recommend disconnecting any other development boards before flashing to avoid accidentally selecting the wrong device. If the display cannot be detected, disconnect it, hold down the BOOT button and reconnect the USB cable before trying again. Flashing the gauge firmware will replace the demonstration software originally supplied by Waveshare. Once the firmware has been transferred, the monitor will display diagnostic information from the gauge in the terminal, updated once a second. Press Ctrl+] to exit the monitor.
Trying the gauge without building the electronics
One of the more useful features of the firmware is its demonstration mode. If you're interested in exploring the screens before purchasing or assembling the additional electronics, you only need the Waveshare display. Enable the Display synthetic sensor readings option in the configuration menu, build the firmware and flash the display. The gauge will then generate simulated temperature readings, allowing you to explore the different layouts and temperature indicators.
This is actually how I developed most of the screens. All simulated readings are clearly identified by a DEMO ONLY - NOT REAL warning on the display. Demonstration mode must be disabled before the gauge is connected to the car.
Configuring the gauge
I've tried to make the gauge reasonably straightforward to customise without requiring changes to the underlying software. There are four main areas of configuration;
general features,
Wi-Fi,
measurement and alarm settings; and
temperature sender calibration.
Any changes will require the firmware to be rebuilt and flashed onto the display.
General settings
The configuration menu can be accessed using:
idf.py menuconfigWithin the menu, navigate to Caterham oil temperature gauge. Use the arrow keys to navigate, Enter to open a submenu and Space to change an option. Press S to save your changes and Q to exit.
Setting | Default | Description |
Display synthetic sensor readings | Off | Enables demonstration mode. |
Display temperature unit | °C | Selects Celsius or Fahrenheit for the display. Diagnostic logging remains in Celsius. |
Wi-Fi, Web log page | Off | Enables the web interface. |
Wi-Fi, UDP data stream | Off | Enables the live telemetry stream. |
Wi-Fi, Multicast group and port | 239.10.10.10 and 5005 | Determines where the telemetry is transmitted. |
Unless you have a particular reason to change the multicast address or port, I'd suggest leaving them at their default values.
Configuring Wi-Fi
Wi-Fi is entirely optional. If all you want is a standalone temperature gauge, there's no requirement to enable it. If you'd like to access the web interface or receive the live telemetry stream, you'll need to provide a Wi-Fi network name and password. In the main/ directory, make a copy of wifi_secrets.example.h and name it wifi_secrets.h.
Open the new file using a text editor and update the following two lines:
The network name can be between 1 and 32 characters, and the password between 8 and 63 characters. If either contains a quotation mark or backslash, place a backslash before that character. The file is excluded from Git by default, helping to prevent your Wi-Fi credentials from being accidentally included when sharing source code changes.
How the gauge connects
When Wi-Fi is enabled, the gauge looks for the configured wireless network. If it finds the network, such as when the car is in the garage, it connects to it and displays the IP address it has been assigned. If the network isn't available, such as when you're at a circuit, the gauge creates its own wireless network using the same name and password. In this mode, the gauge can be accessed at 192.168.4.1. This means you can configure your phone or laptop once and use it in either environment.
Switching between Wi-Fi modes
Wi-Fi is controlled using the BOOT button, which is the upper button on the side of the display.
Each press cycles through four operating modes:
Wi-Fi off.
Web interface only.
Web interface and live telemetry.
Live telemetry only.
The display confirms the selected mode for three seconds. Don't hold the BOOT button whilst powering up the display, as this places the device into firmware flashing mode. If Wi-Fi support hasn't been included in the firmware, or the network settings are missing, the gauge will display an appropriate message rather than starting Wi-Fi.
Configuring the measurement and temperature alarms
The main/Config.h file contains a number of settings that control the behaviour of the gauge.
There are two groups of settings you may wish to change.
The reference resistor
Before fitting the reference resistor, measure its actual resistance using a multimeter, with the circuit unpowered. Although the resistor is specified as 2,000 ohms, its actual resistance may differ slightly. Enter the measured value in the following line:
constexpr float kReferenceOhms = 2000.0f;For example, if your multimeter measures 2,001.4 ohms, change the value to 2001.4f, retaining the f at the end.
The accuracy of this value directly influences the accuracy of the sender resistance measurements.
Temperature alarms
The gauge also allows the temperature thresholds and alarm behaviour to be customised.
Setting | Default | Description |
kWarmThresholdC | 60 °C | The temperature at which the oil is considered warm. |
kAmberThresholdC | 115 °C | Triggers the high-temperature warning. |
kRedThresholdC | 130 °C | Triggers the critical-temperature warning. |
kAlarmResetHysteresisC | 5 °C | How far the temperature must fall before an alarm clears. |
kAlarmDebounceMs | 2500 ms | How long a temperature must remain above a threshold before an alarm is triggered. |
The alarm delay prevents brief temperature fluctuations from unnecessarily triggering warnings. Similarly, requiring the temperature to fall by a specified amount before clearing an alarm prevents it from repeatedly switching on and off when the reading is close to a threshold.
These are provisional temperature thresholds, not Caterham's recommended operating temperatures. They should be checked against advice from Caterham or your engine builder before being relied upon. The remaining settings in this file relate to the electronics, fault detection and measurement timings. Unless you're modifying the hardware design, these should be left unchanged.
Calibrating the temperature sender
This is arguably the most important part of building the gauge. Accurately measuring the resistance of the temperature sender is only half the challenge. We also need to understand how that resistance relates to the actual temperature of the oil. As discussed in the first post, I've found that the published resistance curves do not reliably correspond to the sender fitted to my Caterham. Using an incorrect calibration could result in the gauge displaying a perfectly reasonable temperature whilst the oil is actually overheating. For this reason, the firmware is supplied without an active temperature calibration. Until a verified calibration has been provided, the gauge displays the sender's resistance in ohms alongside a CALIBRATION REQUIRED warning, rather than displaying an unverified temperature.
Creating a calibration
The calibration process involves comparing the resistance measured by the gauge with an independently measured oil temperature.
The basic process is as follows:
Check the accuracy of the gauge's resistance measurements using several known resistors.
With the gauge installed and operating in its uncalibrated mode, record the sender resistance alongside an independent thermometer reading.
Repeat this at several temperatures across the intended measurement range. A minimum of five measurements is required, although more is preferable.
Record the results in a CSV file, for example my_sender.csv, ordered from the lowest temperature to the highest.
The first line of the file should be:
temperature_c,resistance_ohmsI've included a Python script in the repository that converts these measurements into a calibration table for the firmware.
Run the following command from the project directory:
python scripts/build_calibration.py my_sender.csv --output main/CalibrationData.h --accept-verified-measurementsOnce the calibration table has been generated, rebuild and flash the firmware.
The gauge calculates temperatures between known calibration points but will not attempt to guess temperatures beyond the range of the table. Above the highest calibration point, the gauge treats the reading as critical and displays a red warning.
The calibration should therefore cover the expected operating temperature range, including the critical-temperature threshold, which is currently set to 130 °C by default.
The full calibration procedure is documented in docs/CALIBRATION.md.
Assembling and connecting the hardware
The measurement electronics connect to the Waveshare display using four wires.
ADC module | Display connection |
VIN | 3.3V |
GND | G |
SDA | 17 |
SCL | 18 |
As mentioned earlier, this connection uses I²C, a communications interface designed for relatively short distances. The cable between the two boards should be no longer than 20 cm.
Three additional wires run from the measurement electronics to the dry-sump tank;
A signal wire connected to the temperature sender.
A ground-sense wire connected to the tank's bonding stud.
A return wire connected to the same bonding stud.
These three wires should be twisted together.
The complete wiring instructions, circuit details and stripboard layout are available within the repository and An Oil Temperature Gauge for the 420R, (Part 2).
Testing before installation
Before connecting the gauge to the car, I'd strongly recommend assembling and testing everything on the bench. A resistor can be used in place of the oil temperature sender, allowing the measurement circuit and fault detection to be tested in a controlled environment.
The repository includes detailed testing procedures covering normal operation, wiring faults and the specified electrical protection tests.
These can be found in;
hardware/WIRING.md
docs/INSTALLATION.md
docs/SAFETY.md
When installed in the car, the display should be powered using an ignition-switched USB-C power supply. Never connect the display directly to the car's 12 V electrical system, and never connect a laptop to the display whilst it is connected to the car's USB-C power supply.
Where the project currently stands
The current gauge is operational on the bench, with resistance measurement, screen functionality, fault detection, alarm behaviour, Wi-Fi and live telemetry implemented.
However, there is an important distinction between a device that works on the bench and one that has been properly validated in a car. The current design has not yet been installed in the Caterham or subjected to the electrical noise, vibration and operating conditions associated with its intended environment. The outstanding installation and validation checks described in the earlier posts still need to be completed. Anyone building the current version should work through these checks before relying on it.
Which version should you build?
There are effectively two options for anyone interested in the project.
The current version
This is available to build now. It consists of the Waveshare display, a small enclosure housing the measurement electronics and three wires running to the dry-sump tank. The source code, component list, stripboard layout and PCB design are all available on GitHub.
The next version
This will retain the same display and screens but introduce a separate wireless sensing and data logging unit. It will offer greater flexibility when installing the hardware and provide a foundation for further development. If you're primarily interested in the display, there's also nothing stopping you from experimenting with the current firmware in demonstration mode in the meantime.
What's next?
For me, separating the measurement electronics from the display opens up some interesting opportunities for the project.
Over the next few posts, I'll be looking at:
The sensing unit
Selecting the ESP32 hardware, developing the measurement electronics and designing a suitable enclosure.
Data logging
Recording measurements independently of the display so they can be reviewed after a session on circuit.
The wireless display
Adapting the existing screens to receive measurements over Wi-Fi, including ensuring that an old temperature reading is never presented as current if communication is lost.
Installation in the 420R
Developing the wiring harness, connecting to the dry-sump tank and checking for electrical interference with the engine running.
Calibration
Establishing and verifying the relationship between the sender's resistance and the actual oil temperature.
It's been interesting to see how a project that started with the simple objective of displaying oil temperature has gradually developed into a small wireless telemetry system. Separating the measurement, logging and display functionality provides a foundation that could potentially be extended beyond oil temperature in the future. For instance I'm also working on a CAN based ECU display, a system which could also receive the UDP datastream. For now, though, the objective remains the same, getting an accurate and reliable indication of the oil temperature in the Caterham 420R.







Comments