My sons requested a keycode-based access control system for their backyard fort. I'm pretty happy with what we created. In this blog post I'll talk through the details of what we built and why.
- Adafruit Metro ESP32-S2
- The Adafruit Metro ESP32-S2 is a fairly inexpensive ($20) controller that includes wifi and Adafruit's Qwiic I2C connector system.
- Sparkfun Qwiic 12 Button Keypad
- This keypad has an included Qwiic bus adapter, which makes wiring much (much) easier.
- COUNS CU-S280C Single Door 12V 600lbs Electromagnetic Lock
- I got this lock on eBay for about $25. It works well with a 9 or 12 volt dc power supply.
- Fuses (PTC Fuse Resettable Fuses 72V 0.5A 500mA RXEF030 Series)
- Qwiic Button
- shall not allow a child to get stuck
- shall be resistant to critters/teenagers
- shall not require physical keys
Cyberphysical System Models
This specification, written in the Architecture Analysis and Design Language (AADL) describes a magnetic lock actuator that physically actuates (locks) only when power is applied to the system and the lock gets an actuation signal. The first section, "lock_actuator" describes the desired behavior in terms of assumptions and guarantees. The section section, "lock_actuator.magnetic_actuator" describes the state transitions of a particular lock design.
import boardimport sparkfun_qwiickeypad...i2c = board.I2C()keypad = sparkfun_qwiickeypad.Sparkfun_QwiicKeypad(i2c)