Need help with my Digital to analog converter

Salut! Good Evening!

I am working on a project to build a Digital to analog converter to interface a 0-5vdc square wave 30hz fuel level sensor with an antique dc analog fuel gauge.

Its for a restomod, and I want to use the digital fuel gauge so my PCM can see fuel quantity, but the fuel gauge is original and uses a 12vdc input and a +/- 1.5vdc sensor input.

The digital sensor wave outputs 0vdc for empty, 2.5vdc for 1/2, and 5vdc full.

The indicator input is +1.5vdc for empty, +0.31vdc for 1/4, -0.3vdc for 1/2, -0.75vdc for 3/4 and -1.5vdc for full.

I've coded some arduino for CAN bus control and reading, but this is my first time attempting to build a DAC. I'd like to keep the converter as small as I can.

Any help hardware, coding, general thoughts is appreciated.

That can be done with a cap, some resistors and an Op Amp. The Op Amp is for buffering or gain change if needed.

  • Capacitor (Cap): Used for filtering in a low-pass filter. Capacitors can help smooth out signals or remove unwanted frequencies.

  • Op Amp (Operational Amplifier): The Op Amp is used for buffering (to prevent loading the source) or for adjusting the signal amplitude (gain) if necessary. It ensures that the signal maintains its integrity when interfaced with the next stage of your circuit.
    image

R4/R5 control the gain. R6 and C2 form a low pass filter or integrated.

There are Arduinos with a D/A already built in as another possibility.

1 Like

Sorry, this doesnt make sense to me. You have a DC analog fuel guage. but

I'm assuming its from a vehicle. If so where would the negative voltage come from?
Can you show us even a photo of the connections?

it would help to have a "schematic" - or even a sketch of what you want to do.

D-A conversion of PWM just involves using a suitable RC filter.

1 Like

Does the fuel gauge rest at 1/2 full when not connected, like this one? How many terminals does it have?


Could it be that the 12V input is only for illumination, and the meter still works if there is no 12V connection?

If you connect +1.5V to the sensor input, how much current is drawn? Same for -1.5V?

I wonder if no analog converter is necessary. The gauge might work with a PWM signal.

Strange that the voltage is not quite zero for 1/2 full. Is there a screw to adjust/calibrate it to 0V for 1/2 full?

Hi, @tj93ta
Welcome to the forum.

What is the fuel gauge out of, what make/model vehicle?

Can you please post some images of the gauge?

I understand that the sender is 30Hz with variable duty cycle to show fuel level.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Exactly, with 10vdc across the primary coil, the gauge goes neutral (middle) then the 2 wires from the fuel sensor create a +/-1.5vdc to drive the secondary coil, and the needle. I'll reply with a picture below:

See post 6 for the gauge schematic, its for an old military aircraft (experimental). So there's a left and right circuit. With Pots to calibrate the gauge.

So Far I have sourced a Bi-polar boost power supply, an OP amp (TSH82), and I have an Arduino uno. My plan is to work up a prototype for bench testing, before I miniaturize the circuit. This is a redundant system, because the Fuel level sensor is primarily going to an interface for the avionics, but I want to keep the existing military gauge working for aesthetic reasons.

It's +/-1.5V relative to REF but what is REF?

Thanks, circuitry design is not my forte. Here's a photo of the TSH82 op-amp and my in work schematic.

image

It seems to be the common ground.

Perhaps this is overcomplicated.
You have a 30Hz PWM with an average voltage in the range 0 - 5V.
You have a guage that appears to be moving coil, with a field coil (bobines de champ) to provide the magnetic field, driven by a 10V supply.
Why cant you just invert the PWM with a single transistor, then do this:

image

The inertia of the meter will do the D-A conversion job of filtering the PWM.

Really helpful for me too. Glad I've found this thread...

1 Like

I need to see the full circuit with the transistor you talked about to comment, but I’m also aiming to be able to make a comparison of the fuel level and drive a discrete low for activation of a warning light.

Best Regards,

Thomas J. Smith

image
do you need me to calculate resistor values for you? If so I'll need to know the resistance of the coils.

So is it possible to connect 2.5V to REF as @johnerrington shows and not have it connected to ground?

Then circuit in post 6 shows A-B providing the fixed mag field supplied by 10V & (presumably) 0V; and c-e, d-e the signal. The diagram doesnt show a connection between B & E
however the picture only shows 4 terminals.
That wouldnt prevent the "GND" terminal being held at 2.5V if the guage was isolated (or the ground pin isolated form the case, then the V+ supply would need to be 12V or thereabouts.

The photo isn't from tj93ta, the original poster.

It is from PaulRB, who asks 'is it like this one?'
I don't think that tj93ta ever confirmed/denied that it was similar..

1 Like

Without taking the indicator apart, the measured resistance is 700k Ohms forD-E and 670k Ohms for C-E. There are coarse and fine potentiometers for calibration, I will need to take the indicator apart if you need more precise measurements.

Best Regards,

Thomas J. Smith

Try this: R4 R5 C1 hold B at 2.5V
image
When BC108 is OFF ( PWM at 0V) A is at 5V so +2.5V across the coils
When BC108 is ON ( PWM at 5V) A is at 0V * (approx) so -2.5V across the coils

  • OK there will be a small positive, so maybe 0.2V - you can use a POT (say 250 ohm) in series with R2 if you wish to make the reading adjustable.

Are you corresponding the A and B inductors to the A and B pins of the indicator?

Best Regards,

Thomas J. Smith