Arduino UNO + ESP8266 ESP-01 + Blynk - Smart Doorbell project

Hey guys, I’m new to Blynk and I want to try this project

In that link, he used Ethernet Shield but I only have ESP8266 ESP-01, so I tried to integrate it with that project like this

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_HardSer.h>
#include <BlynkSimpleShieldEsp8266_HardSer.h>
#include <SimpleTimer.h>
// Set ESP8266 Serial object
#define EspSerial Serial

ESP8266 wifi(EspSerial);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "auth";
SimpleTimer timer;

WidgetLCD lcd(V1);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(9600);
  delay(10);

  Blynk.begin(auth, wifi, "ssid", "pass");
  
}
void notifyOnButtonPress()
{
  // Invert state, since button is "Active LOW"
  int isButtonPressed = !digitalRead(2);
  if (isButtonPressed) {
    BLYNK_LOG("Button is pressed.");

    Blynk.notify("Please open up! Somebody is on the door!");
     lcd.clear(); //Use it to clear the LCD Widget
  lcd.print(4, 0, "Open"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
  lcd.print(4, 1, "The Door!");
  }
}
void emailOnButtonPress()
{

  int isButtonPressed = !digitalRead(2); // Invert state, since button is "Active LOW"

  if (isButtonPressed) // You can write any condition to trigger e-mail sending
  {
    BLYNK_LOG("Button is pressed."); // This can be seen in the Serial Monitor
    Blynk.email("marcato@gmail.com", "Subject: Doorbell", "Please open up! Somebody is on the door!");
     lcd.clear(); //Use it to clear the LCD Widget
  lcd.print(4, 0, "Open"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
  lcd.print(4, 1, "The Door!");

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

But, when I try to upload it and see in the serial monitor to check if it’s already connected to my WiFi, this is what happened

This is the wiring condition after uploading :

Arduino ESP8266
3.3V --------------------VCC
GND--------------------GND
TX------------------------RX
RX------------------------TX
VCC-------------------CH_PD

Thanks guys

@marcato click magnifying glass (top right of this screen), type echo, click show more and then set Sort by to Latest Post.

Sorry @Costas, I don’t fully catch what you mean by that,
but before, I’ve already connected my ESP to my WiFi when I tried to use the simple example below with a simple push button in Blynk to turn ON/OFF the D13 LED in my UNO.

That’s why I assume there’s something wrong in the additional code I modified above which made my ESP can’t connect to the WiFi

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_HardSer.h>
#include <BlynkSimpleShieldEsp8266_HardSer.h>

// Set ESP8266 Serial object
#define EspSerial Serial

ESP8266 wifi(EspSerial);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "auth";

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(9600);
  delay(10);

  Blynk.begin(auth, wifi, "ssid", "pass");
}

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

It is very unlikely that your sketch changes relate to the echo failure. I’m not saying your new sketch is fine, I’m just saying the echo problem will probably not related to the sketch. Many users have had echo problems. I was suggesting you search the forum for the fixes offered.

Did you update the esp8266 firmware to the recommended one?

Where does the 3.3V power comes from? Sure it gives enough current? I have had some similar problems and often the power supply have been the reason. The 3.3V output from the uno is not enough, you should use a voltage regulator and connect it to the 5V and it should work. That was the case for me either way.

@Costas oh I see, thanks for your advice. I’ll look in the forum later

@nolmath sure, already done it. Thanks

@Bjorklund I think it’s okay, after I try it again today it works

But, the project doesn’t work like I intended to.
When I press my real push button in the breadboard, I can’t get any response. But when I use the Blynk’s push button to test the D13 LED in the Arduino it works fine.

Can you help me about this ?

@marcato so your echo problem appears to have gone now. Do you know why?

@Costas yeah, I assume it’s my WiFi problem, when I change my WiFi, the problem is solved by itself

@marcato I take it your physical button still doesn’t work though.

That is because you don’t have any code to check for the button press.

There are several ways to check for the button press and I notice you have the Simple Timer library in the sketch but you are not actually using it.

A. With Simple Timer (or Ticker if you move to using an ESP without an Arduino) check the state of the pin say every second.

or

B. Look into attachInterrupt for when the pin state changes.