Relay and virtual pin

After pressing the V2 button the relay: ON-OFF-ON
V2 stays on 1

Does your relay operate when a LOW or a HIGH signal is apples to the input pin?

Have you removed the Blynk.syncVirtual command?


I think HIGH

Blynk.syncVirtual command removed

It’s about V2 or D3

Test your relay by connecting the input (data) pin to VCC and then to GND.
Which makes the relay become energised?


If it turns on the V2 button = 1, it turns on relay D3

If you won’t do this test…

Then I’m not going to spend any time debugging your code.


Now it is working

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

char auth[] = "";
char ssid[] = "";
char pass[] = "";

SimpleTimer timer;
int Value;
int Relay = D3; 

  Value = param.asInt();

if ( Value == 1 ) 
   timer.setTimer(1000L, RelayON, 3);
   timer.setTimer(3500L, pinupdate, 1);

Blynk.syncAll ();

void setup()
Blynk.begin(auth, ssid, pass);

void RelayON() {
  digitalWrite(Relay, HIGH);
   timer.setTimeout(500L, RelayOFF);

void RelayOFF() {
  digitalWrite(Relay, LOW);
void pinupdate() {

void loop()

Perfect! Now if you want to help the next one who stumbles onto this post for help you can explain what you were doing wrong and how you fixed it.