Arduino and Relays

My project is to use an Arduino UNO to read an automotive thermister/temp sensor and a temperature switch in order to control the operation of an oil cooler in a car. The cooler has both a fan (controlled on/off via a temperature switch) and some dampers/flaps (controlled via the Arduino with a servo) that control airflow and thus cooling.

Based on previous advice from the forum I made a mock up of the system, wrote some successful code and tested it all using a kettle of water as a variable heat source.

However, I have decided that I may as well go the whole way and have full control by the Arduino. That is, I will allow the Arduino to read the thermister and to determine the full operation of the fan and dampers. In order to do this I will continue to read the thermister into an Arduino analog pin but I will now use a relay to switch the fan on and off. The temperature switch came on at the wrong temperature then stayed on until OnTemp minus 10 degrees C. Not what I want.

Waffle over. Question: Can somebody eyeball the attached drawing of my relay circuit please to see if I understand what is required wiring and component wise. Notes;

  • I have not included the fan circuit nor the thermister for simplicity
  • I am using a 12-9v buck converter to clean the power from the car although a 12-7.5v might take part of the load off the Arduino regulator
  • The 12-5v buck converter is there to drive the relay coil (I read it is not wise to come directly off the Arduino) but this power is also required for the thermister and the damper servo
  • Diode around the relay (cos I read that is what you do). 1N4004?
  • 1K resistor into the transister (I don't understand why though)
  • Transistor used as current through coil is probably too high for the Arduino pin. TIP102?
  • The 12v cooler fan will draw up to 9A
  • SRD-05VDC-SL-C relay. Datasheet attached

Do I connect the output grounds from both buck converters????

I think I am quite happy with the product selection and I think the wiring but I am far from knowledgable with these details!

PS - had too much trouble drawing it using Fritzing!

XC4419-dataSheet.pdf (522 KB)

img-180703234427.pdf (585 KB)

The relay board already has a transistor and flyback diode so you can control it directly with the Arduino.

The 12-5v buck converter is there to drive the relay coil (I read it is not wise to come directly off the Arduino) but this power is also required for the thermister and the damper servo

Yes, running the relay coil from its own regulator can minimize glitches through the power supply.

It might be easier to use a 12V relay but you might not find a 12V relay board/module so you might have to build your own transistor (or MOSFET) driver circuit. 12V relays are common so it seems a bit silly to use a voltage regular and a 5V relay in a car.

The thermistor shouldn't take much power so you should be able to "power it" from the Arduino's 5V.

You have a 5V servo? Is it strong enough for your needs? Again, it seems a bit silly to use a 5V servo in a car.

The 5v servo appears to be strong enough although I have not tested it in the airflow. The flap pivots through its centre meaning that the forces of the air acting upon it are balanced and cancel each other out. I had teh 5v servo on hand but I will look into 12v servos.

Had a moment - the thermister is currently powered from the Arduino so all good there.

What about connecting the earths?

will now use a relay to switch the fan on and off.

Get over relays since the 1950's we have been using transistors as switches much better!

Google "using transistors as switches"

Mark

Note that the transistor used to control the relay IS BEING USED AS A SWITCH!

M

holmes4:
Note that the transistor used to control the relay IS BEING USED AS A SWITCH!

A very good point you make.....

I will investigate.

The conclusion I think I am drawing regarding the use of a 12v servo is that the car electrical system is very noisey and this may effect the servo too much. Cleaning up the signal means using a buck converter anyway so I may as well stay with the 5v servo. Seems like good logic but I am happy to be corrected...

12v servos are horribly expensive too...