relay songle srd-05vdc-sl-c 10a

I have 5v relay songle srd-05vdc-sl-c 10a
wemos d1 board.

I would like to control 12v solar lights.

Can I use my relay for testing Safeway?

I have coming a 8 Channel Relay Module Boards Optocoupler Arduino ARM AVR DSP PIC PLC.

27115parallax.jpg

bob5731:
I have 5v relay songle srd-05vdc-sl-c 10a

I have coming a 8 Channel Relay Module Boards Optocoupler Arduino ARM AVR DSP PIC PLC.

Do you mean that at the moment you already have just the "loose" relay like this:

... and you want to know if / how you can use that while you are waiting for this one?

27115parallax.jpg

I have relay 2 can use it whit 12vdc?

The 5V in big letters "05VDC" means it needs 5V to energise the relay coil. The smaller writing "10A 30VDC" means it can switch 30V. (Although I have no idea why it also says "10A 28VDC")

So can I use it to test 12vdc lights?

bob5731:
So can I use it to test 12vdc lights?

I have no idea what a wemos is, but this diagram I found out in the ether is how to do it with an Uno. Bottom right is your 12V supply, top right is your light.

The light is connected to the COMmon and Normally Open terminals, so when the relay is energised, the contacts close, and the light will come on.

I think those relay modules are "active low" which means when you output a low on the Signal line, the relay will energise.

rainbow_rings:
The 5V in big letters "05VDC" means it needs 5V to energise the relay coil. The smaller writing "10A 30VDC" means it can switch 30V. (Although I have no idea why it also says "10A 28VDC")

For exactly the same reason it says "10A 250VAC 10A 125VAC". :grinning:

rainbow_rings:
I have no idea what a wemos is, but this diagram I found out in the ether is how to do it with an UNO. Bottom right is your 12V supply, top right is your light.

Then you need to find out what it is.

There are two WeMOS boards, the "D1":

Which sort of emulates an Arduino UNO and is generally pretty ho-hum, and the more useful "WeMOS D1 Mini" which is tiny

and which is a stacking module system of its own (including relay modules), relatively cheap and very useful. These use the ESP8266 daughter module which is substantially more powerful and capable than the Arduino (UNO/ Nano/ Pro Mini/ Leonardo/ Mega) with native WiFi implemented. It has however fewer available I/O pins and runs from 3.3 V (the WeMOS boards include the regulator) which results on interfacing concerns with 5 V systems.

rainbow_rings:
I think those relay modules are "active low" which means when you output a low on the Signal line, the relay will energise.

No, they are "active high". Viz:

It should work just fine powered from 5 V and controlled by the WeMOS. The usual concerns about grounding and supply layout and bypassing apply.

Paul__B:
For exactly the same reason it says "10A 250VAC 10A 125VAC". :grinning:

Whatever that is.

Paul__B:
Then you need to find out what it is.

Why?

Paul__B:
No, they are "active high".

I stand corrected.

bob5731:
I have 5v relay songle srd-05vdc-sl-c 10a
wemos d1 board.

I would like to control 12v solar lights.

Can I use my relay for testing Safeway?

I have coming a 8 Channel Relay Module Boards Optocoupler Arduino ARM AVR DSP PIC PLC.

yes. but you need to provide more information.
the relay board you linked to requires 5 volts for the coil.
the relay can switch the 12v you have for the load.
a relay is made up of 3 parts.

the CONTACTS. these are isolated, labeled NO COM and NC
these act just like a switch. the are not connected to your Arduino.
the relay is printed with the ratings that the contacts can handle.

10A 250VAC is one load that it can handle
10A 125VAC is also possible
10A 30VDC in case you have a DC load
10A 28VDC is the last rating for the CONTACTS.

in the US, most relays have 3 load ratings.
#1) resistive AC load for heaters and lights and such.
#2) AC motor load usually in HP
#3) DC load

