Power relay from Nano +5v pin?

I have a fog machine that I am trying to trigger using an ultrasonic distance finder. I was able to wire a reed relay in the fog machine's handheld remote. There is no room in the remote for a relay module so I want to power the relay directly (i.e. two leads: +5 and grnd).

My code is triggering correctly and I'm getting 5 volts at the relay, but I measure only 17ma which isn't enough to power the relay. Should the +5 pin on the Nano be able to close the relay (possibly a bad solder joint)? Or do I need a separate power source for the relay? Powering the Nano with a usb (5v 1.5a).

Hi. I have not tried this exact setup, so this is only from reading Arduino's documents.

A reading of 17 mA at 5 V does not by itself mean the Nano is running out of current. A relay coil draws what its resistance allows (5 V / 17 mA is roughly 290 ohm). I did not find a current limit for the 5V pin in the Nano manual, which lists it as the USB power rail. The 20 mA maximum per pin in Arduino's Nano pinout sheet is for the digital I/O pins.

So I would check the relay's own datasheet: coil resistance, rated coil voltage, and the minimum voltage at which it is guaranteed to close. If it should close at 5 V with about that current, the problem may be on the contact side or in the wiring instead.

Which relay is it? A part number or datasheet link would help.

The relay was in my random parts bin (some items go back to Radio Shack). I was able to find these specs, the relay has been discontinued.

A 6V coil on 5V, yeah, probably, especially given the "Must Operate" voltage of 3.5V. But I would have my doubts about the advisability of asking the Nano's 5V regulator to supply 500mA.

Although true, isn't that contact rating the rating for the contact and not the rating for the coil?

Tom.... :smiley: :+1: :coffee: :australia:

24mA...

250ohm coil should draw 20mA at 5V, not too far from your measurements. The fact you get 5V on coil indicates that 5V pin is able to supply what coil asks.
If you have 6V power supply, test your relay with that.

R2 is too low and could damage the Nano's digital output pin. Over 40mA could be flowing from the Nano pin, simply to switch on a transistor, and ironically that transistor will only need to switch 24mA. Something more like 1K to 4K7 should be fine for R2.

You seem to be saying that if the relay was small enough to fit inside the remote, you would want to power it in some other way? Please explain.

Yes. Only 24mA is required, so this should be possible using a Nano digital output pin, which can source a maximum of 40mA. The transistor should not be needed. (Your flyback diode is still needed.)

An opto-isolator would be a better choice than a reed relay for this purpose. They are small and need even less current.

Hi, @chrish290

Can you post some images of your project?
So we can see your component layout.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

@chrish290
What is the part number of the transistor?

Good practice to use a transistor to switch the relay coil and the Arduino to switch the transistor.

For small relays, my go to choice is a 2N3904, and add the diode as in @jim-p diagram.

Argh, yes! I'll just see myself out... sorry about that folks!

A few years ago I needed to use a reed relay in an Arduino project using a NANO board. I got a bag of 5 volt relays on EBAY and used one in the project. Connected directly to a pin on the NANO. Works just fine and the NANO shows nothing changes when the relay is powered.

Why @tigger ?

Most relay coils would exceed an Arduino pin's maximum current, so a transistor is mandatory rather than simply good practice.

But reed relays with a coil current less than 30mA should be ok, shouldn't they? That's comfortably less than 80% of the absolute max pin current.

Habit I guess.
A few pennies for a bit of protection.

Transistor is a 2N3904.

Pics as requested. Not sure how much you can make from them. I added a connector to the fog machine remote and I can plug my jack from the Nano into that. The remote still functions with a button press. Line from nano to jack and nano to ultrasonic are 3'-4' so I can separate them some.

Should be OK but as previously mentioned the base resistor is too low. I would use 470 or 510 ohms. Are you sure the relay contacts are not stuck closed?

If I could fit one of the relay modules available (pic) in the remote, I would have maybe gone that way since the extra components are already in place (avoiding the transistor, etc). That would have required a third wire to power the relay though.