WiFi Door Lock using ESP32 CAM & Blynk App


In this IoT project, I have made a DIY Smart WiFi door lock using ESP32-CAM and the Blynk App. In this ESP32CAM WiFi lock project, when someone presses the doorbell, you will get a notification on the mobile with a photo of that person. After checking the photo you can also unlock the door from your mobile phone.

ESP32-CAM smart Door Lock control from Blynk

As you can see in the above picture, you can easily take the picture and unlock the door from the smartphone using Blynk App.

Circuit of the ESP32CAM WiFi Door Lock

ESP32-CAM WIFI Door Lock Circuit

We can easily make this smart door lock with the camera using a 12v electronic lock, ESP32-CAM module, and some basic electronics components. 

Required Components for WiFi Lock

ESP32-CAM WIFI Door Lock components
  1. ESP32-CAM
  2. Electronic door lock 12v
  3. TIP122 NPN Transistor
  4. 7805 voltage Regulator (5v)
  5. 10k Resistors (2no)
  6. Capacitor 220uF
  7. Push-button
  8. 12V DC adaptor
  9. FTDI232 USB to Serial interface board (for programming esp32cam)

Programming ESP32-CAM board

program esp32cam with FTDI232

To program the ESP32CAM, I have used FTDI232 USB to Serial interface board. I have connected the FTDI232 with ESP32CAM as per the above circuit.

While uploading the code we have to connect GPIO 0 with the GND pin of ESP32CAM.

Before uploading the code to ESP32CAM, please check the following setting:

ESP32-CAM WIFI Door Lock code
  • Update the Preferences –> Aditional boards Manager URLs: https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
  • Board Settings:
    • Board: “ESP32 Wrover Module”
    • Upload Speed: “921600”
    • Flash Frequency: “80MHz”
    • Flash Mode: “QIO”
    • Partition Scheme: “Hue APP (3MB No OTA/1MB SPIFFS)”
    • Core Debug Level: “None”
  • COM Port: Depends On Your System
  • GPIO 0 must be connected to GND pin while uploading the sketch
  • After connecting GPIO 0 to GND pin, press the ESP32 CAM on-board RESET button to put the board in flashing mode

Tutorial video of this IoT project

In this tutorial video, I have shown how to make this DIY smart wifi door lock with esp32 cam step by step. For better understanding please watch the complete video.

Blynk App setup to control ESP32CAM WiFi Lock

ESP32-CAM WIFI Door Lock blynk setup

In the tutorial video, I have explained how to use the Blynk app to control the smart wifi lock in detail.

Steps for the Blynk App setup:
Open the project in the Blynk AppClickon the “+” icon on the top.

  1. Select the Image Gallery Widget from the Widget Box
    (Setting: Pin- V1) (Function: show the image)
  2. Select the Styled Button from the Widget Box
    (Setting: Pin- GP14, Mode- PUSH) (Function: capture photo)
  3. Select the Styled Button from the Widget Box
    (Setting: Pin- GP12, Mode- SWITCH) (Function: Unlock/Lock door)
  4. Select the Notification from the Widget Box
    (Function: get the notification)

Please refer the tutorial video for more details.

Testing the ESP32CAM WiFi Door Lock circuit

ESP32-CAM WIFI Door Lock testing

After the Blynk app setup I have tested the circuit.

Supply 12V DC to this smart WiFi door lock and connect your smartphone with the same WiFi network.

Now if you press the push button you should get a notification on the mobile phone.

After that click on the ‘Take Picture’ button to get the picture and then click on the ‘Unlock Door’ button to control the 12v electronic lock.

After testing the circuit, I have fitted the WiFi lock at the main door.

I hope you like this Smart home project using ESP32-CAM and the Blynk app

You can also subscribe to our newsletter to receive more such useful electronics projects through email.

Please do share your feedback on this ESP32 CAM project. Thank you for your time.