BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Garage door remote control

Hello, I’m trying to make a simple project to open my garage door with an ESP8266. What I want it to do is to activate a relay, send me a message through the terminal and make the integrated LED blink. The problem is that I’m new in this of arduinos and programming, and I don’t know how to make the arduino send a message to the blynk app. Also if somebody could tell me if the code is correct I would appreciate it. Thanks!


#define BLYNK_PRINT Serial

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


char auth[] = "asdf"; //not the real one


char ssid[] = "MOVISTAR_AO1E";
char pass[] = "F7736A3CE2CB15E12FC7";

void setup()
{
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(V0, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(V1, OUTPUT);
  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();

  if(V0==1){
    digitalWrite (5, HIGH);
    digitalWrite (LED_BUILTIN, HIGH);
    Serial.print ("Porta oberta.");
    delay (500);
    digitalWrite (5, LOW);
    digitalWrite (LED_BUILTIN, LOW);
    }
}


Your code isn’t compatible Blynk, and unfortunately it seems that the the document that explains how to fix your issues of a cluttered void loop and use of delays has been removed.

However, there are dozens of Blynk Legacy garage door opener projects on this forum, so I’d suggest that you take a look at those.

Pete.

Would you like to use blynk legacy or blynk 2.0 ?

but isn’t blynk legacy outdated?

You still can use it.

And which are the diferences between them?
And if it is better for my project, how can I get it?

Take my advice and use blynk 2.0.

Okay thanks. I’ll look for some ideas on the forum.

Are you using esp8266 esp-01 ?

It is an ESP8266MOD, don’t know if that’s what you’re asking, I don’t really know because I bought in on Aliexpress

Is it like this ?

Nope, I think it’s esp 12 based on online photos

Like this ?

Only the main chip, but yes

So you just have the Chip only ?


its this one

Alright, you will need 2ch relay module to control the direction of the motor, 2 push buttons to open and close the door manually, 2 limit switches to get a feedback.

Well, the motor itself is already controlled by its own controller, what I wanted to do was only make the esp act as a button with a relay, as if I had a normal button, and maybe later add a limit switch to know if the door is open or not

Okay, I would like to help you with this.
Your only problem is the sketch right ?

Thanks! Well, my main issue is the code because I don’t know a lot of coding and even less about Blynk. I haven’t tried it yet but at least lets me compile it haha
Tomorrow I’ll try it because now i don’t have time