Hey guys I am trying to control my solenoid with a relay module which is connected to the Arduino Mega 2560. The program that I am using is the blink example that comes with the arduino program. The red LED on the relay is blinking like its supposed to so I assume the relay is receiving the message, however its not relaying the message to the solenoid. (I changed the default pin to pin 12 in my program)
I posted the specs of the solenoid and the relay below, as well as a circuit diagram.
The first suspect is your use of a breadboard for high current devices. Use your DMM to check the voltages going to the relay and the solenoid.
into the relay I have 5 volts alternating from 5 to 0 as expected and into the solenoid I have a steady 12 volts. the solenoids voltage isnt alternating, which is whats confusing to me. however, whenever I move the wires connected to the solenoid the solenoid does react, but with just the program it doesnt do anything
Disconnect the solenoid from the relay and measure if the voltage across the con/nc comes and goes as expected. Sounds like the relay's not energising.
Surely that 12V on the relay means it needs 12V on the input to energise?
The connection should be as follows:
12V + -----COM of the relay board
12V- ----- '-' ve of the solenoid---Arduino GND
'+' ve of solenoid-----NO of the relay board
Relay board VCC----Arduino Vin/VCC (depending on if it is a 5V relay or 12V relay, for 5V relay, VCC must be connected to 5V of the arduino. For 12V relay, VCC of relay board should be connected to Vin of the arduino while you're powering up the arduino with a 12V adapter)
GND of relay board -----GND of the Arduino
Signal pin of the relay board--- Pin#12 of the ARduino
relay board GND---Arduino GND
any particular reason why you are using a 12V relay?
as the Mega outputs 0/5V I would use a 5V relay
yeah the voltage across com/nc is steady is not changing. and I thought the whole purpose of a relay is to power it up with an aruduino and use the small voltage to activate a higher voltage device?
ok Ill try that thanks
its just what we have in stock lol
That's true, but if you're going to use a relay that needs 12V on its input as it clearly states on top, then you need to put 12V on the input. That particular relay needs 12V on its input.....
that makes more sense. Ill make the necessary adjustments. thanks
pretty sure that worked, I dont know if the clicking is from the relay or the solenoid or both, but according to my DMM the Solenoid is receiving an alternating 12 volts so I am assuming that its working. Thanks guys!
Don't forget the kickback diodes across the solenoid coil ...
its working without it, how necessary is it?
Tempting fate not to have one....
You'll find out when you start getting random glitches or frying drivers (or BOTH!)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.