School me on relays, need help

I got one of these ELEGOO 8 Channel DC 5V Relay Module with Optocoupler.

It works like I want, when I send 5 volts to the pin, it closes the relay and my connected device turn one. The problem is the normally open circuit starts out closed. So until 5 volts is sent to the relay controller the NO are closed. When the relay powers up, they all click open and then start responding properly to the pin input.

This one does not have a high low trigger jumper. Is that what I need. I want the circuit to be open of no power to applied to the relay, so when power is applied to the relay they still remain open. So ONLY when I sent 5v to the pin will the circuit ever be closed and the device turned on.

The one I have now, if the 5v to the relay dies, all the circuits close and all the devices turn on since they are on a different power supply greater then 5v of course.

ELEGOO 8 Channel DC 5V Relay Module :
There is also a schematic and example sketch in a zip file.

There are three output terminals per relay. Normally this means the relay has a changeover contact (i.e. a common, plus an NO and an NC).

So you might already have what you want.

The problem is the NO is actually NC until 5v is sent to power up the relay at which point it goes to NO. So it requires 5v to maintain the default NO. So if I lose 5v to the unit they fall back to NC and my device turns on. Right now I have it rigged up to some LED lights. When I turn power on to everything, the lights come on for a split second till the 5v+ is applied to the relay. After that they act as I wish, I use the NO, and it is open till the arduino sends 5v to the pin for that relay. So the issue is only at startup. But once in my real application, if the 5v side dies and the arduino and relay lose the 5v power supply the relay that should be NO goes to NC, and if my 12v and 24 circuits still have juice everything is going to turn on, which is not what I want. Maybe it is just this brand. But it also means the coil is consuming electricity just to maintain the default state.

A bit confused about what is being said.

New people often see a problem when relay modules are connected to the Arduino at power up time.

At power up (when power is first applied OR at reset) the relay turns ON.

The relay module being discussed is depicted below and is a typical offering to hobbyists.

An output from the Arduino connects to the IN terminals on the relay module.

When the Arduino output goes LOW, the associated relay energizes/picks.

When the Arduino output goes HIGH the relay de-energizes/drops.

When the Arduino powers up, we use pinMode to make the control pin an OUTPUT.

After doing this, the pin sits in the LOW state, hence the relay is energized when the Arduino powers on.

What needs to happen is code should make the controller pin HIGH prior to making that pin an OUTPUT; this will prevent the relay from picking at power up time.


1 Like

I tried that, nothing would stop it from closing the circuit with no power to the board. As soon as power to applied to the board the relays click into their default position.

I got this board, works like I need. When power is sent to the board none of the relays click and the NO is NO with or without power applied to the board. Once I send power to the pin, then the NO goes to closed and my device goes on. So all fail safes are to open the circuits and turn everything off.
ANMBEST 2PCS 4 Channel 5V Relay Module with Optocoupler High or Low Level Trigger

If you look at your board;

There are some jumpers, which I believe, to set the operation of the relay.

LOW activates the relay
HIGH activates the relay

Tom... :smiley: :+1: :coffee: :australia:
PS What makes you think its a ELEGOO 8 Channel DC 5V Relay Module with Optocoupler?

You relay looks like one of these;

5V 1 / 2 / 4 / 8 Channel Relay High Low Level Optocoupler Module

Condition:100% Brand New
Model Number: D74049
Product Name: Optocoupler Module
Material: Copper + Plastic
Color: Red & Blue
Channel Type: 1 / 2 / 4 / 8
(Please let us know the channel you’d like,You can leave the message on your Paypal note to tell us.)
Voltage: 5V

Module interface:

  1. DC+: positive power supply (VCC)
  2. DC-: negative power supply (GND)
  3. IN: can be high or low level control relay

Relay outputs:

  1. NO: normally open relay interface
  2. COM: Common Interface Relays
  3. NC: normally closed relay interface

High and low level trigger options:

It is low level trigger when jumper connect to LOW pin
It is high level trigger when jumper connect to HIGH pin

That last bit is the significant bit of the description.
Definitely not ELEGOO.

Tom... :smiley: :+1: :coffee: :australia:

The original board I was testing was an ELEGOO, but it would not work the way I wanted. I had an ANMBEST that was 12v activated and I tested it and it worked the way I wanted, in that the relay coils only energize when the power to the board is on AND the power to the pin is applied. So the picture is the 5v ANMBEST I ordered and I am returning the ELEGOO I could not get to work how i needed.

I'd say if there is an expectation that the MCU will have it's power removed but is expected to maintain state without power that an alternate power source be applied to the MCU. With an alternate power source available to the MCU the MCU could function as desired when main power is lost.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.