Digital Variable Resistor?

Hello everyone,

I'm trying to do research on the best way to control voltage from the Arduino. I am trying to control the temperature gauge on the instrument cluster of my old car. It runs on a negative 12V signal with a variable resistor (assuming this is the temperature sensor itself) to output the temperature on the gauge. It seems to use 300mA and hooking the gauge up directly to ground without a resistor causes the gauge to go all the way to the top. What I am now trying to figure out is what would be the best way to do this.

I first thought about using a MOSFET, but the amount of linear voltage increase you get when adjusting the gate voltage is unpredictable. I tried looking up more information about a voltage controlled resistor and I wasn't getting much information about them. I thought about trying to make one with an LED hooked up to a PWM pin and have it shine on a photocell.

I only have two options that seem viable right now: using a transconductance amplifier, or a JFET transistor. With me being a hardware noob, I am not sure which one would produce a better result. Any help will be greatly appreciated!

Thank you,
-Kyle

You should be able to run PWM "directly" through a [u]MOSFET driver[/u].

300mA seems a lot for a temp gauge.
30mA seems more like it.
PWM-ing the ground wire of the gauge with a 2N7000 or 2N2222 should be enough for that.
You might have to use a resistor in series with the gauge, to limit max deflection.
Leo..

Wawa:
300mA seems a lot for a temp gauge.
30mA seems more like it.
PWM-ing the ground wire of the gauge with a 2N7000 or 2N2222 should be enough for that.

I agree.

Wawa:
You might have to use a resistor in series with the gauge, to limit max deflection.

Though you can simply limit the PWM value. 64 steps would be well more than enough for a temperature gauge. OTOH, a series resistor will definitively limit the dissipation in the FET, should that be a concern.

That said, you bring up the point that the thermistor in question has a minimum value (and not too great a variation) and if the OP tested the maximum gauge current by connecting the multimeter instead of the thermistor rather than correctly in series with it he may well have been abusing the gauge. The series resistor then will not be just to “limit max deflection” but to protect the gauge.

Wawa:
300mA seems a lot for a temp gauge.
30mA seems more like it.

Leo, I have the schematic for the temp gauge below.


https://drive.google.com/open?id=11ZdaIdjIp0XbkuIN5labwq65zKWWMlFg

A8 and A9 are the pin outs from the cluster. The way I'm interpreting it is that A8 is sent to 12V ground while A9 is wired into the VR and the VR goes out to 12V ground. I connected the ammeter (multimeter on amps) where the VR symbol is and got a current draw of 270mA. Completing the circuit without the resistor causes the gauge to max out to the limit (which as Paul points out this is probably abusing it). I used a regular 200 ohm VR and increasing the resistance does bring the needle down.

Wawa:
PWM-ing the ground wire of the gauge with a 2N7000 or 2N2222 should be enough for that.

If I use the 2N2222 transistor shown in ST Microelectronics 490358, DS datasheet pdf, would it be hooked up as shown below?


https://drive.google.com/open?id=1mecoJ42Py9kKXbLY-HANYYsV8v7pDuok

You can use a MOSFET if you have an opamp driving the gate with feedback from your circuit about how much current is flowing (e.g. sense resistor between the source of the FET and GND to the - input of the opamp). On the + input of the opamp you'd apply a voltage representing the desired current/gauge deflection you want.

Blackfin:
You can use a MOSFET if you have an opamp driving the gate with feedback from your circuit about how much current is flowing (e.g. sense resistor between the source of the FET and GND to the - input of the opamp). On the + input of the opamp you'd apply a voltage representing the desired current/gauge deflection you want.

So from what I gather, if using the MOSFET, the gauge would be connected to the collector of the MOSFET, the emitter would be connected to ground, and the + end of the opamp would be connected to the gate. Is that correct? If so, would the opamp need to produce up to 12V?

Pyrodron:
So from what I gather, if using the MOSFET, the gauge would be connected to the collector of the MOSFET, the emitter would be connected to ground, and the + end of the opamp would be connected to the gate. Is that correct? If so, would the opamp need to produce up to 12V?

If you’re using a MOSFET you’ll have a drain (roughly equivalent to a bipolar transistor’s collector), a gate (base) and a source (emitter.)

The drain will connect to the “low” side of the gauge
The gate will connect to the output of the op-amp
The source will connect to the top side of a current sense resistor, the other side of which is tied to ground

The ‘-’ input of the opamp will be connected to the source of the collector (top of the current sense resistor.) When a current flows through the gauge and MOSFET a voltage will develop across the sense resistor. This is the negative feedback to the opamp.

The ‘+’ input of the opamp will be connected to, say a DAC output or filtered PWM. The voltage you apply here will be determined by the sense resistor value and gauge parameters.

For example, suppose your gauge shows 1/2-scale at 150mA. If you have a 1-ohm sense resistor, you would see 159mV at the top of that resistor. That would be the voltage value you’d want to apply to the ‘+’ input of the opamp. The opamp will automatically adjust its output as necessary to achieve parity at the two inputs. If the ‘-’ pin is below the ‘+’ input, the opamp will drive additional voltage on the output until the FET turns on enough to get the required voltage at the feedback pin.

Feedback networks like this sometimes need filtering and “damping” to prevent oscillation. You may need a small RC filter on the feedback network to slow the feedback a bit; a 100-ohm resistor between the opamp output and FET gate. You can trim and play with these values to get a stable system.

Why current control if the original sensor was just a resistor (NTC and tank sensor pot).
Me thinks you're overthinking this.
Leo..