user-img

Mirko Pavleski

+ Follow

DIY Smart Code Lock with CrowPanel 1.28" Rotary Display

In this video, I demonstrate the simplest way to build an advanced, keyless security device using the CrowPanel 1.28-inch-HMI ESP32 Rotary Display. This module is a game-changer for DIY electronics because it integrates a touch screen, a physical button, and a rotary encoder into one sleek unit.

DIY Smart Code Lock with  CrowPanel  1.28
 
  • thumbnail-img
 

Hardware Components

  • CrowPanel 1.28inch-HMI ESP32 Rotary Display

    elecrow
    X 1 fenxiang

Tools, APP Software Used etc.

  • soldering kit

  • Arduino IDE (programming)

Story

 

 A code lock is a keyless security device—either mechanical or electronic—that restricts access to doors, lockers, or cabinets using a preset numerical code entered via a keypad. They eliminate the need for physical keys, allow for quick code changes, and can range from simple push-button mechanical models to advanced, smart-enabled devices.

 This time I will show you the simplest possible way to make such an advanced device, at the same time incredibly simple thanks to the beautiful CrowPanel 1.28 inch-HMI ESP32 Rotary Display. In one of the previous videos I presented you a way to make a variable frequency oscillator with this small display and there all its features and functions are described.

 In addition to the touch function and button, this module also contains a rotary encoder which makes it ideal for the device described in this video. Also, the Access Point function of the ESP32 MCU allows us to control it via Wi-Fi with a Smartphone.

  As I mentioned earlier, in this particular example I am using only a Crowpanel round display and will focus on the software part, which also means that there will be no need for soldering and connecting external components. However, in the case of a real lock, an I2C controlled relay or an I2C port expander with a standard relay should also be installed. For better visibility, the display module is mounted on a small PVC housing covered with self-adhesive wallpaper.

 Let me not forget to mention that this is actually a final exam project of a student from a vocational high school under my mentorship. In fact, my part of the code is only a small modification of the library as well as the way the display is initialized and managed. The remaining functional part of the code was completely developed by the student using the Free AI client. 

  It is important to emphasize that in order to compile the code without errors, you need to use ESP32 Core V 2.0.14 along with the provided libraries, and I specifically used Arduino IDE version 1.8.16. Otherwise, from the very beginning, the idea was to develop the code in a way that in the future we could very easily change many of the parameters that were defined at the beginning.

 Now let's see how this device works in real conditions. When the lock is turned on, the image appears on the display, which is divided into two parts. In the upper part, the specific number is entered, and the lower half is reserved for the complete password. In this demo case, the entered password will be visible, otherwise in real use only asterisks would appear here. We select the number by turning the rotating display, and confirm it by pressing the button. If we enter the wrong password, the frame around the number lights up red for the next 5 seconds, the display says Wrong Password, and a red LED rotates in the background around the display.

Conversely, if the password is entered correctly, the frame lights up green, a message on the display for the correct password, and a green LED rotates in the background of the display. During this Green period of 5 seconds, we have the opportunity to open the door. In a real case, by activating the green LED, a relay was also activated that unlocked the door.

I also mentioned that we will use the access point option of the ESP32 microcontroller, which makes this lock a Smart device. The code has created a simple web interface through which the lock can be controlled. First, we need to connect to the Wi-Fi network with the name "SmartLock_ESP32" and the password "12345678" with a smartphone (we define these credentials in the code).

Then we enter the address 192.168.4.1 in the web browser and by opening this address a beautiful control interface appears. Here, at the beginning, we can choose one of the two offered options: to open the lock, or to change the master password. 

If we enter "open lock", a keyboard appears through which we need to enter the code. The same signaling applies here as with mechanical entry as far as colors are concerned. If we want to change the master password, we enter the change password menu. 

There we have the option to first enter the existing password, and then we need to enter and confirm the new changed password. If the existing password is entered correctly, the successful password change will be signaled by a circular movement of the blue LED in the background of the display.

  And finally a short conclusion. This project proves that with the right HMI hardware and a bit of coding, you can create a high-end security interface that rivals professional systems in both look and feel. It is a perfect example of how modern microcontrollers can simplify complex mechanical tasks into elegant digital solutions.

 

Code

DIY Smart Code Lock with CrowPanel 1.28" Rotary Display

In this video, I demonstrate the simplest way to build an advanced, keyless security device using the CrowPanel 1.28-inch-HMI ESP32 Rotary Display. This module is a game-changer for DIY electronics because it integrates a touch screen, a physical button, and a rotary encoder into one sleek unit.

11
 
3
0
0

Share your project on social media to expand its influence! Get more people to support it.

  • Comments( 0 )
  • Like( 3 )
/1000
Upload a photo:
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP

You May Also Like

View All
Add to cart
Board Type : GerberFile :
Layer : Dimensions :
PCB Qty :
Different PCB Design
PCB Thickness : PCB Color :
Surface Finish : Castellated Hole :
Copper Weight : 1 oz Production Time :
Total: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.

PCB Assembly

PCBA Qty: BomFile:
NO. OF UNIQUE PARTS: NO. of Components:
Country: Shipping Way:
Assembly Cost: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
3dPrintingFile : Size :
Unit : Volumn :
3D Printing Qty : Material :
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Acrylic Type : AcrylicFile :
Dimensions: Engrave:
Acrylic Qty :
Acrylic Thickness:
Acrylic Color:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
CNC Milling File : Size:
Unit: Volumn:
CNC Milling Qty : Material:
Type of Aluminum: Surface Finish:
Tolerance:
Surface Roughness:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Item Price Qty Subtotal Delete
Total: US $0.00
Certified Product | Guaranteed Purchase: Full techsupport