90 ohm fuel level reading

I do have a 5v supply that will be in the vehicle for powering other things (fuel pressure sensor, trans pressure sensor, Pi and screen, etc)

Doesnt Wawa's solution solve this? I attached a drawing of what I believe he was saying to make sure I got it correct.

No

Sensor draw through the 330 Ohm resistor is 5 / (330 Ohm + 0 Ohm) = 15mA worst case,
or 5 / (330 Ohm + 90 Ohm) = 12mA. Nothing to worry about.

The sensor gets 5volt through a resistor. 12volt doesn't come anywhere near the sensor.
Leo..

correction on the resistance.... 330


ohms at empty and 420 ohms full with attached image.

Diagram is correct.
Vout will vary between 0 and 1.07volt, perfect for the Uno's internal ~1.1volt Aref.

The R4 minima, with it's 1.5volt Aref needs a stronger pull up of 220 Ohm (do the math).
Leo..

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.

This seems to be a representative schematic of a resistor-sensed fuel sender driving a (D'arsonval?) meter.

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.

This thread could give you some ideas for multimap and averaging.
Leo..

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



C10 Arduino Gauge.txt (5.9 KB)

What kind of pressure sensors.
If they depend on analogRead, then you must switch between internal and default Aref in loop.
Leo..

these..... the 100psi and the 300psi.

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
}

ok thank you, I will go over those. Good catch on the Default and Internal Aref

NGL I used Gemini for most of the code. I did it in sections to make sure each iteration worked.

That's sad.
Ai is going to take the fun out of the project.
I hope your coding skills are good enough to spot the Ai bullshit.
Leo..

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))