-->
Page 3 of 3

Re: ESP8266 sonoff

PostPosted: Wed Jun 19, 2019 5:15 am
by rudy
bircastri wrote:It is very strange, because I can see led light turn on only when connection wifi is lost.



Code: Select all//STATO RELE
int OFF = 0;
int ON = 1;


The port pin needs to put out a 0 to turn on the LED. The led is connected to Vcc and the port pin has to go low in order to turn it on. You need to handle on and off for the led different than the relays.


Code: Select allint statusOFF = 1;
int statusON = 0;


EDIT:
https://www.itead.cc/wiki/images/f/fe/S ... ematic.pdf

The leds are on page three. The status led is connected so a low will turn it on. The relay leds are handles differently. they have a mosfet that drives then and that inverts the signal. So for the relays a high will turn on the relay leds. I don't understand why the did it different with the Green status led.