Chat freely about anything...

User avatar
By dezdez20
#63752 Hello everyone, I am doing a home automation project using ESP8266 Olimex board and AREST Cloud server. I am using it along with a relay, to control a lamp. Almost everything works well except that the AREST interface turns ON the lamp when the OFF button is pressed vice versa. Does anyone know what the possible issue may be? Thank you
User avatar
By martinayotte
#63783 When using GPIO to drive external devices such LED or relay, it can be connected in 2 ways, sink mode or source mode.
Depending of which mode, turning ON the external device by setting GPIO output either LOW or HIGH depending of the connetion mode.
So, in your case, you need to invert digitialWrite() states.
Image
User avatar
By martinayotte
#63844 Check how the relay is hookup on the Olimex schematics.
My explanation should be relevant for relay too, meaning that digitalWrite() inverted state would work there too.

EDIT : I've look at the Olimex schematic, and it is driven in a way that HIGH on GPIO is turning the relay ON.
So, the problem must be somewhere else in you code.