Thank you for your help. Apologies for the slow grasp on this. The 12v and 5V common ground concern threw me as well as using a voltage divider in this way.
You might have to use multiMap() to convert A/D value to percentage.
Multimap can convert a non-linear sensor output of an odd-shaped fuel tank to the correct fuel percentage.
If you need help with that, then post a table of measured A/D values against fuel volumes.
Like: empty = 0, 5L = 120, 10L = 350, etc. Or even with smaller 1L or 2L steps.
Post your current code, so we can see if you're on the right track.
Averaging might alo be needed, to prevent a jumping readout from fuel sloshing.
Leo..
Thanks for the insight, I am working on getting this 20x4 LCD setup and then the other code next. I didnt want to start on the Fuel level code if I was going down the wrong path.
Yes averaging will be a definite need as it will bounce around alot with braking and accelerating since my tank is long and skinny front to rear.
Here is what I have so far, its up and working on the bench. I have tested it with the pressure sensors on the bench and if connected the readings go to zero until I add pressure. If no sensors are connected the numbers vary up and down. I have not moved out to the truck and tested the Fuel level sensor yet.
First Pic is with the 5v fuel pressure sensor connected, Second pic is no sensors connected. txt file of current code
Yes, those sensors rely on default Aref.
So you can't just switch to the internal 1.1/1.5volt Aref in setup().
You must switch between DEFAULT and INTERNAL Aref in loop, before you read the fuel or the other sensors. And observe the settling times. That has been done successfully in an Uno R3, but no experience with a Minima.
Leo..
Untested example of switching Aref.
void fuel can be called every second or so.
Leo..
#include <RunningMedian.h>
RunningMedian samples = RunningMedian(25); // sample bucket size
int fuelRaw;
void fuel() { // fuel sensor on A3
analogReference(INTERNAL); // switch to 1.1V Aref
int trash = analogRead(A3); // throw away the first reading
delay(10); // add some settling delay
trash = analogRead(A3); // throw away another reading
samples.add(rawValue); // add a reading to the bucket
fuelRaw = samples.getAverage(); // final output of the bucket
analogReference(DEFAULT); // switch back to default Aref
trash = analogRead(A1); // throw away the first reading
delay(10); // add some settling delay
trash = analogRead(A1); // throw away another reading
// ready for other sensors
}
Yes I agree. I have only made a few small projects a few years ago. I am getting back into it and of course I jumped in on a larger multi facetted project first. I am doing a custom semi retro dash in my C10 and its finally about to cool off here in AZ and wanting to get atleast part of this project rolling and ran in to some issues with one of the 1.6" screens bought and underestimated the BMP sizes and had to get another one with an microSD card and realized I had lots of parts to this project and wanted a jump start on it so I used AI to get the test screen going and sensors for starters. I am defiantly still interested in learning more and doing code myself.
Cool project.
Posting your code will certainly spark more interrest and could pop up things you never thought about.
Hiding things of a multi facetted project, even insignificant, could send you down a dead end street.
Leo..
I can’t be sure about your 1987 C10, however all the newer ones have both leads of the level sender resistor brought back to the instrument cluster. Even back then running the LS ground through the chassis was not desirable. Can you see the fuel module connector (at the tank)?
Previous years were carbureted and had a single wire for signal and a sending unit common ground/chassis ground. 87 was the first year of having fuel injection and had 3 wires coming out of the assembly (Fuel pump power, Fuel Level signal wire, common ground (Level sensor ground, fuel pump ground, assembly mounting plate ground all tied together))