Author Topic: Motorcycle Fuel Level Indicator (Digispark based)  (Read 3254 times)

robmack

  • Newbie
  • *
  • Posts: 13
Motorcycle Fuel Level Indicator (Digispark based)
« on: October 03, 2015, 10:38:17 am »
I own a classic BMW K-bike and am active in the community of owners.  One of the options available to classic K-bike owners is a fuel level indicator.  The motorcycle tank is provisioned with a fuel level sensor which is a simple variable potentiometer, the value of which varies with the fuel level via a floating arm.  Normally the owner would install an analogue gauge to indicate the fuel level.

This is where the Digispark enters the picture.  I've designed a circuit that uses the Digispark to interpret the fuel level sender output and indicate the fuel level on a single LED.  The advantage for the K-bike owner is that this LED can be placed on the dash of a custom build, and still not occupy much space, not distract from the builder's design and the designer is free to choose a R-G LED that suits their taste.

The program reads the sender and illuminates the LED depending on the current fuel level.
- from 50% - 100% full, the LED is steady Green
- from 50% - 25% full the LED slowly flashes Green on-off
- from 25% - 15% full, the LED is steady Red
- below 15% full, the LED flashes Red on-off

These level thresholds are programmable.  Also, the fuel level circuit is independent of the shape or size of the tank, meaning it can adapt to different tank sizes and designs depending on the builder's taste.  The program uses a lookup table to convert the sender's output into a %-full reading.  The lookup table is programmable.

There is built-in inertia in the program which forms an anti-slosh feature.  This prevents the LED from going wild when the motorcycle is in motion and is leaning into curves or going over bumpy roads.
« Last Edit: October 03, 2015, 10:56:06 am by robmack »