We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Salim Benbouziyane · 97.7K views · 4.1K likes
Analysis Summary
Worth Noting
Positive elements
- This video provides genuine value through its open-source GitHub repository and the honest inclusion of the creator's PCB design mistakes and their subsequent fixes.
Be Aware
Cautionary elements
- The 'gear-porn' presentation style may subtly influence viewers to purchase specific high-end tools (like the digital microscope or soldering station) that are not strictly necessary for the project.
Influence Dimensions
How are these scored?About this analysis
Knowing about these techniques makes them visible, not powerless. The ones that work best on you are the ones that match beliefs you already hold.
This analysis is a tool for your own thinking — what you do with it is up to you.
Transcript
Sponsored by Red Magic. More on them later. A while ago, I retrofitted an outdated alarm system to work with Home Assistant and HomeKit using a device called Konnected. And honestly, it worked out great and I used it for a long time. But relying only on my phone to control it got eventually pretty annoying. So today, we're fixing that by building a dedicated smart home controller using this ESP32 module. I'll show you how I designed the PCB, built a custom enclosure, and powered everything using the ESP Home framework. Let's get started. So, why build a custom device from scratch? Well, I tried looking for existing solutions, but none of them really worked for me. The Konnected documentation seem to recommend using an entire tablet as a controller, but I'd rather have a single purpose device for this. I also found the Zigbee keypad, which would work, but it was kind of expensive and lacked most of the features I wanted. So, the first step, as usual, is defining some clear design goals and constraints. First, I want a quick secure way to toggle the alarm state in Home Assistant. For that, I'll use this fingerprint scanner to authenticate quickly and locally. These scanners have their own microcontroller for registration, matching, and fingerprint storage. But we can't rely just on biometric scanner without any fallbacks. So, I'll also include a keypad to input a code directly if your guest or your fingerprint isn't registered in the device. Next, I want some visual feedback at a glance. So, we'll add some RGB LEDs to represent the system status. For the firmware, I'll use ESP Home because it works incredibly well with Home Assistant and provide encryption and native API access out of the box. With that in place, let's prototype this device with the dev board and few modules. I wired the sensor to an ESP3 dev board, added a matrix keypad for pin entry, and a Neopixel ring to act as status LEDs. For now, we can get started from the ESP home device builder tool in Home Assistant by flashing the board for first use and tackling the first task, toggling the alarm with the fingerprint sensor. Because this module handles registration and matching on its chip over serial, we just need a way to send commands and listen for a valid match to affect the alarm from home assistant. To do that, we can use these convenient call backs provided in the component configuration. First to change the LED on the sensor for visual feedback and second to delegate all the actions for managing fingerprints to Home Assistant through the button component. At first the reader has no fingerprints stored so nothing matches obviously. To trigger enrollment we press the button we created in Home Assistant and start the capture by scanning the first ID twice. Once that complete we'll get a match whenever we scan. Now great. Now we can go back to the configuration and on our successful match we can fire an internal event in home assistant from our device to signal that a user authenticated successfully with the reader. With that event captured I used it to create an automation that toggles the alarm depending on its state if its army turns off and vice versa. With this working, we can now manage the sensor directly from home assistant. But what if someone that is not enrolled needed to interact with the alarm? That's where the keypad comes in. I use the key collector component together with the keypad matrix to handle the buffer timeouts and validation. When a valid code is entered, the device fires another home assistant event. This time with a pin as a payload. And similar to the scanner, another automation passes that pin to Alarmo which checks against the stored users and toggles the alarm state if it's a valid pin. Now for visual feedback, it's pretty simple. I added an ESP light entity linked to another automation that watches the alarm state and changes the LED color accordingly. You could do more with this and indicate open sensors, for example. But for now, I'm good with just these three states. At this point, we have a functioning prototype. And we could stop here and solder everything to a protoboard, but I want to have a more polished look. So, next, we'll be making a custom PCB to have more control over the overall form and aesthetics. Just like on the div board, this S3 module carries the SP32 chip, it supporting circuitry, and the PCB antenna. At a very minimum, it only needs a stable 3.3 volt and a way for us to program it. So, I'm feeding it with this voltage regulator and USBC connector. Because the S3 supports native USB, there's no need for a separate USB to serial chip. I also added reset and boot buttons for convenience. If you'd like more details about this part, check out the application schematic in the data sheet or this nice video by Atomic 14 linked below. Now for the peripheral, starting with the keypad, I used the 12 switch matrix with diodes from an old micro pad projects and I connected it to available pins on the ESP. I also made sure to break out a UR header for the fingerprint sensor and added a transistor to implement sleep mode as recommended on the ESP home docs. The status light is made out of four neopixels with a level shifter that I also reused from that old build. I added few extra protections as well, including resettable fuse and ESD doses on the USB lines for good measure. With the schematic complete, I moved on routing and defining the board outline. The keypad is the largest part on this PCB, so I placed those switches first, then the neopixels in the ESP module. I try to stay as close as possible to initial concept sketch. Sometimes you squeeze the board into existing space, but in this case, the board comes first and the enclosure will be designed for it. The way I place the fingerprint scanner in the initial sketch left a few gaps at the bottom. So, I decided to utilize that with a couple of optional environmental sensors since the device is already network enabled. That's why I also broke out the I2C header for any optional add-ons. After a quick round of checks, everything looked fine. So, I sent the files off for manufacturing. I didn't realize it then, but I made a couple of mistakes that we'll have to deal with later when the boards arrive. Before moving on to the enclosure, a quick word from this video sponsor, Red Magic. They make high performance gaming focused devices like this new Astra tablet they just launched. It has a stunning 9 in OLED display with 165 Hz of refresh rate and up to 1,600 nits of peak brightness, so it looks amazing even outdoors. Under the hood, it runs on the Snapdragon 8 Elite chip clocking over 4.3 GHz thanks to the built-in cooling system that combines vapor chambers, liquid metal 2.0, and a high-speed turbo fan. It comes in two beautiful finishes, and despite packing a massive battery, it only weighs 370 g, so it's surprisingly light and comfortable to hold. I've been using it recently and while it's clearly made with gaming in mind, it's actually become a solid everyday tablet with a smooth, enjoyable experience. If you're in the market for a new tablet, either for gaming or everyday use, check out the Red Magic Astra by scanning the code on the screen or clicking the link in the description below. Thanks to Red Magic for sponsoring this video. Now, let's get back to modeling the enclosure. I started by importing the board and building the plate that supports the 12 switches and give the PCB mounting points inside the outer shell. Having the PCB3D model at this stage is very useful. You can account for many details in advance like this light baffle and a diffuser to reproduce a light bar from the initial sketch. Around the fingerprint scanner, I added mounting holes for some Adafruit STEMA sensors and small vents to let the air pass through. The entire assembly snap fits into the wall plate and it has few mounting holes and tie points for the power cable. You can drop the cable from the bottom which lets me test the device first in a non-invasive way before committing to running cables inside the wall. The key caps are also left over from an older project. I'll include the models with the project files if you want to print them as well. With the cat finished, I sliced and sent the parts of the printer, white PLA for the diffuser, and matte black for everything else. [Music] In the meantime, the PCBs showed up. I was excited to test them, but I spotted a problem right away. See these tiny shiny circles? These are VAS that connect some of the top and bottom traces. They should be covered with solder mask, but mine are all open, which means they are conductive and can wick solder and short signals when I assemble this board by hand. So, to solve this, I thought of using nail varnish. I grabbed a fine brush and sealed the ones that are located near a pad or under a component that I won't be able to get to rework later. I'll also fix the board file so this doesn't happen again. With that patched, I applied solder paste, placed the SMD parts, the SP and the USBC connector on the bottom side, then refilled the first board on a hot plate. [Music] Of course, since I applied this by hand, it's a bit messy and I had to clear a few bridges and touch-up pads that ended up light on solder. Next, I flipped the board, added four neopixels in their caps on the top, and it was time for the first test. No smoke. That's always a good sign. I flashed some firmware via the ESP home tool to test the same way we did earlier in the prototype. [Music] The LEDs came up just fine, but the key matrix wasn't responding. After some digging, I realized that I am an idiot because the matrix keypad component in the ESP home expects the rows to be an output and I had wired that in the opposite way. So, I flipped the diodes to match what's in the docks and I retested the keypad. Luckily, it was working as intended. With that done, we can move on further in the assembly. I began by soldering a right angle header for power. My original plan was to power this via USB, but I didn't have a right angle cable that would fit on hand. Next, I set the fingerprint scanner into the outer shell and tightened it using the supplied nut. I added the two Adafruit sensors, routed their cable around, and secured them using M2 screws through the switch plate. [Music] The MX switches snap into the plate and will be soldered to the board later. I soldered the scanner wires directly to the pad, though you could use a heather if you prefer for this as well. [Music] Same things goes for the I square C bus. I cut one end of the SEMA cable and soldered it straight to the board. ESP [Music] Home makes pushing changes and updates super easy. Once the board initially set up, I can send changes and final firmware over the air. No need to plug it back to a computer. To mount the unit to the wall, I used command strips and I will be running the power cable through the bottom pass through. As I mentioned, I want to be able to test the device for a few days before committing to running the cables inside the wall. [Music] After installing the key caps, I zip tied the modded USB cable to the wall plate, snap the device into place, and the build was complete. [Music] [Music] [Music] As you just saw in the final shots, I made another unit for the other entrance. And now with the same firmware and automations, I'm able to interact with the alarm from both doors. Just remember, if you make multiples of this device, you will have to add the fingerprints to each of the sensors since they handle the matching all locally. Hopefully, this gave you enough of an overview and some practical insights to get you started with your own dedicated smart home devices. Using ESP32 and ESP Home makes this process incredibly easy, and I highly recommend it. The same approach will work in many situations. Obviously, you will have to change the peripherals to solve for your exact specific problem, but at the core of it, you will go through a very similar process. As usual, I will leave a link to all the project files in the description down below. And while you're at it, feel free to leave any of your suggestions in the comments. And I'd love to hear from you what you want me to build next. That's it for this project. Thank you so much for watching, and I will see you in the next one. [Music]
Video description
Check out the latest ASTRA Gaming Tablet from REDMAGIC here: https://bit.ly/4eczhLy I couldn’t find a keypad that had the features I wanted and worked with Home Assistant, so I built one myself with ESPHome. In this video, I walk you through prototyping, designing, and building a dedicated smart home device from scratch. 👋 Follow me: https://linktr.ee/salimbenbouz ⚡️ Project links: Github: https://github.com/sb-ocr/esphome-keypad Instructables: https://www.instructables.com/ESPHome-Fingerprint-Keypad/ 🔗 Videos mentioned https://youtu.be/tQ0dL_9M1wI --- ⚙️ Bambu Lab 3D Printers: Bambu Lab A1 https://bit.ly/4gwNFhK Bambu Lab P1S-Combo https://bit.ly/3VW4QBg Bambu Lab X1-Carbon https://bit.ly/3VTKfxx Bambu Filaments https://bit.ly/41RpVRe 🖥️ Desk gear: Grovemade Premium Desk Accessories 🍃 Get 10% off using code SALIM10 → https://bit.ly/grovemade-accessories 🛠 Tools: Autodesk Fusion 360: https://bit.ly/49dQyQN Soldering station: https://geni.us/16zcw5 iFixit Driver Kit: https://geni.us/pE8dvKd Magnetic Helping Hand: https://geni.us/qmbA3W Digital Microscope: https://geni.us/OvfXE Oscilloscope: https://geni.us/rHzAS8 🎬Video gear: Sigma 18-35mm f/1.8 DC Art Lens: https://geni.us/43RyE 90cm Octagonal Softbox: https://geni.us/tXzLg2U Motorized Camera Slider: https://geni.us/CKpHVYp Aputure Amaran 100D Light: https://geni.us/DitmF6 Aputure Amaran PT1C Tube Light: https://geni.us/zcYT Heavy Duty Light Stand with Casters: https://geni.us/W3aZy4Z RØDE VideoMic GO II Microphone: https://geni.us/3gEQb4 RØDE Wireless GO II Microphones: https://geni.us/HTWPS 🎧 Music: Epidemic Sound https://share.epidemicsound.com/cp32b6 --- 00:00 Intro 00:30 Design Goals 01:33 Prototype 03:35 PCB 06:26 Enclosure 07:28 Electronics 09:40 Assembly 11:47 Outro Affiliate links may be included in this page. I may receive a small commission at no additional cost to you. #diy #smarthome #3dprinting #homeassistant #esphome