Blynk on relay on

blynk off relay instead on, blynk on the relay off. how do I make it so blynk on relay on?

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#define RELAY_1 13 //pin relay

char auth[] = “ad053bd16b054992a30fb76895658216”;

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “CHUMBUCKET”;
char pass[] = “cariwifilainaja”;

// Hardware Serial on Mega, Leonardo, Micro…
//#define EspSerial Serial1

// or Software Serial on Uno, Nano…
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);

pinMode(RELAY_1, OUTPUT);
digitalWrite(RELAY_1, LOW);

}

void loop()
{
Blynk.run();
}

what relay? picture?

but i thought you could just change the wires on the relay?

how is your Blynk phone app set up? picture?

very nice code @aziz_masr wish I’d thought of that.

1 Like

Your relay probably works the other way around. When Pin is HIGH it’s on, and on Pin LOW it’s off. Try that. I have a couple of those :slight_smile: