Relay not clicking

Hello i'm making a project that contains a water pump 12v the problem is the relay is not clicking just led that on the relay gets dimmer and brighter (but led stays on always)

if i short the 5v and gnd on arduino the relay then it works, any ideas?

the first time i connected it worked all okay.

connected the relay
5v----5v
gnd----gnd
A5-----inp

then the relay output
Com--- + 12v pump
NO----+12v adapter
gnd pump ---- gnd 12v adapter

What is powering the relay coil?

Can you provide a schematic and photo of your wiring?

Can you provide a data sheet for the relay?

The relay is connected straight to arduino uno 5v

cant upload all the photos but the relay is SRD-05VDC-SL-C

https://datasheetspdf.com/datasheet/SRD-05VDC-SL-C.html

adapter out put 12v 2A

So it is a bare relay? That is it is not a relay module? A photo of your relay would be very useful.

An Arduino output cannot drive a relay. A transistor is required to switch a higher current to the relay coil. And a flyback diode is required to protect the transistor from high voltage spikes.

i'm using this kinda relay can't post a photo for some reason of my wiring in this thread the format is good and its under 2mb dunno whats wrong

5v relay module : https://www.jaycar.com.au/arduino-compatible-5v-relay-board/p/XC4419

The first time used it it worked just a coincidence that it worked?

That module has an LED, resistor, transistor and diode, so it just needs GND, 5V and signal to the
3 pin connector to work - which is what you did.

Its worth checking the correct voltages are actually getting to the relay module with a meter,
sometimes wires or connectors are faulty, and do a "close visual inspection" to check for
soldering faults etc (i.e. go over it with a hand lens in good light).

Another thing that strikes me is you are switching a pump, which is a highly inductive load.

Perhaps you forgot the free-wheel diode across the pump? That would explain the contacts
welding together for instance.

if i short the 5v and gnd on arduino the relay then it works, any ideas?

This sounds rather odd, but could mean the relay is actually on the whole time therefore you don’t hear a click.

Remove the connection to the signal (s) pin of the relay module, leaving the 5 volt and ground pins connected, then try connecting the (s) pin first to ground and then to 5 volts to see what happens.

In your code, you have declared the relay pin as an output pin ?

6v6gt:
In your code, you have declared the relay pin as an output pin ?

Rats! Beat me to it! :astonished:

// constants won't change
const int RELAY_PIN = A2;  // the Arduino pin, which connects to the IN pin of relay

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin A2 as an output.
  pinMode(RELAY_PIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(RELAY_PIN, HIGH); // turn on pump 5 seconds
  delay(5000);
  digitalWrite(RELAY_PIN, LOW);  // turn off pump 5 seconds
  delay(5000);

the code i think is fine, taking the signal wire to 5v or to gnd doesn't do anything. just tried chaging the wires and it worked. must of been a defect wire. Thx guys for all the comments much apreciated :))

lukaskasc:
. . . taking the signal wire to 5v or to gnd doesn't do anything . . .

? ? ?

6v6gt:
Remove the connection to the signal (s) pin of the relay module, leaving the 5 volt and ground pins connected, then try connecting the (s) pin first to ground and then to 5 volts to see what happens.

this what you said no?