Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

FET & Fuel Gauge - perplexed!

Status
Not open for further replies.

rackley

New Member
I'm a bit perplexed here, any thoughts would be appreciated.

I'm trying to get a PIC to "share" a fuel level sender in a vehicle. The sender is a 33-240 ohm variable resistor, so simple as dirt, right? You use a reference voltage and a voltage divider to figure out what the unknown resistor (fuel level sender) is. Ok, that's easy enough and it's working fine.

**broken link removed**

So the sharing part.. I'm using two nice little dual FETs in SO-8 packages to swap the fuel level sender back and forth between a gauge (which is a glorified voltage divider running @ ~14v reference) and my PIC ADC circuit, which is 5v reference.

One FET swaps the fuel gauge back and forth between the actual sender and an on-PCB 120 ohm resistor to ground (1/2 full tank basically) so it doesn't go nuts when I totally disconnect it. The plan is to leave the gauge connected 99% of the time and only shunt it to the resistor for a few milliseconds while the PIC is sampling. But that's not even at work at the moment, just thought I'd mention it for clarity's sake since it's in the diagram.

The other FET turns on/off the PIC's ADC & voltage divider circuit to the fuel level sender. All three circuits work in concert. But for right now, I have them all turned off except for the fuel gauge gate (U$10 G-1).

So here's the funny part: It works fine for my PIC's ADC circuit, but for some reason the fuel gauge doesn't work. The fuel gauge's lead is normally attached to the U$10 drain (both FETs), and the source (S1) is run to an external ~160 ohm resistor for simulation (what would normally be the fuel level sender.)

I energize the fuel gauge's FET gate, and I can take my voltmeter and I get the same voltage from the +14v Vdd to either the drain (D1-1) or source (S1) which is 14.09v. I can also switch over to ohms and read 0 ohms across the FET. This all makes sense, right? The FET is energized so it should essentially be transparent. I can even take an LED and run it from external Vdd (+14v) to either D1-1 or S1 and it lights up on both. But when I connect the fuel gauge lead (which ALSO reads +14v when a voltmeter is used between it and either D1-1 or S1) to D-1 the needle doesn't move. Place it on S1 and it moves just like it should. This means that the FET isn't transparent to the gauge for whatever reason.

Anyone have any thoughts? If I can light up an LED across the FET from +14v to D1-1, shouldn't the gauge work too?

Here's a link to the FET datasheet if it helps: https://www.st.com/stonline/products/literature/ds/10590.pdf

Thanks!
Ray
 
Can't you just tap the voltage developed on the line going into the fuel gauge? If the gauge is reading something there has to be a voltage on the line already, as that's what drives the gauge. The input impedance of a PIC's I/O line when set to input is very high, the sensor or gauge wouldn't even know the tap was there electrically.
 
Last edited:
OK well I'm not sure why but I figured out I'm getting a 1.48v drop across the FET. I tried a similar FET (ST VNS3NV04D-E, autoprotected) I had laying around and I got the same results. Both FETs are rated for 30v. So I tried another one I had sitting here, it's an ST STD16NF06L, TO-252 that's rated for 60v, 24 amps. This one drops a lot less, only 0.51v.

But I still have the same question - why am I dropping voltage over any of these? The latter FET is rated for 24A 60V, I'm probably passing about 20ma and 14v over it and I'm still losing 1/2 a volt?
 
Sceadwian said:
Can't you just tap the voltage developed on the line going into the fuel gauge? If the gauge is reading something there has to be a voltage on the line already, as that's what drives the gauge. The input impedance of a PIC's I/O line when set to input is very high, the sensor or gauge wouldn't even know the tap was there electrically.

Yeah, but in order to bring it down to the 0-5v range I'd need to put in a voltage divider circuit which would drop up the voltage on the whole line, right?
 
simplest way to get around that is to use an op-amp in a unity gain configuration and then set up your resistor divider on the output of that and connect that to the PIC.
 
An N channel FET wants to ground a circuit. Try a P channel FET.
 
An N channel FET wants to ground a circuit

not necessarily - as long as you enhance the gate-source junction beyond the threshold, the nFET will turn on - no matter what it is referenced to.
 
What's the input signal voltage? No, you don't have to drop the whole line, just the tapped portion of it that the MCU sees. Seeing as how the PIC's input impedance is so high you can use a very large value voltage divider I'd use a 500k or 1meg divider and just use the slowest possible ADC conversion time on the PIC. The fuel gauge will never even know your circuit is there, excepting perhaps a few milivolts of loss.
 
Sceadwian said:
What's the input signal voltage? No, you don't have to drop the whole line, just the tapped portion of it that the MCU sees. Seeing as how the PIC's input impedance is so high you can use a very large value voltage divider I'd use a 500k or 1meg divider and just use the slowest possible ADC conversion time on the PIC. The fuel gauge will never even know your circuit is there, excepting perhaps a few milivolts of loss.

While the PIC's input resistance may be high, so is it's capacitance, for the sample and hold - source impedance is recommended as 2.5K maximum. The main effect is the length of time the capacitor takes to charge, but accuracy can suffer as well if the source impedance is too high.
 
All mosfets have an internal diode which might cause you trouble, though I haven't reviewed your schematic.

There are analog mux switch ICs for this sort of job.

But realistically don't do this switching. Just read the voltage on the probe in parallel with the gauge. An op amp is probably a good idea.
 
OutToLunch said:
simplest way to get around that is to use an op-amp in a unity gain configuration and then set up your resistor divider on the output of that and connect that to the PIC.

Hey, that's a great idea!

I'm a CIS guy, so I'm not real familiar with part families. Do you have any suggestions on where to get started looking for a part to do this? I did a Digikey search on "op amp" and much as I expected, it returned "Records matching criteria: 34444" :)

Thanks,
Ray
 
your choice in an opamp can depend on quite a number of things - i suspect that you could care less about bandwidth and low quiescent currents, etc, etc. The most widely known op amp is the uA741 - start with that and if it does what you want it to do ,then you're done - otherwise start making a list of criteria you need the op-amp to follow and narrow your search accordingly. That's the best non-answer I could come up with :)
 
2.5kohm in? Okay, so big deal, you have to sample 100 times before the sample and hold cap equalizes then you use the next sample to measure the actual value. He's talking about a fuel gauge, they don't exactly change fast. Meanwhile those 2.5kohm 'spikes' aren't going to show on the fuel dial they last only a few micro seconds. If you sample 100 times per second (very reasonable) at the slowest possible ADC rate, you're fine. A single external capacitor buffer of 1u will completly eleminate input imepdance as a sensor issue. It will cause the fuel gauge to change slower on a human scale at least. There's no practical reason why not to simply sample the raw voltage coming from the sensor, worse comes to worse it takes the car 5-10 seconds longer to equalize the buffer capacitor when the car starts up...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top