Maker Pro
Maker Pro

Reversing a signal, ohm "damper?" n00b help

MetalheadOC

Jun 29, 2011
3
Joined
Jun 29, 2011
Messages
3
Hello all. I'm not really the electronics type, but a recent motorcycle wiring project has forced me to familiarize myself with diodes & resistors & such. What I've got now, is a "universal" fuel gauge working off the signal from the factory fuel level sender, which of course is an oddball range (143-12 ohms F-E) that doesn't quite match. So to make it work I wired an 8 ohm resistor in parallel to bring it close to the 20-150 ohms my fuel gauge reads.

So now the gauge works, but it's backwards (empty is full & vice versa). The needle also bounces around alot as fuel in the tank sloshes back & forth. The factory gauge must have had some sort of electronic "damper" to quell that, it always responded very slowly to changes (like just after filling up), but also gave a steady reading.

So my questions are, what could I use to damp the signal from the sender so the needle doesn't bounce? Maybe a capacitor of some sort? And is there any way to also "invert" the signal so the gauge reads the right way?:D
 

daddles

Jun 10, 2011
443
Joined
Jun 10, 2011
Messages
443
It's likely there's a "yes" answer to both of your questions. To dampen the voltage swings, the universal first choice is to see if an RC low pass filter will work. This is a combination of a resistor and capacitor. You probably want a time constant of on the order of 5 to 10 seconds or so. That's equal to the product of the resistance in ohms and capacitance in farads. Thus, you pick one and calculate the other. Example: use a 1 uF capacitor. Suppose we want a 10 s time constant. Then the resistance calculates to 10 Mohm (million ohms). A 10 uF cap would let you use a 1 Mohm resistor. Get a voltage rating on the cap of 25 to 30 volts minimum and note the polarity if it's an electrolytic capacitor.

For the inversion part, this is tailor-made for an op amp. You'll have to make some measurements of the voltages needed to have the gauge read empty, half, and full, along with the voltage outputs of the sender when it is reading empty, half, and full. That's going to take a bit of work on your part, but once it's done, it shouldn't be hard to get an appropriate circuit (it will probably be an 8 pin op amp chip and a few resistors). With a couple of pots, it could also be adjustable.
 

MetalheadOC

Jun 29, 2011
3
Joined
Jun 29, 2011
Messages
3
It's likely there's a "yes" answer to both of your questions. To dampen the voltage swings, the universal first choice is to see if an RC low pass filter will work. This is a combination of a resistor and capacitor. You probably want a time constant of on the order of 5 to 10 seconds or so. That's equal to the product of the resistance in ohms and capacitance in farads. Thus, you pick one and calculate the other. Example: use a 1 uF capacitor. Suppose we want a 10 s time constant. Then the resistance calculates to 10 Mohm (million ohms). A 10 uF cap would let you use a 1 Mohm resistor. Get a voltage rating on the cap of 25 to 30 volts minimum and note the polarity if it's an electrolytic capacitor.

For the inversion part, this is tailor-made for an op amp. You'll have to make some measurements of the voltages needed to have the gauge read empty, half, and full, along with the voltage outputs of the sender when it is reading empty, half, and full. That's going to take a bit of work on your part, but once it's done, it shouldn't be hard to get an appropriate circuit (it will probably be an 8 pin op amp chip and a few resistors). With a couple of pots, it could also be adjustable.

Ok go slow here... newbie remember? It hadn't even occurred to me that the gauge was actually reading the voltage from the sender, or the the changing resistance changed the voltage. It should have, but it didn't :D So, a capacitor & a resistor, wired in series I'm assuming? Sounds simple enough. Now how bout if I want a time constant of around a minute?


Next part's starting to loose me... looked up an op amp on Radioshack, think I grasp that much, what next?


And to further challenge me... I need to add three more diodes for some panel lights, have that resistor just spliced into the wiring... it would probably make sense to take all these electronic bits and combine them onto a single circuit board that I can weatherproof. That;s doable, right?
 

daddles

Jun 10, 2011
443
Joined
Jun 10, 2011
Messages
443
OK, we'll be gentle. We all come out of the womb with zero knowledge (well, except politicians, they start out negative and have to study for 80 years to reach zero), so just ask when something is confusing.

