2
\$\begingroup\$

This is possibly a pedantic question but im not sure what makes the most sense.

I have this relay : SRD-05VDC-SL-C - the one seen here: http://www.circuitbasics.com/setting-up-a-5v-relay-on-the-arduino/

It has 2 modes.

Normally open, where the device is connected until a high signal is sent.I read this as the relay is normally open...i.e not interrupting the supply.

Normally closed, where the device is connected when a low signal is sent. I read this as the relay is normally closed, i.e delivering power until otherwise told to stop. (Although i think my explanations of NC and NO are wrong...is there a clear easy explanation of these terms!)

I want my relay powered device to be off by default...which can be done in either of these modes, by sending the appropriate signal. So the question is, which option do I use? Which is more right?

The relay module i actually have is actually : https://www.amazon.co.uk/gp/product/B06XKQQXKW/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 . which is 8 relays, and 8 control leds.

The light for each relay is powered when the control pin is pulled low.

To that extent, it makes sense to me to use normally closed, so when the relay is brought low, my device turns on and the relay control led lights up.

My question surmised is: For the Relay status led , where light on suggests the relay is connecting power to the device should I be using NC here?

The other bit which I am unsure about is....when my ESP8266 is booting up, is there a chance that my relay control pin will go LOW before i want it to? The pin seems low by default? Is that true? If a pin is not LOW or HIGH, what is this 'unused' state called?

Is this 'best practice' when it comes to relays....this led is the bit which adds complication for me.


Please see here for a next step question : Relay active low and ESP8266 GPIO pins

\$\endgroup\$
2
  • \$\begingroup\$ You want to use normally open contacts. That means without power the LEDs are off. It also means that they won't go on unless you purposefully drive the relay. The outputs of your device, (I haven't researched), should be inactive, (open), until you program the port active and cause the relay to close. \$\endgroup\$
    – lakeweb
    Jan 25, 2018 at 23:22
  • \$\begingroup\$ Your explanation of NC and NO is correct.... When the relay is off (which is the "normal" i.e. default state) the normally closed contacts are closed and the normally open contacts are open. \$\endgroup\$
    – user253751
    Jan 25, 2018 at 23:37

4 Answers 4

1
\$\begingroup\$

