# Resistor needed for: Arduino Micro + 12V Pump + HF3FA/005-ZTF relay

I am using an Arduino Micro to turn On/Off a 12 V Water Pump. I am using a HF3FA/005-ZTF relay --> Link

Here's how I connected everything:

I control it with this code:

const int GO = 12;
void setup() {
pinMode(GO,OUTPUT);
}
void loop() {
digitalWrite(GO,HIGH); //WaterPumpON --> ON
delay(60000);
digitalWrite(GO,LOW); //WaterPumpOFF --> OFF
delay(60000);
}


Everything is working as it is supposed to:

QUESTION: Since I'm new electronics I would like to know if I need any kind of resistor somewhere within that circuit? I did not find similar circuits while googling and the only useful info was in this video: YouTubeLink_german and he does not use any resistors but he uses a different relay.

## 2 Answers

The relay you are using requires a coil voltage of 5 volts. Assuming that your Arduino Micro is able to supply the 5 volts at 72 milliAmps, then no resistor is needed.

Normally a resistor is used when the driving voltage is greater than the coil voltage. The resistor then "drops" the extra voltage across it so that the coil receives the correct voltage. So in the case of your relay, if you were using this relay but wanting to drive the coil with a 12 volt source, you would place a ~100 ohm, 1 watt resistor in series with it (7 volts / 72 mA).

simulate this circuit – Schematic created using CircuitLab

• You definitely need to have a diode across the relay pins or you will kill the Arduino driver for the relay. Commented Jun 29, 2017 at 17:20
• @jackcreasey That is a good point. I added a schematic to depict this. Commented Jun 29, 2017 at 17:33
• Ok sorry but now I'm a bit confused... the circuit works the way I drew it in my question.... I am using a Arduino Micro and the I/O Pin has 20 mA max just as user104163 stated... but everything works fine --> The Pump starts and shuts down without problems so the relay works.... Am I still good? Commented Jun 30, 2017 at 19:02
• The added diode is a safety measure. When a relay coil is turned off, it generates a voltage spike that can damage the driver. The backwards connected diode shorts out this spike so no damage occurs. Commented Jun 30, 2017 at 19:05

DC Current per I/O Pin 20 mA source: https://www.arduino.cc/en/pmwiki.php?n=Main/arduinoBoardMicro