This is an old revision of the document!
Introduction
The objective of this project is to create a smart lock for doors using an ESP32 module acting as a asynchronous web server, which will receive HTTP GET commands from an android application.
Hardware
Main components:
Components for NPN transistor switch:
10k resistor
2k resistor
NPN 2n2222 transistor
Circuit Diagram
Because in the relay needs 5V on the IN pin, the ESP32 GPIO pin (which uses only 3.3V) won't be enough to turn it ON/OFF. As a workaround, the whole Relay will be connected to the 5V Vout of the ESP32, but on the IN pin we will use a NPN 2n2222 transistor switch that will be controlled by the 3.3V GPIO in other to turn ON/OFF the 5V.
Circuit diagram of the NPN 2n2222 transistor switch:
Software
Arduino (ESP32 Coding)
Connecting ESP32 to WiFi and making it a webserver.
Android
Connecting the Android application to ESP32.
Sending HTTP requests
Conclusions
Bibliography