-
1Assemble the PCB
Solder the MCP23017, terminal blocks, and header pins. We used a hot air station at 300°C for the SOIC package — took about 20 minutes.
-
2Wire the solenoids
Each solenoid gets +12V from the PSU and ground through a MOSFET (IRLZ44N) controlled by the MCP23017. Add a flyback diode (1N4007) across each coil.
-
3Mount the reed switches
Hot glue them to the locker door frame. The magnet goes on the door itself. Wire the switch to the screw terminal — one side to 3.3V, the other to the expander input.
-
4Flash the Pi
Write Raspberry Pi OS Lite to a 32GB SD card. Enable I2C and serial in `raspi-config`.
-
5Install the software
Clone our repo, run `make` to compile the locker controller, and `systemctl enable locker.service`. The service auto-starts on boot.
-
6Configure Nayax.
Pair the VPOS via Bluetooth to the Pi. Set the terminal to "unattended mode" — it'll auto-approve transactions under $50.
-
7Test
Run `python3 test_locker.py` to cycle all doors open/close. Then run a test payment with a $0.50 charge to your own card.
Himanshu Dada
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.