Jump to content

I m having an issue trying to get my relay to work this is what I m using


G+_Donald Kloss
 Share

Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Michael Hagberg I will be using an external power supply for the 5 volts also probably a battery pack, I ordered those because I see a lot of videos using the 5v relays as opposed to the 12v relays, theoretically it should work hopefully I also switched the vcc and the in and supplied the 5v from the arduino and the leds flash again so I took the 12v and wired it to in and vcc to pin 7 no relay action, I’m confused as to what is going on it seemed so simple ?

Link to comment
Share on other sites

Donald Kloss It doesn't matter whether you use 5 v relays, or 12v or whatever. What matters is that you supply VCC with whatever voltage the relays require. If 12v relays, then connect 12 v Positive from external power supply to VCC and 12 v Negative to GND.

Connect Arduino output pin to IN on relay board and Arduino GND also to GND on relay board.

You had that reversed and saw the LEDs on the relay board flash, but that was just because the are low power and you had it misconnected. You were not able to activate the relay that way because the Arduino does not provide enough current to energize the relay.

Link to comment
Share on other sites

cosmic Ray I do have 12v going to vcc and the ground from my external source and data pin 7 going to in, it works if I unplug power and plug it back in but with the arduino it’s not controlling the relay switch. Will the arduino send the signal to the relay by only being hooked up to the relay, also I tried to tie ground from the arduino to the same rail as the external power supply

Link to comment
Share on other sites

I made a short video of how this all hooks up. I'm using an external power supply to supply 5v to an Arduino, and also to the VCC and GND pins on a relay board. The relay board is a 5v model, purchased from the link Padre gave us on KH 342, except it is a two relay board instead of the 8 relays that he bought.

On the output side of the relay board I'm powering a 12v test light with a 12v LiPo battery.

The Arduino is already programmed with the "Blink" example, which just alternately turns on and off a LED mounted on the Arduino, and also triggers pin D13 on the Arduino. In my video, there is one bluish green wire running from D13 on the Arduino to the IN pin on one of the relays. There's no need to run another GND back to the Arduino because the circuit is already being completed through the power ground wire.

As the Arduino triggers on and off it triggers the relay on and off which turns the test light on and off.

Naturally, any sensor input could be used to trigger the Arduino.

The video is still uploading as I type this, but should be done in a few.

Link to comment
Share on other sites

cosmic Ray I followed your setup I have 12v to vcc grd to grd and I tried pin 7,8,13, and even pin 3, I have a load hooked up to com and no, still no go, maybe there is issues with the relays I got. I wired up an external ps for the arduino also, while on pin 13 the internal led flashes but nothing on the relay, I’m going to wait until I get the ones from amazon and then I will attack this again and see what happens. Thank you for taking the time to put a circuit together

Link to comment
Share on other sites

Donald Kloss You may have burned out the solid state relay by connecting 12v to "IN" and GND, but we can't be sure from here.

Also, the onboard LED is connected to Pin D13 on many Arduino boards, but not all. You can check yours here:

https://www.arduino.cc/en/Main/Products

 

Select your board and go to that page, and then read through the "Documentation"

 

What code are you running on the Arduino?

The internal LED is connected to pin D13 on my Arduino, but on some boards there is an internal current limiting resistor also. You tell Arduino to bypass the internal resistor by declaring that Pin 13 (or whatever pin your board has connected to the internal LED) is an Output with this line of code in the setup() secion:

 

pinMode(13, Output)

 

This bypasses the internal resistor and lets full current flow to your Output pin.

Link to comment
Share on other sites

cosmic Ray I was testing it out with the blink test and I had tested the 5 relays that I had and 3 of them did the same thing the other 2 only the green led was on, I was testing it out on a arduino uno and then went to the nano both on pin 13 and also tried to setup a separate led on a different pin and had the same issue, I know the relay works because when I unplug either ground or power to the relay it clicks and turns the device off, I did a basic sketch with only one output and tested it with an led and it flashes like it’s suppose to just the relay isn’t clicking when told to

Link to comment
Share on other sites

Donald Kloss Arduino only rates their Nano board to a max input voltage of 7 - 9v, but their Uno up to 12v.

arduino.cc - Arduino - Compare

 

As you have an Uno, I would hook your 12v power supply to both the VCC and GND on the Uno, and also the VCC and GND on the realay board, and then the ouput pin of the Arduino to the "IN" pin on the relay board, and then run the Blink program.

Maybe you did this (I'm lost among the various things you've tried), but it should work.

Link to comment
Share on other sites

it can depend, that voltage regulator will tell you it's operation voltage, see if you can get any numbers from the surface mount black 3 pin chip by the VCC pin

the 12v you see is the relay max, those particular relay boards are usually 5v, and occasionally 3.3v, not 12 v, they are common for micro controllers like Arduino. I have several different ones and they all roughly look like your picture

5v ground, and a trigger pin. it won't trigger unless you tell it to

Link to comment
Share on other sites

 Share


×
×
  • Create New...