5
\$\begingroup\$

I am using the Arduino Ethernet with POE and I am in trouble when I have to enable my relay by using a digital pin. What I would like to make is to start a motor by using a relay, which relay is switched with a Arduino digital pin.

My relay is the following (3V):

enter image description here

My circuit is the following:

enter image description here

My sketch is as-like the following:

#define pinRelay 5 

void setup() {
  pinMode(pinRelay, OUTPUT);
  ...
}

void loop() {
  ...
  digitalWrite(pinRelay, HIGH);
  delay(5000);
  digitalWrite(pinRelay, LOW);
  delay(5000);
  ...
}

When the digitalWrite(pinRelay, HIGH) runs then I listen a weak click come from the relay but it doesn't work as expected: the COM/POLE (Common) doesn't switch from NC (Normally Close) to the NO (Normally Open) so the current doesn't pass and the motor doesn't start. However if I connect the wire directly to the 3.3V (or the 5V) power source pin on the Arduino board it works as expected and the motor start moving.

What is the problem? Why the relay doesn't work as expected?

Note I: I also tried with pins other than 5, but the result is the same.

Note II: By measuring the Voltage between the pinRelay and the Ground with my multimeter, the output is around 4V.

Note III: I read a lot of posts on the Web that may be similar to my issue, but I have not yet figured out what the problem really is.

\$\endgroup\$
  • \$\begingroup\$ The Arduino probably can't deliver enough current to the relay to trigger it properly. Have a look at the many answers on this site involving driving a relay via a transistor from an Arduino. \$\endgroup\$ – pjc50 Sep 3 '13 at 14:00
  • 2
    \$\begingroup\$ 1: That picture is not a schematic and therefore doesn't really show what exactly is connected to what. 2: It may be called a "sketch" in the arduino world, but this is a electrical engineering site. Learn the right terms when communicating in the real world. \$\endgroup\$ – Olin Lathrop Sep 3 '13 at 14:10
  • 1
    \$\begingroup\$ From the data sheet at gfinder.findernet.com//assets/Series/356/S36EN.pdf we can learn that your relay requires about 120 ma, or about 3 times what an Arduino pin is rated to supply. If you measure the voltage across the relay coil itself, you will likely find it well less than intended, as there's effectively only about 25 ohms of resistance there. Also beware that the 3.3v regulator on your board probably can't handle this load, and even if it could you would not want to put a relay on a logic supply without heavy filtering. \$\endgroup\$ – Chris Stratton Sep 3 '13 at 14:53
  • 1
    \$\begingroup\$ @ChrisStratton the Arduino Ethernet has a 1 Amp 3.3v buck regulator. It can handle it just fine. \$\endgroup\$ – Passerby Sep 3 '13 at 15:23
  • 1
    \$\begingroup\$ @ChrisStratton You are talking about back EMF of the relay. Putting it on the loggic supply is not the best option (although the diode and if needed a snubber network should work), but as the relay is rated at 3V, the easier solution would be to put a linear regulator at the "upstream supply". But that would add a good dissipation, so before talking about a switching regulator, its better to use a relay with an upstream rated voltage coil. \$\endgroup\$ – Diego C Nascimento Sep 4 '13 at 18:15
7
\$\begingroup\$

The Arduino pins can only source a small amount of current (40mA per pin, 200mA total). You will want to use a low side switch with a transistor to satisfy the current demand of your relay. My go-to circuit for this problem is as follows (using a 1N4001 diode and a 2N3904 transistor).

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Just to fill out the answer some more, the Arduino Ethernet with POE has a LM2734 (or LM2736) switching buck regulator for the 3.3v from vin. Unlike the older Arduinos which used the 50mA 3.3v output from the FTDI serial ics, or the Arduino Uno with the 150mA LM2734, the Arduino Ethernet's 3.3v regulator is up to 1 AMP. Which will do nicely for the relay. \$\endgroup\$ – Passerby Sep 3 '13 at 15:22
1
\$\begingroup\$

Heres the relay datasheet:

http://gfinder.findernet.com//assets/Series/356/S36EN.pdf

According to the table (Coil specification) on Page 3 for the 3V coil, the recommended operating voltage range is 2.2V to 3.9V.

The current consumption is approximate 120mA (at 3V) what is much for the Arduino pins, then if you put 5V the current is even greater, and can damage the Arduino pins.

\$\endgroup\$

protected by Kortuk Sep 3 '13 at 14:58

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.