Thermisistor voltage divider project with Darlington pair automotive 12v relay activation using 5v optimization

Hello everyone, I am looking to optimize this project a bit.
-optimizing darlington pair current
-optimizing voltage divider or getting rid of the voltage divider


It works fine but I am thinking I could do better than the ~5mA of current into the divider and possibly using a thermisistor differently to reduce current flow? And perhaps the darlington could be better, its my first time really depending on a darlington pair like this.

The automotive relays are around 80Ohms but some are higher like 200Ohms just not mine.
I am thinking of switching to a thermisistor with the 3-wires so it can output voltage instead of using the internal resistance to drive a divider but I feel like this is something else I am not seeing, some other way to use that thermisistor that doesn't require leaking current through a divider.

I'd like to calculate the current of the darlington at least

  • What is coil resistance of the relay, give us the relay ratings ?

  • Suggest you use a logic level MOSFET to drive the relay coil.

  • Thermistor would work, what form factor is required.

  • Suggest you use a DS18B20.

Automotive relays I think are 50ohm to 300ohm. Mine is about 80ohms.
The thermisistor needs to sample pressurized oil so I am using 1/8"NPT threaded sensor. It cannot ever leak so there is no reliable way to use generic probe style sensors.

There are so many mosfets I get lost trying to choose one and cheap enough at the quantity I require, how and where do you even begin to find one? That is why I used the transistors I have laying around.

A single NPN transistor should be enough to switch that relay. It's only about 175 mA. No need for a darlington pair.

FYI

Some logic level MOSFETs I use.

If you need to limit the current, you can control the voltage going to the divider with a P Channel MOSFET.


One of these circuits adjusted to your situation.

I tried a single 2N2222 it would not pull the relay I even tried lowering the base resistor- could not get it to go. Thats why I started using the pair.

Thanks, its not so much that I need to limit the current- I could use the 3.3v supply for example or even an aRef 1.1v with a very high resistor. I've experimented with these previously, even though the aRef is not intended for supply it still worked okay

Its more about optimization and control than simply current, 5mA is not a big deal the circuit doesn't run when the vehicle is 'OFF'. I don't want to add the complexity of a bunch of additional mosfets and zeners without a substantial return for the complexity.

  • If saving current isn’t a priority, I wouldn’t worry about optimization of the hardware.
    If it works, it works.

  • As mentioned, a darlington configuration isn’t necessary.

  • If it were me, I’d use a logic level MOSFET to control the relay.

  • However,
    15v ÷ 80R ≈ 190mA hence Ib ≈ 20mA, Rb = 220Ω

2N2222 power ≈ 0.7v * . 19A ≈ 140mW, should be cool.

I would be interested in a mosfet but how would I go about to find one with the low price and specifications I need- when I start looking I am overwhelmed by selection and data sheets. whats the trick here to save time I am not seeing?

In post #5, you have been given a PDF of logic level MOSFETs you can use.

Most of these are available on Amazon and eBay.

All will work with a Vgs of 5V, some will work at 3V3, see the yellow highlights showing Rds(on) for given Vgs.

SMD MOSFETs can be effectively used with a SMD to SIP PCB.

Thank you I will have to read up on those. I didn't catch it in post#5 because those in the picture all still use a transistor off the arduino. You are saying ditch the BJT and use a mosfet instead? I thought the transistors would be superior for automotive applications because they are in theory more difficult to damage, switching speed isnt priority, and automotiv electrical system is hardly stable consistent voltage. I am planning to add a inductor to the VCC anyways. I am curious besides saving power why you immediately jump to the mosfet over the transistor for this application?

  • The Arduino is made up of thousands of MOSFETs.

  • As shown, the 2N2222 will work.

  • MOSFETs are today’s technology

  • FYI, as you probably know, MOSFETs don’t need any current from the Arduino output pin.


You might want to look at using a buck converter to power the Arduino.

