The card tracks, along with the state of the door (open or closed) is stored in a SQLite database. It provides a REST interface for the Raspberry Pi to authenticate users, and it uses a self generated SSL certificate authority to sign a client certificate, to validate the identity of the Raspberry Pi, and to protect the card track hashes in transit. The new system uses a Node.js server that runs on our IRC server. These Python scripts also required root privileges, due to the GPIO being restricted on the Raspberry Pi. Registering new cards required SSHing to the Raspberry Pi and stopping the persistent Python script, running another Python script. The existing Python scripts stored card track hashes in a CSV file, and used SSH to send the state of the door (open or closed) for our IRC bot.
The 5 volt connection is wired to a micro USB cable, and the 12 volts is wired through the relay as I described. I used JB weld to secure the male side of a Molex cable to the project box. The power supply has a standard Molex power connector. Stepper motors use a considerable amount of current while idle, and they can get pretty hot.
I am using a 5 volt relay, (triggered using an NPN transistor, connected to a GPIO pin and the Raspberry Pi’s 5 volt output) to turn off power to the Easy Driver board when the stepper is not in use. All you need to do is connect your stepper motor’s coils correctly, provide 12 volts, and then pulse the step and direction pins to control your stepper. I am using the Easy Driver stepper motor driver from SparkFun. String wraps around the shaft of the larger gear, between it and the body of the lid. The smaller gear is mounted using a captive nut to the stepper motor’s axle, and it turns the larger gear. I accomplished this using a NEMA 17 stepper motor, and gears printed on the Computer Club’s RepRap 3D printer. The old handle was very easy to turn, but the new one was more rigid, so I had to build an opener that had more torque. It also turned out that the existing door opener was not able to open the new door.
When the Computer Club moved rooms, I wanted to improve the software that I had written for the door opener.
The code I’ve written for this project is available here.