Showing posts with label fuel gauge. Show all posts
Showing posts with label fuel gauge. Show all posts

Friday, October 9, 2026

Husqvarna 701 CAN Touch Display & Virtual Fuel Gauge

 


My 2023 Husqvarna 701 Enduro has a very crude display. I have no fuel gauge and no good way to tell how much fuel is in the tank. It has a low fuel light and that is it. It has no coolant temperature, side stand indicator, gear indicator (except a neutral light) or RPM readout either. 

I decided to build an ESP32-based project to fill these gaps. I also wanted to know what ABS mode I was in right after start and not have to wait until after ABS prove-out and wait for the ABS light to indicate state. 

I started with this Waveshare ESP32-S3 4.3" touch display: https://docs.waveshare.com/ESP32-S3-Touch-LCD-4.3B. I bought the socket and plug sides of the OBD connector so I could T into power, ground, and CAN. I used 22AWG shielded double twisted pair wiring to route form the OBD connector to the display. I used a small 5-pin ebike display plug and socket to provide a connection at the display end. I built the project using Visual Studio Code and Copilot. The vast majority of the coding was done by Copilot and/or Gemini.

DescriptionPriceURL to Buy
Total$125.00
Waveshare ESP32-S3 4.3" display$56.00https://www.amazon.com/dp/B0DD6VLH1Y
5-pin ebike connectors$10.00https://www.amazon.com/dp/B0GVQWK71H
OBD connector set$12.00https://www.amazon.com/dp/B0FCLJP2ZY
Shielded, double twisted pair wire$19.00https://www.amazon.com/dp/B0FHPGN8M7
Waterproof case$14.00https://www.amazon.com/dp/B07PK8K8S2
Rubber grommet for case$8.00https://www.amazon.com/dp/B0DKTBPPN3
CR927 battery$6.00https://www.amazon.com/dp/B0DDSW4SF7

Note: many of these products come in sets or packs. If you were making multiple devices, these sets could cover multiple displays.

Here is the OBD connector on the motorcycle (looking into the face of the plug)



I made the wire harness that T's into the OBD port. The other connector goes to the Veridian cruise control.

Here is the display fitted to the bike. Not a production setup but a location that will work for testing.

Here was some early testing once we (Copilot, Gemini, and I) reverse engineered the data from CAN traffic: 


I rode up to Mt Charleston and back, about 44 miles. The estimated fuel economy aligns with my expectation and experience for this ride. I plan to test it between fill-ups and see how close it is. I can use actual measured fuel economy and consumption to compare to its estimate and adjust it as needed to improve accuracy. After this initial test, I implemented a better VE map to improve the fuel consumption estimate.

I was unable to acquire fuel rate from CAN so we implemented a basic speed-density model to estimate fuel flow into the engine. I made a simple reset button for the fuel level. Fill the fuel tank and tap the reset button (top center) to tell the module the tank is full. From there the speed-density model estimates fuel consumed by the engine and subtracts that from the full tank. The fuel remaining indicator (top right) shows the estimated fuel remaining in the tank. The fuel gauge (top left) gives a simple visual indicator of remaining fuel volume. This design uses no moving parts or fuel senders that struggle to survive the harsh off-road motorcycle environment. It also shows fuel quantity, not level (much more useful). Complex tank geometry complicates the meaning of fuel level. This calculates fuel quantity and is completely independent of tank geometry, fuel slosh, and how level the bike is. You simply tell it when you fill it and it measures (estimates) the fuel the engine is consuming to estimate the remaining fuel volume. 

Since the Waveshare module is not rugged nor water and dust proof, I bought a waterproof enclosure to mount it in. I modified the enclosure to make it more compact by cutting the back off and gluing flat ABS plastic to the back to make a very shallow enclosure. In order to minimize shock and vibration, the Waveshare sandwiches between foam behind it, and small felt pads between the front and the clear enclosure front. I also mounted the whole assembly to the top of my front bag, which isolates it more from shock and vibration. Once I get this all working well, I should find more robust hardware for a more production ready solution. This is good enough for testing to prove it out though. I can see through the clear enclosure cover OK most of the time but glare is a problem. The location is not great as you have to look too far down to see it. Ideally I would have it mounted above the factory display but I need a better device for that. A rally tower would make that mounting much easier.

I also calculate fuel economy and remaining fuel range similar to modern cars and display that. The image below is from a Windows emulator of the latest UI design. I made several elements bigger for visibility.



The RPM bar changes to yellow at peak HP and red at max engine speed. The gear indicator not only shows neutral, but also shows all 6 gears. The ABS indicator shows ON (default), off-road (in off-road ABS dongle mode), or OFF. The side stand shows up or down. It turns yellow when down, green when up. The CAN indicator defaults to yellow (no CAN data) and turns green when it is reading CAN data. It can also record CAN data to the SD card. We used that CAN data recorder heavily when reverse engineering. This device has a battery-backed real time clock. Clicking the date/time at the bottom opens a dialog for setting it. This is mainly used for data logging to correlate the data to interactions.

Now that I know how to trigger off-road ABS mode, I could easily implement that in this same display. I am thinking of making a feature that has ABS simply follow the traction control setting. If traction control is in off-road mode, set ABS to off-road mode as well (presuming the traction control mode can be read on CAN). This device has Wi-Fi and Bluetooth as well. I could add features that use that such as a BLE broadcast of selected data, data upload when in Wi-Fi, and mobile app integrations. 

The next step is to validate the fuel economy and fuel tank quantity estimates by comparing fuel added during a tank fill with the tank size minus the displayed fuel remaining volume. These should be equal (or very close). The fuel economy estimate indicates how accurate the calculated fuel consumed is. Right now I have the inputs to the speed-density model reading 4 times per second and an AI generated engine volumetric efficiency (VE) estimate. I have a VE map created from internet data that represents this engine. Once I get everything working well and validated, then it is time to hunt for better hardware.
After this ride (above) I added 2.225 gallons to the tank to fill it. 3.43 - 2.225 = 1.205 gallons remaining. My display estimated 1.24 gallons remaining giving a difference of about 0.035 gallons (about 1% difference). 

I have the software here: https://github.com/jroal/701display  You will need to setup your Visual Studio Code environment with the correct COM port on your display to flash it. 

https://www.facebook.com/share/p/19VB14FSF7/