Precision current control/resistance emulator using Nano

Hello everyone,

I have a project in mind and was looking for some guidance on circuit design and code outline. I'm an Arduino beginner but I think this project should be simple enough.

I've done an engine swap in my project car, and I'm interested in converting the coolant temperature data from the new engine into an output on the old dashboard thermometer. The new engine and ECU measure the coolant temp using a thermistor. The voltage across this thermistor is about 2 volts when cold, and 0.5 volts when at operating temperature, referenced to ground. The voltage drop is nonlinear, going quickly at first then slowing as the engine warms up.

On the coolant temperature gauge in the old dashboard, I believe it is just an analog gauge that's calibrated somehow for the temperature range. It receives battery +12 volts that flows through the ammeter and then through another thermistor to ground (the old thermistor is a different resistance and design than the new engine's thermistor, so it's not practical to hook it in directly). I did some quick measurements and got the following values from the old thermistor for resistance and current through the thermistor, compared to the temperature gauge indication:

Engine cold: 200 ohms, 42 mA
Engine at operating temp: 33 ohms, 127 mA
Engine overheating: 20 ohms, 160 mA
All measured when the battery voltage was 13.1 V

My current thought on circuit design is to use a Nano, powered through the on-board regulator by battery/alternator voltage. I'd use an analog input pin to measure the 2.0 V to 0.5 V thermistor voltage from the new engine. For the output, I'd use a PWM pin to drive a MOSFET that controls the current through the temperature gauge, essentially "pretending" to be the old thermistor. I do want this MOSFET to have a smooth continuous output, so I've read I'll either need a low pass filter or a DAC between the Arduino and the gate of the MOSFET.

For the code, I'll take some more measurements of the specific voltage across the new thermistor, and the resistance of the old thermistor at known temperatures (say every 10 degrees). Then I'd put this data into a couple of arrays, and have the Arduino correlate each sensed voltage to a temperature. This would then output a PWM signal to the MOSFET that would control the current through it, corresponding to the appropriate current that thermistor would pass at that temperature. For in-between temperatures, I'd use linear interpolation to approximate the expected voltage from the input.

I'm completely open to any thoughts, suggestions, improvements or redesigns. Let me know what you all think, any specific component suggestions, or if a similar problem has already been solved (my searching didn't find anything). I can't mess with the circuit on the new engine besides measuring the voltage, and I'm not willing to modify the dashboard, but all I want is a good enough display of temperature on the existing coolant temp gauge. Thanks for all the help and let me know if I can give any other info to help.

You should have done the measurements using the the old temperature gauge so you will not have to guess how it operates. You only have one chance to destroy the components by believing and guessing.

What is the resistance of your gauge?
You cannot control current with a pwm controlled mosfet without current limiting resistor..
An ideal ammeter has zero resistance..
I would put all your measurements in excel and fit some function to do relate your new setup to the old gauge current...

That's what I did. I took the old thermistor and connected it to the old temp gauge as it would normally be connected. Then I heated the thermistor, and measured the current through it and it's resistance at each point above. And to be clear, when I say "engine cold, operating temp, engine hot", that's what the gauge itself is showing. I was also able to crosscheck against the car's service manual, the relevant screenshot is below:


The relevant table is "measure sender gauge resistance", and my thermistor is the Nippondenso column.

Ammeter was probably the wrong way to describe it. It's just a gauge that is sensitive to the resistance of the thermistor. It's definitely analog, though the components of the gauge are hidden inside and I don't want to risk breaking it by taking it apart. It does seem pretty robust, it's off an 80s Toyota, and I have shorted it to ground before with no ill effects.

Doing some quick calculations, I found the following estimated values for the resistance of the gauge:
Engine cold: ~85 ohms
Operating temp: ~62 ohms
Engine overheating: ~55 ohms

I also would have no issue putting in a 20 ohm resistor in series with the MOSFET, since 20 ohms puts the gauge at its max indication anyways. I do want the MOSFET to have a smooth continuous output though, and to not be rapidly switching the gauge on and off. I've read this may either require a low pass filter or an DAC between the Arduino and the MOSFET gate.

