The PIC idea is pretty simple but not if you've never played with PICs before. You would need to write the program which wouldn't be too complicated but once again if you've never played with PICs before, it would be a challenge. You would then need to get the program you wrote onto the PIC which would require a piece of hardware called a programmer. They are inexpensive and you could probably get one for around $20.
The PIC option aside, I have to say that I'm slightly confused by the information you've given so far. I'm not saying it's innacurate, it's just not what I would have expected. I'm not an expert and don't know about the inner workings of the fuel gauge. So far what you've figured out is:
- When the gauge is unpowered (i.e. see 0 V) it indicates empty.
- When you apply 12V and place no resistor, it indicates empty.
- When you apply 12V and place a 128 KΩ resistor in series with the gauge, it indicates full.
- With no resesitor, the current through the gauge is 140 mA.
First off, I'm assuming the setup you're using to test the gauge is something like the diagram I've attached to this post.
As you vary the external resistance (labeled 0 - 128KΩ), the voltage measured across the gauge and also the current through the circuit changes. When the external resistance is 0, the voltage across the gauge is 12V and the current is greatest. When the external resistance is 128 KΩ, the voltage across the gauge is approximately zero and the current is the least.
From what you said, when the external resistance is 128KΩ (i.e. 0V across the gauge and lowest current) it indicates full. But then when the gauge is unpowered (also 0V across the gauge and 0 current) it indicates empty. This seems inconsistent and counter-intuitive to me at least.
Another thing about this that seems strange to me is the fact that you have to use such a large external resistance to change what the gauge reads.
From item 4 we can figure out that the equivalent resistance of the gauge is 90 Ω because:
V = IR so R = V/I = 12.44/.14 ≈ 90Ω
We can see that the equivalent resistance of the gauge is several orders of magnitude less than the 128 KΩ resistor. If the range of external resistance you need to make the guage work is 0 - 128 KΩ then the voltage across the gauge drops very close to zero when you've used only about 10% of the 0 - 128KΩ range. Once again, I'm no expert but that just doesn't seem right.
It is hard to troubleshoot this thing and figure it out through forum posts. I would likely have a lot more luck if I physically had the gauge to play with. If I were doing this project I would next try the following steps:
If you have a variable power supply, do not put any external resistors in series with the gauge and hook up the power supply to it. Then vary the volatge applied to the gauge between 0 - 12V making notes of which voltages caused the gauge to indicate full, empty, half, 3/4, etc.
If you don't have a vriable power supply, hook up the gauage to the 12V source and vary the external resistance. I would like to know what resistance causes the gauge to read empty, full, half 3/4 etc. Make sure that when you measure for empty and full that the gauge is not pegged out at full or empty. The current at each point might also be helpful information. Hope this helps.