0
\$\begingroup\$

I am switching 5V relay with an Arduino Nano. When using USB cable as power source, everything works as it i supposed to. When using external source in form of batteries,(First I tried 9V battery, then 4xAA 1.5V batteries) when I switch relay, the voltage drops to 4.7 V from 5V pin to GND.Battery voltage at input stays at 6V. What might be causing this?

Schematic

\$\endgroup\$
  • 3
    \$\begingroup\$ Draw a schematic showing everything between the battery and the load, including the relay. You can add a schematic by clicking "edit" just above this comment, then looking for an icon which looks like a schematic with a pencil over it. \$\endgroup\$ – Jack B Apr 20 '17 at 9:46
  • \$\begingroup\$ I hope you're NOT trying to drive the relay from the arduino 5V regulated supply. \$\endgroup\$ – JIm Dearden Apr 20 '17 at 9:57
  • \$\begingroup\$ I am driving it from digital pin with digitalWrite(2,HIGH); Why? \$\endgroup\$ – Atizs Apr 20 '17 at 9:58
  • \$\begingroup\$ Perhaps you should google "how to drive a relay with arduino". Start by reading this for example. You current question is unclear: you say the voltage drops but don't indicate which voltage you're talking about. \$\endgroup\$ – Dmitry Grigoryev Apr 21 '17 at 8:46
  • \$\begingroup\$ From 5V pin to GND. What is not clear? \$\endgroup\$ – Atizs Apr 21 '17 at 10:45
3
\$\begingroup\$

The Arduino regulator does not Supply enough current to drive a relay coil, and as a result the voltage drops. To drive your relay properly, you need a driver circuit, which Wired explains better than I would:

How To Move Big Electrons With an Arduino

The reason why it works with a USB cable is because it supplies the 5V directly to the +5V net, without going through the series regulator.

\$\endgroup\$
0
\$\begingroup\$

The way you're supplying the relay's coil, considering its current requirement and the Arduino output capability, the driving pin won't survive that long :D

Use an external 300mA+ rated transistor which you could drive from the Arduino's pin (Low Vgs-th MOSFET for example)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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