High and Low Active 8 Channel Relays - A Question

I have just ordered a High/Low Active 8 Channel Relay Unit. I prefer to have a relay set to High Active as it matches my logic better when programming - just a personal thing. The photo of the relay looks very similar to my Low Active units but has jumpers to change High/Low operation.

Can my existing Elegoo Active Low relays be adapted to High ?

Is there anything I should be aware of by using Active High Relays ?

You can use an inverter to reverse logic or just do it in programming.

The easiest way is to do it in your software.

In your initializing code, define ON and OFF to match your relay logic:

#define ON HIGH      //Active high
#define OFF LOW

And in your code just use your defined constant:

digitalWrite(relayPin, ON);       // turn the relay on 
delay(1000);                      // wait for a second
digitalWrite(relayPin, OFF);      // turn the relay off
delay(1000);                      // wait for a second

This would be for an active high. If you want to use active low, then just swap the definitions:

#define ON LOW       //Active low
#define OFF HIGH

Please do not ask such questions without giving a (Web) link to the board about which you are talking.

Paul__B:
Please do not ask such questions without giving a (Web) link to the board about which you are talking.

Added :slight_smile:

Thank you SteveMann.

"In your initializing code, define ON and OFF to match your relay logic:"

I didn't know you could do that - very useful.

John

You could bridge the input to ground then sever the connetion to VCC... ugh... not worth the headache changing them this way. Just buy the ones with option or change in software.

Time to be flexible and use/understand negative logic :wink:

BTW, does this give a clue:

“Each path of the module can be triggered by a high or low level by a jumper setting.”

"The relay module is isolated by a chip-type optocoupler"

Tits on a bull.
These relay 8-relay boards shouldn't even exist.
The above statement implies that the module is opto-isolated, which is a big lie.
Opto-isolation needs 11 pins. This board only has 10.
Leo..

it's easier to sink than source.. just sayin

larryd:
BTW, does this give a clue:

“Each path of the module can be triggered by a high or low level by a jumper setting.”

That's why I ordered it thanks.

larryd:
Time to be flexible and use/understand negative logic :wink:

At 75 years of age and just starting to learn the Arduino and programming, I have to keep things within my way of logic thinking. I have written programs for relays which are LOW active but I would find it much easier if HIGH = HIGH etc. :slight_smile:

baxwalker:
I have just ordered a High/Low Active 8 Channel Relay Unit. I prefer to have a relay set to High Active as it matches my logic better when programming - just a personal thing. The photo of the relay looks very similar to my Low Active units but has jumpers to change High/Low operation.

Can my existing Elegoo Active Low relays be adapted to High ?

They common up the optocoupler's anodes to the Vcc rail, so no.

Is there anything I should be aware of by using Active High Relays ?

https://www.amazon.co.uk/gp/product/B07QLYZ364/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Well that board appears not to be isolated, despite having opto isolators. Not sure that's a great idea.

I'd suggest you realize that active-low logic is everywhere and nothing to be shy of.

baxwalker:
Thank you SteveMann.

"In your initializing code, define ON and OFF to match your relay logic:"

I didn't know you could do that - very useful.

John

You can also hide the details in a function, always a good idea, hiding details is a very important
part of coding:

void switch_relay_on (byte pin)
{....}

void switch_relay_off (byte pin)
{....}

Many here are your age :wink:


A few more:

#define pickRelay LOW
#define dropRelay HIGH

#define Pushed HIGH
#define Released LOW

#define Enabled false
#define Disabled true

#define LEDon HIGH
#define LEDoff LOW