Page 1 of 1

relay - opposite functioning

Posted: Fri Feb 19, 2016 10:58 am
by malini
Hi!
I'm controlling a led using raspberry pi from a relay board. It is interfaced with a photo sensor program wherein the led has to light up when it is dark and vice versa. But when i'm connecting with the relay and giving suppose GPIO.LOW , it's doing the opposite i.e the led is lighting up. Why?

PS: GPIO.LOW and GPIO.HIGH are working fine when i'm just controlling the led using Pi alone.
please help

Re: relay - opposite functioning

Posted: Fri Feb 19, 2016 10:59 am
by scotty101
Which relay board are you using?

Many of them invert the GPIO signal so need a logic Low to close the relay.

Re: relay - opposite functioning

Posted: Fri Feb 19, 2016 11:00 am
by Massi
probably your relay is active low.

Re: relay - opposite functioning

Posted: Fri Feb 19, 2016 11:41 am
by texy
Probably the relay is permanently connected to +ve at one end of the coil and requires a low at the other in order for current to flow.....

Re: relay - opposite functioning

Posted: Sat Feb 20, 2016 9:11 am
by malini
Oh. Yes, i guess the board indeed is active low. It didn't strike me.
Thanks a lot! :)