I bought this relay from Amazon.
I'm trying to use it to turn power on/off for a stepper motor I'm using. I've previously used a single channel relay for this which turned on when the signal was HIGH and off when the signal was LOW. It seems like this new relay works in exactly the opposite way. I'm guessing this is because the 4-channel relay is "active low".
It currently works if I just send LOW when I need to turn it on and HIGH when I need to turn it off, even if it seems counter intuitive to do it this way.
My main concern is the relay is almost on when the Raspberry Pi is booting up for the first few seconds. By almost on I mean that the LED signalling me that the relay is in its normally-closed position is on, but not as bright as when I turn it on by sending the LOW signal to it. I don't think current is passing through it in this state.
This almost-on state also appears after I turn off the Pi with
sudo shutdown now. As you can imagine, I would prefer the relay to be completely off in this state. Here's a diagram of how things are wired:
I have also tried adding a pull-down resistor, although I'm not sure I'm doing it right, see diagram below. With this wiring, the almost-on state mentioned above is turned into an on state, which is even worse, because current is flowing through the relay from boot until I run the script and send a HIGH signal to the relay.
- How should I wire things so that the relay doesn't turn on when the Pi boots up/the script is not running/ Pi shuts down?
- Less important: is there a way to turn on the relay by sending HIGH and turn it off by sending LOW?