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 ?
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:
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.
"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..
larryd:
Time to be flexible and use/understand negative logic
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.
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 ?