0

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

Marcus Müller
  • 94,373
  • 5
  • 139
  • 252
Willy Wonka
  • 779
  • 6
  • 19
  • 3
    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. – Jack B Apr 20 '17 at 09:46
  • I hope you're NOT trying to drive the relay from the arduino 5V regulated supply. – JIm Dearden Apr 20 '17 at 09:57
  • I am driving it from digital pin with digitalWrite(2,HIGH); Why? – Willy Wonka Apr 20 '17 at 09:58
  • 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. – Dmitry Grigoryev Apr 21 '17 at 08:46
  • From 5V pin to GND. What is not clear? – Willy Wonka Apr 21 '17 at 10:45

2 Answers2

3

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.

Ricardo
  • 6,164
  • 20
  • 53
  • 89
Sclrx
  • 1,728
  • 8
  • 16
0

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)

HatimB
  • 896
  • 5
  • 17