Best practice:

  1. (per @PlasmaHH's suggestion below) Safety. If a state is unsafe, make it not the default;
  2. low power consumption. If you know beforehand that relay will be in specific state for longer time, it is wise to design the circuit so that this state will be obtained within 'off' state of the relay (where there's no, or minimal current is flowing through its control element);
  3. mechanical fatigue. For mechanical elements of the relay, there could be switch position when relay's internal mechanical elements are in 'strained' mode - it is wise to minimize the time relay elements are in this state.

Now about your choice. You can see that those 8 relays are two position ones, in 'off' mode central pad is connected to one pad, in 'on' mode to another, thus you have a freedom of choice connecting load to switching terminals.

should I be using NC here?

NC is usually stands for 'not connected', so you should not use it. As @Tyler said below, NC is 'normally closed' or 'normally connected' and NO is 'normally open', details can be found here in Wikipedia. But to be precise you have to refer to device's datasheet.

The other bit which I am unsure about is....when my ESP8266 is booting up, is there a chance that my relay control pin will go LOW before i want it to?

To answer this question circuit diagram is needed. The page you linked to is about turning electric lamp on/off, you seem to talk about powering Arudino using the relay. Is it about self-power off?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ NC could mean Normally Closed, like NO would be Normally Open. \$\endgroup\$
    – Tyler
    Jan 25, 2018 at 23:20
  • 1
    \$\begingroup\$ 0. Safety. If a state is unsafe, make it not the default \$\endgroup\$
    – PlasmaHH
    Jan 25, 2018 at 23:21
  • \$\begingroup\$ Thanks Tyler for correction and PlasmaHH for great suggestion! I updated the answer with credits. \$\endgroup\$
    – Anonymous
    Jan 25, 2018 at 23:27
  • \$\begingroup\$ The control pins are handled through the esp8266, the relay is powering a lamp \$\endgroup\$ Jan 25, 2018 at 23:50
  • \$\begingroup\$ Please see here for a next step question : electronics.stackexchange.com/questions/352132/… \$\endgroup\$ Jan 26, 2018 at 1:37
1
\$\begingroup\$

Best Practice with relays is to use them so that the coil is energized for the minimal amount of time. Getting this right is dependent on the application and is sometimes a criteria that cannot be rationally met.

Here's an example: You want to control a relay that turns a light (or LED) On for 5 minutes out of every hour. Here you would use the Normally Open contacts because the relay coil will only need to be energized 5 minutes out of every hour. If you used the Normally Closed contacts, you would have to keep the coil energized for 55 minutes to keep the light Off, then de-energize the coil for 5 minutes to turn the light On. Completely the opposite situation of what you want. You don't want the coil remaining energized, producing heat, wasting power, running down its expected operational life, etc. any more than the application dictates.

On the other hand, if you wanted to keep the light On for 55 minutes and turn it off for 5 minutes out of every hour, then you would use the Normally Closed contacts, because in this situation this results in the minimum overall energization time for the coil.

This also applies to solenoids. Energize them as little as possible based on the application and how you utilize the mechanical action of the solenoid.

As for the ESP8266. I don't know this specific processor, but I can speak in general about the situation and concern you present. Yes, it's possible to energize the relay momentarily, or steadily, on power up with just about any microprocessor. Here's the "good practice" rule:

When the microprocessor is held in a continuous reset state, e.g. by holding down a manual reset switch, all of the outputs should go to their "safe state" as defined by the specific application.

Here's an example. You have a system in which one of the micro's outputs controls a high power heating element. When the micro is held in reset, you wouldn't want that heating element to remain in an activated state, for various hypothetical reasons. To accomplish this objective you must design the heater drive circuit to de-energize the heater element when the processor is held in it's reset state. The output of the micro controlling the driver circuit for the heater might be electrically high or electrically low during reset, that depends on the micro you are using. You can usually get this info from the micro's data sheet. You need to design your driver circuit such that the reset state output of the micro pin makes the heater element turn off (de-energize). Often this will involve adding an inverter (e.g. 74HCT04) to the GPIO output pin to flip it around to the harmless logic level while the processor is held in the reset state. Depends on your specific processor and your driver circuitry characteristics.

Many processors have GPIO pins that revert to inputs when the processor is held in reset. Often these inputs are floating. (This is the case with most Atmel Arduino processors.) That is, the micro does not pull them electrically high or electrically low. This is a bad situation for GPIO pins you will later configure as outputs under program control - you never know which way your driver circuit will tend to drift towards - high or low. So, you have to force the pin to the right polarity by adding a pull-up or a pull-down resistor. The resistor has to be sized (resistance chosen) such that it can adequately drive the driver circuit in the absence of drive from the processor, yet not interfere with the processor's GPIO output capabilities in normal running operation.

If you cover the long-term reset situation described above, you will also be covering the short term reset situations that typically occur on system power-up and sometimes for other reasons ( e.g. short term power outages).

It's as simple as that!

\$\endgroup\$
2
  • \$\begingroup\$ if driven by a micro controller, it largely depends on what you want to have happening when the micro is off and/or frozen \$\endgroup\$
    – dandavis
    Jan 26, 2018 at 5:40
  • \$\begingroup\$ dandavis: I agree. The simplest case of these non-running situations to address is the reset state - be it transient, as in a normal power-up, or continuous as it might be during a brown-out condition of the power supply. Once you've got that under control, you can design your hardware, and software to some extent, such that catastrophic situations result in the processor being hardware-driven into the reset state. E.g. with a watchdog timer, brown-out detector, and similar. How far you go with this depends on the criticality of the system:I.e. Xmas tree ornament or passenger jet altimeter? \$\endgroup\$
    – FiddyOhm
    Jan 26, 2018 at 23:19
1
\$\begingroup\$

Here is my take on this...

Relays should only be used when isolation is required. That is, when what you are switching is being powered by a different supply from what is driving it.

When you accept that you then have to ask... what state do I need the thing being switch to go into when I lose power on the switching side. That will define the safe standby state for your system. By that definition you usually use normally open, though not always.

That is, if you lose power on the driver side, what is attached is turned safe till the power loss, or other functional failure, can be corrected.

If it does not matter go with whichever method needs to be activated the least amount of time.


Now, as others have mentioned, that can mean the relay is activated for most of the time under normal operating conditions. As such, in those cases, it is prudent to design your system to use methods that reduce the amount of power wasted. In fact, I would go as far as to say, if the relay needs to be on more time than off, perhaps a relay and or the way the switched side works, needs a rethink.

You can use set-back drivers that lower the current to the relay after the switching time has passed. Though this significantly improves the power usage it suffers from the unfortunate side effect that the relay can drop out unexpectedly due to a power brown-out or mechanical shock. If your circuitry is not able to monitor the switched side, the driver may never notice. I have a timer on my water heater that does this, and I have to reset it every time the lights blink when the hydro company switches the main line.

The other approach is to use latching relays. However, these need to be used with care since they will stay in either state no matter what happens to the power on either side.

This is where solid state relays or opto-relays come into the picture. These devices allow you to maintain the state using minimal currents.

\$\endgroup\$
2
  • \$\begingroup\$ NO is more safe, efficient and will improve the life of the relay when the device default state is off use NO, and it should be switched on by the relay when desired. Thanks ! \$\endgroup\$ Jan 26, 2018 at 1:44
  • \$\begingroup\$ please check my followup question electronics.stackexchange.com/questions/352132/… \$\endgroup\$ Jan 26, 2018 at 1:44
0
\$\begingroup\$

I want my relay powered device to be off by default...which can be done in either of these modes, by sending the appropriate signal. So the question is, which option do I use? Which is more right?

The difference is how much power do you want to waste keeping the switch in the state it is in most of the time.

In the normally open case, you will waste energy when the switch needs to be closed.

In the normally closed case, you will waste energy when the switch is open.

Normally open and normally closed does not just apply to the application of current and wasted energy. It can also apply to saftey reasons. It may be that you might not be able to apply energy and so you would want the switch normally open if then device loses power to shut down power to a load. (as in the normally open case, if you fail to energize the coil, the load will be disconnected (and possibly more safe))

There are also reasons why you would want a switch to fail closed, maybe to short something out in the event of lost power.

Use the schematics below to determine which is best for you.

I would say with the logic in your question that you would want the normally open switch, because by default you want the switch to be open.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
7
  • \$\begingroup\$ How do I know when the coil is energized? Is it when the led powers up on my relay board? \$\endgroup\$ Jan 25, 2018 at 23:58
  • \$\begingroup\$ In NO...the control led is on, but power doesnt flow. Does this mean in this state my relay isnt drawing power? \$\endgroup\$ Jan 26, 2018 at 0:06
  • \$\begingroup\$ As shown in the diagram (is kind of small) but you can see the voltage source state. When voltage is applied to the coil it is energized, if you like the answer be sure to vote and mark it \$\endgroup\$
    – Voltage Spike
    Jan 26, 2018 at 0:07
  • \$\begingroup\$ The best way to diagnose is to put a volt meter across the coil \$\endgroup\$
    – Voltage Spike
    Jan 26, 2018 at 0:07
  • \$\begingroup\$ Its hard to tell with an LED because it could be using inverse logic from the switch depending on your schematic \$\endgroup\$
    – Voltage Spike
    Jan 26, 2018 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.