The second part of the 3 is the COIL
the manufacture picks the coil voltage. you posted a link to a relay that uses 5 volts for the coil
the coil needs to have a separate power supply. never feed a relay the power for the coil from the Arduino board.

The 3rd part is the switching.
this is the only part your Arduino connects to.
the board you posted does not show an opto-isolator.
a schematic of that board is required to give you any other information.

Please post a link to the board you purchased.

It should work just fine powered from 5 V and controlled by the WeMOS.
The usual concerns about grounding and supply layout and bypassing apply.

using ONE relay might be fine.
the relay coil pulls about 80mA

So you're saying that it will not cause a problem if I temporarily use it for testing?
I just do not want to damage my relay for Arduino clone.

Your guys's answers are mixed and had me confuse. I have 12 volts going into a solar charge controller don't know how many amps. If I had to guess it would be less than 10 amps. If a DVD player takes 12 volts in I was taught that you do not put 30 volts into it.

Do I need to add any diodes resistors or capacitors to make this work you guys is help is appreciated and I apologize for all the questions.

You state you have [ordered] an 8 relay optocoupler
Board

You post a link to a single relay without opto.
[we assume that is what you have ]

I expect you will damage your board

======================

If you are sure the relay is exactly as your picture .
And you connect to the 5 V before your board
And you use one pin to activate, all should be fine

If you try to use the 5v from the board
it MAY cause your board to re-set
it would not damage your board

=======================

the CONTACTS are just like a switch.
if you connected a switch to your LED's would that damage your Arduino ?
you might ask, how they are connected......
the answer is they are not.
once you can grasp that the contacts have nothing to do with the logic, and you can use 230 volts AC on the contacts, or 1 volt DC, it might become more clear.
the CONTACTS have nothing to do whatsoever with your logic signals.
#2) a coil, in this case, an electromagnet, is the coil that is the large part of the relay.
the coil requires power. the manufacture tells you the voltage needed.
that voltage is only needed to operate the coil. the coil voltage has nothing to do with your Arduino board. when you charge a coil, it uses a LOT of power and can cause the line voltage to drop.
when you allow the coil to discharge, it can dump a LOT of power back onto the line.
this is why your coil has nothing to do with the logic control of your Arduino.
it is why they use an opto-coupler

in the case of the single relay, only a transistor and that is not isolated by anything but the diode of the LED.

#3) you Arduino output can only go to the LED, then the resistor, then the transistor.

if you power your relay from a separate power supply, then only the signal and grounds are shared.
if you take power from your Arduino in the 5 volts, then you have connected power to the board.
the relay has a diode that should prevent any spike, so the chances of damage are very tiny.

see the wiring in post #6. this should work.
but it has to be 5 volts power to the ( + ) connection.

connect the ( - ) to your ground and the ( s ) to your output pin.

you will hear the relay click off an on as you toggle the output.

8 Relay Module. How do I wire it up?

/*********
  Rui Santos
  Complete project details at http://randomnerdtutorials.com
*********/

// Load Wi-Fi library
#include <ESP8266WiFi.h>

// Replace with your network credentials
const char* ssid     = "";
const char* password = "":

// Set web server port number to 80
WiFiServer server(80);

// Variable to store the HTTP request
String header;

// Auxiliar variables to store the current output state
String output5State = "off";
String output4State = "off";

// Assign output variables to GPIO pins
const int output5 = D2;
const int output4 = D7;

void setup() {
  Serial.begin(115200);
  // Initialize the output variables as outputs
  pinMode(output5, OUTPUT);
  pinMode(output4, OUTPUT);
  // Set outputs to LOW
  digitalWrite(output5, HIGH);
  digitalWrite(output4, HIGH);

  // Connect to Wi-Fi network with SSID and password
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  // Print local IP address and start web server
  Serial.println("");
  Serial.println("WiFi connected.");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
  server.begin();
}