I had no idea, I don't have mosfets laying around like i do with transistors. I look forward to a couple projects using them when I have time. Thanks again I'll have to start collecting mosfets next to add to my supply closets.

FYI

This is the MOSFET circuit I use to operate an automotive relay:

An alternative is the BD139 darlington, and a slightly different circuit.

For the thermistor you can use this simple input circuit:
image

And there's two ways you can go with calculating the temperature, depending on the accuracy required.

  1. some estimation based on known temperatures
  2. a formula for a "continuous" mapping of analog reading to actual temperature
    this needs a calibration proceedure (as per method 1 code) and probably a spreadsheet to map the values to a formula - easy to do in Exel or LibreOffice.

Sample code snippets - not complete

1.
For this to work, you need a "calibration mode" to find the arduino analog values, the "temp_cal_in" values as per below. The temp_cal_in values are the arduino analog in readings, and temp_cal_out is the actual/real-world temperatures

//setup
#include <MultiMap.h>
const int temp_sample_size = 11;
int       temp_cal_in[]    = { 15, 20, 25, 30, 33, 44, 61, 85, 109, 198, 332 };
int       temp_cal_out[]   = { 120, 108, 100, 94, 90, 80, 70, 60, 53, 36, 20 };
//loop
Raw_Value = analogRead(Temp_Pin);
if (Calibration_Mode)
        {
        // show raw calibration values
        // accurately measure the real temperature
        Temp_Celsius = Raw_Value;
       //record the value for you you to update the array
       }
else
    {
     Temp_Celsius = multiMap<int>(Raw_Value, temp_cal_in, temp_cal_out, temp_sample_size);
     }
// display the Temp_Celsius

2.

Raw_Value = analogRead(Temp_Pin);
Temp_Celsius = int(-32.36 * log(float(Raw_Value) + 203.82);

Of course that formula in section 2 suits some sensor I had in a particular application. The multimap array values actually suit the same sensor.

Hope that makes some sense, or is useful.

If this is a critical process, not sure of exactly what you are trying to accomplish, there are a lot of professionally made commercial products, sensors and relays, that can interface with the arduino which would likely be more reliable.
You might have a look at https://sferalabs.cc/iono/

A 2N2222 with 390Ω base resistor and optional clip-on heat sink should be able to handle the <200mA coil current with no problem.
https://docs.rs-online.com/dd5b/0900766b80e7892f.pdf

Yeah the mosfets I use in my application are overkill but easily obtainable for me. And there's the possibility of doubling up the relays.

Thanks everyone am def interested in mosfets was planning to use for my next projects, a PWM fuel pump controller and other PWM devices. Didn't remember that they are voltage not current gated like bjt, should make things easier. I also plan to make myself a little LCD voltage monitor for the vehicle 10-15v to upgrade from the LEDs I use now.

The temperature sensitive devices recommended I am not sure how to implement with the 1/8" NPT in hot oil flow. The sensor is submerged in hot oil and anything I use must be direct contact because it must be pretty accurate. I also intend to use another one for Engine oil temperature. I have a 1/8" NPT sensor in the oil pan. My oil lines are relocated so there is optional oil cooling fans available. Its a resistive sensor so it has to ground through the probe-end otherwise it need a separate ground wire which I have purchased recently just waiting to get it. If you guys are seeing another way to detect the temperature of hot oils (40F to 280F) in direct contact with sealed oil system I am not seeing or recognizing please elaborate.

What brand and part numbers are the 1/8" NPT sensors?
I can calculate the multimap values or formula for you to use with that "thermistor" input circuit diagram I posted.
In that diagram the thermistor signal wire kind of just cuts off (because I have connectors and other stuff in my diagram) and the other side of the sensor is grounded.

VCC is regulated 5.0 volts DC -> for external sensors, especially ones on a long piece of wire. Best to use a separate regulator rather than using the Arduino 5 volts to power the sensors. This saves blowing up the Arduino when you get some noise or spikes on that wire.