Let's work on one thing at a time. The RC filter is probably the easiest, so let's start with that. Unfortunately, if you do a web search for "rc filter", you'll get a bunch of stuff that looks a bit intimidating, although most of it is at the freshman physics level or beginning EE level. Here's a picture of the circuit. The main thing to know is that the time constant of the circuit is equal to the product of the resistance in ohms multiplied by the capacitance in farad. (Note: "farad" is the technically correct SI nomenclature, but you'll see almost everyone use the plural and say e.g. microfarads in conversation.)

So, pick the time constant you want and choose the values of the resistor and capacitor. Long time constants (here, "long" is longer than around a second) can require high resistances with small capacitors, so the longer you want the time constant, the higher the capacitor's value needs to be. If you want 60 seconds, then choose a 100 uF capacitor. The the resistor is R = 60/(100e-6) = 600 kohm. One of the disadvantages of such a long time constant is that the meter won't read correctly for at least 2 to 3 time constants, so I'd recommend using a 500 kohm pot and you could then tune the response time to your liking.

For the next step, inverting the signal and perhaps amplifying it, you're going to need to make the measurements I indicated (this can be done with a $5 Harbor Freight digital multimeter). Basically, the approach will be to use an inverting amplifier made with an op amp. Here's a description, but a lot of it will be engineer-speak, so you can ignore that stuff -- just try to understand what the circuit does. I'd probably pick an op amp like the LM324, as there are four of them in one package, so this gives you three more op amps in case you want to do something else down the road. BTW, since you live in WA (I'll be up there next week visiting my sister), you could just send me a SASE and I'll send you a couple of these chips, as I have a number of them. If you're interested, PM me and I'll send you the parts.

The answer is yes to your remaining question. I'll be happy to try to help you through this (time may get a bit scarce next week because of some commitments), but fortunately there are quite a few knowledgeable and helpful folks here who will pull our bacon out of the fire if necessary.
 

MetalheadOC

Jun 29, 2011
3
Joined
Jun 29, 2011
Messages
3
OK I'm still here :D

Two or three minutes (time constants) is OK with me on the RC filter, that's still quicker to respond than the factory gauge was, that could take a solid 5 or 10 minutes to read full after a fillup. I grasp the concept, but don't quite get the diagram in the link. I see the voltage in/out (Vin/Vout, yes?), but what's the second line parallel to the Vin/Vout?

Just finished running a full tank of gas thru it, and the gauge is working as expect (that is, accurate but backwards & bouncy), so next time around I'll start noting voltages. I actually have a $20 Harbor Freight multimeter, but the display partially crapped out so I guess It's time for a non-Harbor Freight multimeter.:eek: Thanks for the offer on the chips, but looking them up they're inexpensive enough I can grab them myself.

Time isn't a concern at all here, actually getting this whole panel working AT ALL was the big challenge, and I still have a couple of annoying bugs to chase down. If I can get the fuel gauge working properly that's just icing on the cake, at this point I'm just in it for the personal challenge. :eek:
 

daddles

Jun 10, 2011
443
Joined
Jun 10, 2011
Messages
443
Two or three minutes (time constants) is OK with me on the RC filter, that's still quicker to respond than the factory gauge was, that could take a solid 5 or 10 minutes to read full after a fillup. I grasp the concept, but don't quite get the diagram in the link. I see the voltage in/out (Vin/Vout, yes?), but what's the second line parallel to the Vin/Vout?
You could consider that to be a ground connection. It's just that a voltage is referenced to another conductor, so it's really a reference point.

The time constant needed will be driven by usability. You don't want to see the fuel sloshing around in the tank, so you make the time constant much longer than the sloshes.

One suggestion is to see if you can just reverse the inputs to the gauge. Often, analog gauges have two isolated inputs and you can reverse the direction of the needle's response by reversing the leads. If there's only e.g. one lead connection and the body of the meter is connected to ground, then this won't work (unless you can electrically isolate the body of the gauge too). If this does work, then it's likely you can solve your problem with the RC filter alone (i.e., no op amp needed).
 
Top