Fuel gauge mods
#1
Fuel gauge mods
I've got a 98 hawk with a bum sending unit (found this out after running the poor thing dry). I tested the light and it works so it's gotta be the SU. Now I see that the later hawks had a float with an LCD readout on the gauge and I also see that the newer float type will fit in the older tank with consideration being given to an internal vent tube or something of the sort.
My plan is to pick up a newer float-style gauge and just whip up my own electronics for a gauge. Not sure if I want to use an RGB LED to indicate level (green->yellow->red or something like that) or use something like a 16x2 graphical LCD and have a bar graph readout.
Has anyone made their own setup for a fuel gauge? I'm interested to see what other people have done and get some ideas.
My plan is to pick up a newer float-style gauge and just whip up my own electronics for a gauge. Not sure if I want to use an RGB LED to indicate level (green->yellow->red or something like that) or use something like a 16x2 graphical LCD and have a bar graph readout.
Has anyone made their own setup for a fuel gauge? I'm interested to see what other people have done and get some ideas.
#3
Not sure exactly how you would do it. I tried to adapt a 2nd gen sender to a cbr dash but the resistance was different. Even with resistors and a potentiometers I couldn't get it right.
The sending unit is a pretty easy swap. Just knock the vent tube out of the way.
Or just buy a 2nd gen dash and sell yours to pay for it.
The sending unit is a pretty easy swap. Just knock the vent tube out of the way.
Or just buy a 2nd gen dash and sell yours to pay for it.
#4
Well I just picked up a float level sender off eBay for under $40 shipped. When it gets here I'll measure the full and empty resistance and make a custom gauge for it. Should be rather simple. The hard part will be weatherproofing the electronics lol
#5
That part is easy, just cover it in epoxy or silicone caulk. The resistance numbers are in the repair manual under trouble shooting.
Double check it but I think the gasket (rubber ring) for the 2 units is different slightly.
Go to ronayers fiche and see if they are the same part number. (my memory says they are not). You don't want to have gas leaking onto your hot engine. (or at all)
This is an interesting mod so keep us posted with pics etc.
Double check it but I think the gasket (rubber ring) for the 2 units is different slightly.
Go to ronayers fiche and see if they are the same part number. (my memory says they are not). You don't want to have gas leaking onto your hot engine. (or at all)
This is an interesting mod so keep us posted with pics etc.
#6
They're the same part number when checking a 98 against an 04 (91305-MC7-000). Which is great because I just replaced it when I got the bike because it was leaking lol.
I'll definitely post pics and schematics and code once it's all done. I'm trying to decide if I want to use a single RGB LED and just have it change colors based on level or if I want to make an actual gauge on an LCD. I'll play with both and see which I like better.
I'll definitely post pics and schematics and code once it's all done. I'm trying to decide if I want to use a single RGB LED and just have it change colors based on level or if I want to make an actual gauge on an LCD. I'll play with both and see which I like better.
#8
Nah that will be easy. It's just a matter of getting the actual high and low resistance from the gauge and mapping the LCD readout to those values so it will automatically scale the readout to the actual sender resistance
#9
Im aware of how its done, what im saying is if you decide to run a gauge instead of LEDs, calculating the resistence against the actual volume present in the tank due to its odd shape. Some people that have run a gauge say it goes from full to half real quick and then a third to empty real quick and the middle third takes the longest due to the fact that there is the most volume per unit of height in the middle of the tank. So in order to make it accurate you would have to experiment with specific volumes and recording the resistence and or a lot of calculations...
Am i making any sense?
Am i making any sense?
#11
I came aross this and I'm goign to modify it to suit my needs. I'll remove the oil and water parts of it and wire in the factory (working) low fuel LED. I'll just modify the resistances based on the actual sending unit when I get it.
Designing an Arduino Fuel Gauge & Warning Lights
Designing an Arduino Fuel Gauge & Warning Lights
#12
I fully support that idea but arduinos are expensive, you can find a similar prototyping board from another company that would be cheaper... but again i fully support people designing and programming their own electronics.
Would you use arduino code or another low level language?
Would you use arduino code or another low level language?
#13
I'm not going to put the whole Arduino in lol. I've got tons of chips and components laying around. I'll design a PCB and have it made. I'll use the smallest chip that's got enough GPIO to run everything. Heck of I was going the RGB LED route I could use an attiny85 or something. I'll pray use the Arduino IDE as it's so easy. I've got a couple Arduino's and ChipKit's floating around to mess with along with RGB and single color LCD's
#14
Well after seeing your last comp build with your own PCB for the cooling system I'm excited to see what you come up with. If you can make it worth your time and money I'm sure some guys on the forum would buy it
#15
I say use the bar graph. I am interested in this for my own bike, I hate the RLOD. It would be great if you could actually map it to the fuel volume remaining instead of just a linear level change because of the tank shape as mentioned above.
#16
That should be ready enough to do. Just start with an empty tank and put measured amounts of fuel into the tank and take resistance readings at those specified fuel quantities rather than the level.
#17
Well I got the float gauge so today I'll get a readout working. Interestingly enough the tank is 16L and the LCD has 16 segments. It's also got and RGB backlight so I think the plan will be to have each segment be 1L. Now the reserve is 2.65L so I think I'll round it up to 3. I plan to have the backlight green and slowly fade to orange and then once it hits the 3L level it will turn red. Thoughts? I'm going to whip it up on my lunch break as a proof of concept
#19
This is what I'm prototyping with and it's what I plan on using in the final product. I'll probably 3D print an enclosure once I get a PCB design finalized and made.
RGB backlight negative LCD 16x2 + extras [RGB on black] ID: 399 - $13.95 : Adafruit Industries, Unique & fun DIY electronics and kits
#20
ok pardon my stupidity but it all makes sense EXCEPT for, how is it going to automatically switch colors?
I'm no electrical engineer, just a hobbiest, but from reading the description it looks like you would change the color with how its physically hooked up, not programming... sorry I just cant picture the schematics for it at the moment...
I'm no electrical engineer, just a hobbiest, but from reading the description it looks like you would change the color with how its physically hooked up, not programming... sorry I just cant picture the schematics for it at the moment...
#21
Well you drive the LED backlights with PWM. So you can set the green to 100% duty cycle (full on) for a specified fuel level (resistance) range. Then set green PWM to 50% and red to 50% (orange) for another specified level range then finally when it sees resistance for ~3L (reserve) it will set the PWM of the green LED to 0% (off) and red to 100% (on)
EDIT I'm going to have the PWM values fade instead of going straight from 100% to 50% so it'll gradually change colors and be less intrusive.
EDIT I'm going to have the PWM values fade instead of going straight from 100% to 50% so it'll gradually change colors and be less intrusive.
Last edited by SXRguyinMA; 07-23-2015 at 11:40 AM.
#23
Well it's been so long since I've messed with my Arduino that I forgot how to hook up the LCD and get it all configured so I spent my lunch break doing that LOL. But the LCD is up and running so tomorrow's project will be slowly adding in features (bar graph, resistance reading, smoothing and averaging of the readings [so the graph isn't bouncing all over as the fuel is sloshing around], setting LED PWM and mapping float resistance to the bar graph).
Once I get it working on the bench I'll swap the sender and add 1L of fuel at a time and read the resistance of the float and calibrate the bar graph to that so that the bar graph is showing fuel quantity rather than fuel level.
Once I get it working on the bench I'll swap the sender and add 1L of fuel at a time and read the resistance of the float and calibrate the bar graph to that so that the bar graph is showing fuel quantity rather than fuel level.
#24
Well I got the float gauge so today I'll get a readout working. Interestingly enough the tank is 16L and the LCD has 16 segments. It's also got and RGB backlight so I think the plan will be to have each segment be 1L. Now the reserve is 2.65L so I think I'll round it up to 3. I plan to have the backlight green and slowly fade to orange and then once it hits the 3L level it will turn red. Thoughts? I'm going to whip it up on my lunch break as a proof of concept
The only way to get it even ball park right would probably be if the float is very sensitive and accurate in its increments, and you actually fill the tank to specified volumes and read out the values, to make a lookup table, because any kind of ma thematic formula will be mostly guesswork...
I know firsthand, since I have made a bar-graph style fuel gauge... I gave up having that kind of resolution long ago, and have just 5 bars and the lower blinking for 'reserve', and they aren't really equal in volume, just a rough estimation...
#25
Well the gauge goes from about 92 ohms to about 11 IIRC. So I'll start with an empty tank and add 1L of fuel at a time and read the resistance then use those readings in the code. That way the graph will correspond to quantity not level
#26
Ok I've pretty much got it working how I want. All that's left is to add in some smoothing so that the gauge isn't going bonkers when the fuel is sloshing in the tank. I also need to get a PCB designed and made and get an enclosure designed and 3D printed on my Prusa i3. Thoughts so far? It turns red as 3 bars ~ 3L fuel remaining (2.65L reserve according to the specs).
Right now it's calibrated linearly to float level rather than fuel quantity but the float isn't in the tank yet so that will come later. On the plus side though having it set to float level means it will work in both 19L and 16L tanks just fine.
Here's a short (6s) video I took of the proof-of-concept in action.
https://goo.gl/photos/TrYC4aPGkhyNdG4y8
Right now it's calibrated linearly to float level rather than fuel quantity but the float isn't in the tank yet so that will come later. On the plus side though having it set to float level means it will work in both 19L and 16L tanks just fine.
Here's a short (6s) video I took of the proof-of-concept in action.
https://goo.gl/photos/TrYC4aPGkhyNdG4y8
#27
Here's the code for anyone interested:
And here's where I got my inspiration and code snippets from:
Arduino Playground - LcdBarGraph Library
Designing an Arduino Fuel Gauge & Warning Lights
Code:
/* *LCD Fuel Gauge for Honda SuperHawk 16L Tank *https://www.superhawkforum.com *Code by Will Lyon 7/24/2015. Contact: will.lyon12584@gmail.com *Uses the LcdBarGraph Library for Arduino. Author: Balázs Kelemen. Contact: prampec+arduino@gmail.com *Designed to be used with the Adafruit 16x2 RGB LCD (both negative and positive work properly) *5V to fuel sensor Grn/Blk *Fuel sensor Gry/Blk to Analog 0 with 10k resistor to GND */ #include <LiquidCrystal.h> #include <LcdBarGraph.h> byte lcdNumCols = 16; // 16 columns in the 16x2 LCD byte sensorPin = A0; // Fuel float sensor 5V input with 10k resistor to GND and Analog 0 LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // LCD connected to digital 7-12 LcdBarGraph lbg(&lcd,16,0,1); // Parameters for LCD bar graph library const int redPin = 5; // Red LCD backlight on Digital pin 5 const int grnPin = 6; // Green LCD backlight on Digital pin 6 void setup() { pinMode(redPin, OUTPUT); pinMode(grnPin, OUTPUT); lcd.begin(2, lcdNumCols); lcd.clear(); delay(100); } void loop() { int level = analogRead(sensorPin); // Label sensor reading as "level" level = map(level, 624, 946, 0 ,1023); // Map the sensor's 624E/946F readings to 0-1023 for proper graph display lcd.setCursor(0, 0); lcd.print("E || F"); // Static full/empty readout on the LCD lbg.drawValue( level, 1023); if (level < 200) // If the mapped value is below 200 (approx. 3L fuel remaining) { analogWrite (grnPin, 255); // Turn the green LCD backlight off analogWrite (redPin, 0); // Turn the red LCD backlight on } else // Otherwise { analogWrite (grnPin, 0); // Turn the green LCD backlight on analogWrite (redPin, 255); // turn the red LCD backlight off } delay(100); // Delay between readings }
Arduino Playground - LcdBarGraph Library
Designing an Arduino Fuel Gauge & Warning Lights
#28
Update! I have the gauge working almost 100%. I added a snippet of code so that when the neutral light is on the gauge will read the level isntantly and when the light goes out it will real slowly (like a car).
Here's the current code:
I also took some time and designed a PCB for it in Eagle. Once I get some made I'll design an enclosure for it and print it out on my 3D printer.
Here's the current code:
Code:
/* *LCD Fuel Gauge for Honda SuperHawk 16L Tank *https://www.superhawkforum.com/forums/technical-discussion-28/fuel-gauge-mods-33365/ *Basic concept found at http://www.pddnet.com/articles/2014/01/designing-arduino-fuel-gauge-warning-lights *Code by Will Lyon 7/26/2015. Contact: will.lyon12584@gmail.com *Uses the LcdBarGraph1.5 Library for Arduino. Author: Balázs Kelemen. Contact: prampec+arduino@gmail.com *LCDBarGraph library can be found here: http://playground.arduino.cc/Code/LcdBarGraph#Download *Designed to be used with the Adafruit 16x2 RGB LCD (both negative and positive work properly) *5V to fuel sensor Grn/Blk *Fuel sensor Gry/Blk to Analog 0 with 10k resistor to GND *Light sensor to Analog 1 with 10k resistor to ground */ #include <LiquidCrystal.h> // Include Liquid Crystal library #include <LcdBarGraph.h> // Include LCD Bar Graph library byte lcdNumCols = 16; // 16 columns in the 16x2 LCD byte fuelPin = A0; // Fuel float sensor 5V input with 10k resistor to GND and Analog 0 LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // LCD connected to digital 7-12 LcdBarGraph lbg(&lcd,16,0,1); // Parameters for LCD bar grah library const int redPin = 5; // Red LCD backlight on Digital pin 5 const int grnPin = 6; // Green LCD backlight on Digital pin 6 void setup() { // Serial.begin(9600); // Initialize communication with PC via serial monitor pinMode(redPin, OUTPUT); // Configure red LED pin as output pinMode(grnPin, OUTPUT); // Configure green LED pin as output pinMode(fuelPin, INPUT); // Configure the fuel level sensor pin (A0) as an input lcd.begin(2, lcdNumCols); // Define LCD as having 2 rows and refer to the above byte for number of columns lcd.clear(); // Clear the LCD display delay(100); } void loop() { int level = analogRead(fuelPin); // Label sensor reading as "level" level = map(level, 624, 946, 0 ,1023); // Map the sensor's 624E/946F readings to 0-1023 for proper graph display lcd.setCursor(0, 0); // Set cursor to top left of display lcd.print("E || F"); // Static full/empty readout on the LCD lbg.drawValue( level, 1023); // Draw graph as fuel level reading if (level < 200) // If the mapped value is below 200 (approx. 3L fuel remaining) { analogWrite (grnPin, 255); // Turn the green LCD backlight off analogWrite (redPin, 0); // Turn the red LCD backlight on } else // Otherwise { analogWrite (grnPin, 0); // Turn the green LCD backlight on analogWrite (redPin, 255); // turn the red LCD backlight off } delay(100); }