Hi, I am trying to use a 5 v relays on my Nano but cannot get it going. I want to power a LED. but I all I can see in tutorials is them being used to operate much higher voltages. Surely it should still work or does it need a high voltage to move the magnet. The red light blinks on and off with the sketch, there is power to the NC but it does not switch. I have successfully used them before to operate a 12 volt light.
Hi @Richard91417,
Could you provide us with some more context?
- What does your current setup look like?
- Which guides/tutorials are you following?
- What are the specs/datasheets/links on the parts currently in your setup?
JQC-3F.PDF (395.8 KB)
I have a signal from A2 and powering the solenoid from the 5 v pin and ground.
I am currently looking at a tutorial located at How to Set Up a 5V Relay on the Arduino - Circuit Basics
The signal light is not as bright as the other relays used on my layout that are also powered from Nanos. The other Nanos are powered by 12 v but the one I am working on now is powered through the USB. They are all the same model solenoids.
Hi Richard,
Do you have some pictures of your setup?
Is your relay on a breakout board? I haven’t used a standalone relay before so I’m not sure of the circuitry on the breakout boards is for more than just protecting the rest of your electronics.
If you could help us with this info we are more than happy to help.
I have taken some photos. It is really quite a simple setup, the relay 5v and powered now through an independent 5v power source and a signal is taken from the Arduino. One of the photos shows the same setup, with the same relay, but the light is brighter and I can hear the solenoid ticking. There is no difference. I have tried two solenoids. It makes no sense.
Is the red light you refer to the light on the relay module? If that is blinking on and off then that indicates the Nano is providing the signal. You should be able to hear the relay click as the red light turns on and off. If it doesn’t click then the relay is not operating. The likely reason is that the USB supply is dropping under load and not supplying enough voltage for the relay coil to activate.
If you use a 12V supply to the Nano then you are using the 5V regulator on the Nano to power the relay coil and that may be more reliable than the USB supply.
Driving the relay coil directly from the Nano GPIO is running the Nano right at its limit. A better arrangement is a relay module with an opto-isolator for the signal input and a separate power supply for the coil - sort of like a solid state relay to operate the relay. The relay module used in that tutorial does not have provision for a separate supply to the coil.
/Edit It appears that the relay module does have a driver for the coil (although there is no opt-isolator) so providing 5V from a separate source for driving the coil should enable the coil to operate. So the change needed is to switch the Vcc wire you are currently running from the Nano 5V over to the external 5V supply. Make sure that the external 5V supply earth and the Nano earth are connected. Edit/
WRONG PHOTO! will update Hi Jeff, here is a professionally made circuit diagram I had made up by super qualified electrical engineers.
When the signal is received the solenoid light glows/blinks but not very bright. The ohms vary a small range on the NC output.
The one on my railway that is working is just powered from the VCC on the Nano. I have swapped them all over and they all work on the railway but not the new project.
What is the difference between the railway and the new project? For instance, are you using the buck converter on the railway? It is possible that it isn’t working properly. If you can’t hear the relay click then the coil is not activating. The voltage to be measuring is the 5V supply for the coil, to confirm that it doesn’t drop under load, and the signal from the Nano (although if the light blinks when the signal is received that should be enough to energize the coil, if the voltage is there and the earth returns are in place).
The resistance across the relay contacts should be either infinity or zero - anything in between is measurement error, such as zero reading on the multimeter or skin resistance if you are touching the terminals, and doesn’t indicate anything.
The solenoid is consistently getting 5.05 v. The signal LED is blinking dully when activated. The only difference is it is getting independent power, the railway is getting power from the 5v on the Arduino Nano. I have tried taking the power from the Arduino but it makes no difference. It does not make any sense.
That could be the source of the problem if (1) the buck converter has an isolated output and (2) the ground for the relay is taken from the buck converter output. In that case the relay might not see the control signal as strong enough to trigger the driver transistor, but sufficient to make the indicating LED glow dimly. The problem with that theory, however, is that it is unusual for a buck converter to have an isolated output and your schematic clearly shows the ground being connected from the Nano.
Thanks for everything. The problem was the Arduino sketch. Pretty silly mistake. Anyway, problem solved.
The project is using a PIR sensor to activate a mp3 player and lights on a life-sized Dalek my friend has purchased. The relay will flash 12 volt globes as it speaks.