void loop() {
  WiFiClient client = server.available();   // Listen for incoming clients

  if (client) {                             // If a new client connects,
    Serial.println("New Client.");          // print a message out in the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        header += c;
        if (c == '\n') {                    // if the byte is a newline character
          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println("Connection: close");
            client.println();

            // turns the GPIOs on and off
            if (header.indexOf("GET /5/on") >= 0) {
              Serial.println("GPIO 5 on");
              output5State = "on";
              digitalWrite(output5, HIGH);
            } else if (header.indexOf("GET /5/off") >= 0) {
              Serial.println("GPIO 5 off");
              output5State = "off";
              digitalWrite(output5, LOW);
            } else if (header.indexOf("GET /4/on") >= 0) {
              Serial.println("GPIO 4 on");
              output4State = "on";
              digitalWrite(output4, HIGH);
            } else if (header.indexOf("GET /4/off") >= 0) {
              Serial.println("GPIO 4 off");
              output4State = "off";
              digitalWrite(output4, LOW);
            }

            // Display the HTML web page
            client.println("<!DOCTYPE html><html>");
            client.println("<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
            client.println("<link rel=\"icon\" href=\"data:,\">");
            // CSS to style the on/off buttons
            // Feel free to change the background-color and font-size attributes to fit your preferences
            client.println("<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}");
            client.println(".button { background-color: #195B6A; border: none; color: white; padding: 16px 40px;");
            client.println("text-decoration: none; font-size: 30px; margin: 2px; cursor: pointer;}");
            client.println(".button2 {background-color: #77878A;}</style></head>");

            // Web Page Heading
            client.println("<body><h1>ESP8266 Web Server</h1>");

            // Display current state, and ON/OFF buttons for GPIO 5
            client.println("<p>relay1 - State " + output5State + "</p>");
            // If the output5State is off, it displays the ON button
            if (output5State == "off") {
              client.println("<p><a href=\"/5/on\"><button class=\"button\">ON</button></a></p>");
            } else {
              client.println("<p><a href=\"/5/off\"><button class=\"button button2\">OFF</button></a></p>");
            }

            // Display current state, and ON/OFF buttons for GPIO 4
            //client.println("<p>GPIO 4 - State " + output4State + "</p>");
            //If the output4State is off, it displays the ON button
            //if (output4State=="off") {
            //client.println("<p><a href=\"/4/on\"><button class=\"button\">ON</button></a></p>");
            //} else {
            //client.println("<p><a href=\"/4/off\"><button class=\"button button2\">OFF</button></a></p>");
            //}
            client.println("</body></html>");

            // The HTTP response ends with another blank line
            client.println();
            // Break out of the while loop
            break;
          } else { // if you got a newline, then clear currentLine
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }
      }
    }
    // Clear the header variable
    header = "";
    // Close the connection
    client.stop();
    Serial.println("Client disconnected.");
    Serial.println("");
  }
}

Remove the link. It will be useful for something else entirely.

Connect "JD-VCC" and the adjacent "GND" to your relay power supply. Use paired wires so that they run together all the way from the relay board to the power supply.

Connect the respective "IN" pins and the adjacent "VCC" pin to the I/O pins and 5 V power on your WeMOS module, together in a bundle, again so that the wires do not get separated. This module is "active LOW". Do not connect the "GND" to the WeMOS. :astonished:

where do I hook up the negative wire and the positive wire. Do I hook up the negative wire from can negative wire or negative terminal on board. But my bored has 3v out.

this relay board has 3 separate power requirements.

#1) the outputs. you must add a resistor for the LED circuit. the resistor is based on the LED and the voltage. lots of LED calculators on google.

#2) relay power. this must be the same as the label on the relay. looks like 5volts.
the labels GND / VCC / JD-VCC
I can take a wild guess and say that VCC connects to VCC over by the signal inputs.
as noted, remove the jumper completely.

I would recommend to use a continuity tester to make sure that VCC by the signal inputs is not tied to GND or JD-VCC for the relay power. and to confirm that VCC is connected. you do NOT want to have the VCC by the signal inputs connected to any power supply wires for the relays.

