Posted on

Making an Arduino Nano powered gauge for the Haltech WB1

In some motorsport disciplines, the use of data loggers is prohibited, but the use of live gauges is not. That’s how this project came into existence.

The goal was to have a standalone gauge that worked with a Haltech WB1 without needing a Haltech ECU.

The basis of this board was a PT CAN IO mini, but the same result can be achieved using an Arduino Nano and an MCP2515 module.

Using a 1.3in OLED screen a display layout was decided upon which allowed for all the information required to be easily viewable. The main data we are interested in is the Lambda itself, so it is the largest text and in the centre of the screen. We are also interested in the Wideband sensor state as this is useful for diagnostic purposes. As the sensor state is only needed when the Lambda value is zero, the Lambda text is replaced with the sensor state.

How the display looks when a Lambda of 1.02 is sent by the WB1
How the display looks when the lambda value is 0 and the sensor is in the condensation phase.

To program the arduino we used the information in the “Haltech Wideband CAN sniffing and DBC files” article to know which CAN IDs we needed to watch, as well as which bytes we needed for each piece of information.

Once the gauge was working correctly it was time to add a startup screen (because who doesn’t love a bit of flair). Using the image to cpp converter found here:

https://javl.github.io/image2cpp/

A bitmap was generated for the PT logo. The logo was resized to correctly fit the 128×64 pixel screen.

With the bitmap generated the startup image should be simple enough to implement, but due to some idiosyncrasies of the Nano the image always appeared incorrectly. To solve this, the image needed to be stored in the SRAM rather than the flash memory, this meant that the logo had to be as small as possible to ensure there was enough memory left for the program.

The display in the startup phase.

To also help with diagnostics, when the correct CAN message is not received the display shows that there is a CAN error.

The display showing a CAN error.

If you are interested in making your own standalone WB1 gauge, or in making a similar project, the project files can be found on GitHub

https://github.com/ptmotorsport/HaltechWB1_CANGauge

A 3D printable 52mm gauge mount is currently being designed and will be available as a purchasable enclosure or a printable file once complete.

  • Product on sale
    CANbus IO Expander - Nano
    CANbus IO Expander – Nano
    $49.00
  • MCP2515 CANbus Driver Module for Arduino
    MCP2515 CANbus Driver Module for Arduino
    $9.90
  • 4 Port CAN Hub
    4 Port CAN Hub
    $99.00$108.18