
SimonShield
github-linguist/linguist
Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

An Open Source Hardware and Software device to provide a linear fuel gauge for cars with oddly shaped fuel tanks.
FuelGauge is an open-source printed circuit board by davefiddes, from the davefiddes/FuelGauge repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 94 × 44 mm with 28 parts on 18 nets, routed with 169 tracks and 23 vias.
It is built around the BC547. Its parts include 7 diodes, 6 capacitors, 6 resistors, 3 ICs and 2 transistors. It belongs with the PIC boards of this library.
This project allows an accurate linear fuel readout to be created for vehicles with unusually shaped fuel tanks and/or mismatched fuel senders.
I built this for my Ultima GTR kit car which uses a conventional VDO fuel gauge and vertical float sender unit. The fuel tank on the car is a very unusual shape so it can get as much fuel as possible into a small space. This combination means that with a thirsty V8 the fuel quickly drops from 100% to 25% but takes a lot longer to go from 25% to empty. It's easy to run out of fuel!
To illustrate the scale of the problem here is a rendering of the fuel tank with 15 litres of fuel in a 34 litre tank:

Other Ultima owners have solved the problem by using their ECU or an intelligent dashboard. I have neither and wanted to preserve the original look of the Ultima branded instruments.
The Linear Fuel Gauge box sits between a standard resistance fuel sender and a hot-wire fuel gauge. The device:
The gauge is built around a simple 8-pin PIC12F1840 micro-controller. The resistance of the sender is measured using a 10mA current source built from an LM317L regulator. The gauge output is achieved by feeding a PWM signal from the MCU into a high-current MOSFET driver (currents are typically around 100mA for 100%). A simple NPN-transistor driver is provided for low fuel indication. Configuration of the gauge is achieved with a 3-wire TTL serial connection to the MCU.
The project contains the full Kicad schematics and a PCB layout designed to fit in a small Hammond Manufacturing 1591ABK ABS plastic case.


Details:
The gauge is implemented in C as a platform neutral core with a small hardware abstraction layer for the MCU. A full set of unit tests is provided for the core allowing easy testing and debugging to be carried out on a PC before building for the MCU. The MCU firmware is built using the Microchip MPLAB X IDE v5.15 and xc8 v2.05 compiler (Free Version).
The gauge has two 9 bin maps that allow fine grained mapping of:
The calibration of the two maps is achieved using a serial connection. The core implements a command processor allowing values in each of the maps to be modified and saved to EEPROM. During calibration the gauge output can be tested and the resistance of the fuel sender measured independently.
The Calibration And Programming Guide details how to set up the fuel gauge which should mostly be a one-time exercise.
The device hardware and software is covered by the GNU General Public License v3.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 1N4001 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D1, D2, D4, D6 |
| 1 | 100nF | Capacitor_THT:C_Disc_D3.4mm_W2.1mm_P2.50mm | C6 |
| 1 | 10K | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R6 |
| 1 | 10R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R4 |
| 1 | 120R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1 |
| 1 | 12V 1W | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D5 |
| 1 | 1K | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R3 |
| 1 | 1nF | Capacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm | C2 |
| 1 | 1nF 100V | Capacitor_THT:C_Rect_L7.0mm_W6.0mm_P5.00mm | C1 |
| 1 | 1uF | Capacitor_THT:C_Rect_L7.0mm_W6.0mm_P5.00mm | C3 |
| 1 | 22V 1W | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D7 |
| 1 | 22V MOV | Varistor:RV_Disc_D7mm_W3.4mm_P5mm | RV1 |
| 1 | 22uF 25V | Capacitor_THT:CP_Radial_D5.0mm_P2.00mm | C4 |
| 1 | 2K2 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R2 |
| 1 | 47uF | Capacitor_THT:CP_Radial_Tantal_D6.0mm_P5.00mm | C5 |
| 1 | 4K7 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R5 |
| 1 | 5V1 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D3 |
| 1 | BC547 | Package_TO_SOT_THT:TO-92_Inline | Q1 |
| 1 | Conn_01x06 | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J2 |
| 1 | Conn_01x10 | Connector_Molex:Molex_KK-254_AE-6410-10A_1x10_P2.54mm_Vertical | J1 |
| 1 | LM317L_TO92 | Package_TO_SOT_THT:TO-92_Inline | U1 |
| 1 | LM7805_TO220 | Package_TO_SOT_THT:TO-220-3_Horizontal_TabDown | U2 |
| 1 | OSHW-Logo2_7.3x6mm_SilkScreen | Symbol:OSHW-Logo2_7.3x6mm_SilkScreen | Logo1 |
| 1 | PHB55N03LT | Package_TO_SOT_SMD:TO-263-3_TabPin2 | Q2 |
| 1 | PIC12F1840-IP | Package_DIP:DIP-8_W7.62mm | U3 |
It measures 94 × 44 mm and has 2 copper layers, 1.6 mm thick.
28 parts, built around the BC547. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the davefiddes/FuelGauge repository on GitHub, at the commit this page was made from: the board is hardware/FuelGauge.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

github-linguist/linguist
Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

dotnet/iot
This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.

peterheinrich/InternetOverSpaghetti
Transmitting IP packages over a pair of spaghetti thus demonstrating how media independent IP really is.

tebl/RC6502-Apple-1-Replica
An expandable SBC-version of the Apple 1 computer, easy to get started with and lot of cool stuff that can be added to it!



ZeroPhone/ZeroPhone-PCBs
PCB files for ZeroPhone - for gerbers and schematics, go to "Releases" tab!
