i have a ESP8266-12 and will use the D8 with a 4N25 as input for an AC detector.
Configuration:
Code: Select all
0-----/\/\/\/\-------- + 1
mains 100K --^-
D1 4N25 5------ D8 ESP8266
0----/\/\/\/\/------ + 2 4 ---- GND
100K
D1 1N4007
As plugin P001 switch, i shall use it with PULLUP and when mains detected, GND on pin D8 will internally get HIGH.
My problem. VACC Not working.
My rules are:
Code: Select all
On System#Boot do
GPIO,2,1 // status led - inversed - 1 OFF, 0 ON
GPIO,12,0 // pb 2-4 PB24
GPIO,14,0 // pb 5-8 PB58
GPIO,15,0 // ACC sense
GPIO,13,0 // pb off PBOFF
endon
on MQTT#Connected do
event,publishstatus
endon
// loop
// B58 - statusoff P3 D5
On B58 do
pulse,14,1,500
pulse,2,0,500
// stopped - publish
endon
// B24 - status24 P2 D6
On B24 do
pulse,12,1,500
pulse,2,0,500
// started - publish
endon
// BOFF - statusoff P1 D7
On BOFF do
pulse,13,1,500
pulse,2,0,500
// started - publish
endon
// VACC - status
on VACC#status do
if [VACC#status]=1
let 1,1
else
let 1,0
endif
endon
By VACC, i get nothing.
Any hint of what may i be doing wrong?