Just a cap will do perfectly fine.
Pwm is quite fast. The change engine temperature will not be very fast. A 1 uF cap after the mosfet and current limiting resistor will smooth out the ripple just fine. The cap and resistor will form a low pass rc filter...
You can measure the resistance of your gauge. I expect it is a non ideal ammeter (with a significant resistance).
A series resistor may still be needed. If you take one that can make it go fully to the right (and not hitting the end of scale), you will not ruin the gauge...

Something wrong there.
The gauge resistance should not change with temperature.

I've read this may either require a low pass filter or an DAC between the Arduino and the MOSFET gate.

That is wrong! The input to the MOSFET must be PWM or you will probably burn out the MOSFET.

PWM isn't the best way to do it. Depending on the MOSFET you use, you may have a very limited PWM range.

To be clear, this would be a 1 uF cap between the source of the MOSFET and ground? Or would it be between the gate and ground?

This resistance is just calculated, I don't really think I can physically measure the gauge resistance itself without taking the whole cluster apart. But the gauge has all the resistances and continuities specified in the service manual, and operates as expected when hooked to the thermistor. I'm also not to worried about damaging the gauge, I've flowed a full 12 volts through it momentarily without issue (in fact, the service manual specifies to do this as one of the tests of the gauge's operation). If I was to guess, the IG - U resistance of 54 ohms would be the actual resistance, but it seems this gauge is more complicated than older car's gauges.

If PWM with a MOSFET isn't the best way to do this, what would be? I'm open to all suggestions, the MOSFET solution was just the one I found most likely. But if there's a more elegant solution available, I'm happy to try it out.

I was reading this thread again on my phone and looked at the drawing from the manual and all this makes perfect sense. Your gauge just like the gauges on my first car, a 1950 Mercury. The gauges use a bi-metalic strip heated by resistance wire to make the strip move the gauge needle.

The heating coil will change resistance as it heats, so the resistance reading is to be expected.

I suspect the OP will have to do a calibration chart to match the new gauge needle work as it needs to work.

That actually makes total sense, thanks for that. It matches the behavior a lot better than the ammeter theory. As for the calibration chart, I expected to do this anyways. It's the reason I want to have an Arduino in the loop at all, to make it easier to adjust than trying to mess with analog electronics.

The capacitor should be between drain and ground of a P type mosfet... parallel to the gauge... you also need a npn transistor and some resistors...
Without a current limiting resistor, the cap is a bad idea...
You should test if the metal housing of the gauge is connected to one of its terminals. And whether that is plus or minus.... some old cars have positive ground...
A logic N type mosfet would also do. But that would be a low side switch. Not handy if your gnd terminal is connected to the housing and the housing is connected to a metal plate dashboard...
As we now think that your gauge is a heating element, the cap may not be really needed.

The car is a conventional ground. It's a 1989 supra, so it's relatively modern, but a lot of the tech including the gauges is still older 80s designs. I've attached some pictures of the gauge below just to give you an idea, but it's part of a larger unit with all the gauges together, but each one gets its own analog signal (even the speedo is a mechanical cable). The thermistor, and thus the temp gauge is grounded through the engine block. So the gauge receives ignition 12v passing through the gauge, then the thermistor, then to ground.

That being said I think the logic N type MOSFET makes the most sense here, let me know if you agree or disagree. I'm totally fine with including the capacitor just for good measure, as well as the 20 ohm current limiting resistor (on top of the resistance inside the gauge). If this doesn't raise any red flags I'll order the parts and get experimenting (I'll be sure to test the circuit carefully before putting it on the car)

Photos of the gauge:


Good that you tested all that.
An N type logical mosfet should do the job.
Put the resistor in.
Leave the cap out.
You would need quite a large cap at 50 ohm and it would present an almost dead short to the mosfet at startup. And the heater will not really care about pwm... a breadtoaster runs on 50Hz AC..

Understood, thanks for all the help! I'll report back if I have any issues I can't figure out myself.