#3) the signal inputs.
as Paul__B says, connect the Micro-controller 5V to the VCC pin at the signal inputs.
YOU MUST ADD RESISTORS between the Arduino pin and the relay board signal pin.
the relay board uses and coupler that has an LED inside.
I would start with a 330 ohm resistor, maybe as low as 250 ohm. one for each pint.

then use a program to toggle each pin of your micro-controller.

I would recommend you revise the sketch you posted and show all of the resistors and state the values.
remember, you can make a resistor value by using multiple other resistors if you do not have enough of the values you want.

also, label the power supply for the nameplate on the power supply.
with 8 relays and each capable of using 80ma, you would need a minimum of a 750mA power supply. a 1 amp would be preferred. but, you can test this with a simple cell charger as long as you do not try to turn on more than half at any time.

bob5731:
where do I hook up the negative wire and the positive wire. Do I hook up the negative wire from can negative wire or negative terminal on board. But my board has 3v out.

Nice diagram!

But it shows a NodeMCU instead of a WeMOS D1. We need to know which one you have. Power supply negative goes to Ground.

The Vcc on the relay board must connect to the 5 V power on the WeMOS or whatever it is This may be the "Vin" pin. It will not work connected to 3.3 V. As stated, do not try and connect the ground on the relay board to the WeMOS. If you are using the same power supply for the relay board and WeMOS, then you must have one pair of wires taking 5 V and ground from the power supply to the relay board, and another pair from the power supply terminals themselves to the WeMOS.

dave-in-nj:
I can take a wild guess and say that VCC connects to VCC over by the signal inputs.

Of course. So does the ground.

dave-in-nj:
as noted, remove the jumper completely.

most certainly.

dave-in-nj:
I would recommend to use a continuity tester to make sure that VCC by the signal inputs is not tied to GND or JD-VCC for the relay power.

It will not be as long as you have removed the jumper.

dave-in-nj:
you do NOT want to have the VCC by the signal inputs connected to any power supply wires for the relays.

It will not be as long as you have removed the jumper.

dave-in-nj:
YOU MUST ADD RESISTORS between the Arduino pin and the relay board signal pin.
the relay board uses and coupler that has an LED inside.

Do not add resistors. They are already provided on the board.

1k is just fine!

dave-in-nj:
with 8 relays and each capable of using 80ma, you would need a minimum of a 750mA power supply. a 1 amp would be preferred. but, you can test this with a simple cell charger as long as you do not try to turn on more than half at any time.

Most current "phone chargers" now supply 2.1 A corresponding to an iPad, or at least 1 A. Some older ones might have been 750 mA.

Quote from: dave-in-nj on Feb 24, 2019, 06:30 pm

YOU MUST ADD RESISTORS between the Arduino pin and the relay board signal pin.
*the relay board uses and coupler that has an LED inside. *

Do not add resistors. They are already provided on the board.

I did not see the schematic before.

now it is clear that there is an on-board resistor in series with the exposed LED and the opto.
it appears that the board is made for 5 v. note "says same as relay" so it would seem that the resistor has been chosen for a 5v supply.

all that remains is the resistors for the LEDs on the relay side

dave-in-nj:
I did not see the schematic before.

That is because it is never provided in the various catalogue listings. :astonished:

It was "reverse-engineered" and appears often in these answers (particularly mine! :grinning: ).

dave-in-nj:
it appears that the board is made for 5 v. note "says same as relay" so it would seem that the resistor has been chosen for a 5v supply.

Note that there are a green LED and optocoupler LED in series as the input side of the board, with a combined drop of 3 V as detailed in that diagram. This means that it cannot be reliably actuated by 3.3 V which is why you need to connect the Vcc terminal to 5 V and not 3.3 V. Due to that voltage drop, it could never place more than 2 V on an input pin, so there is no risk of the input protection diodes being affected unless the ESP8266's 3.3 V supply fails with 5 V maintained, but if you connect the relay board Vcc to the 5 V on the WeMos, that will not happen.