My homemade safe

I made a homemade safe

Web server also on it:

Web server image 1
Web server image 2


1. Hardware

First, buy a raspberry pi($35), an Adafruit CharLCD plate, an electric lock,an NPN transistor and an adapter, that has both 12V and 5V output. Then build a case(could be wood, like mine or anything you want.) For setting up the raspberry pi see this tutorial. Enabling vnc and ssh is also helpful.

2. Building it

Mount the raspberry pi and the electric lock in the safe and the Adafruit CharLCD plate on the rpi. I also recommend buiding a keyhole, because the software may crash.

Safe image 1
Safe image 2


Connect the wires as shown. You can connect the NPN to another pin, but then you will need to change the code.



Configure the Adafruit CharLCD plate using this tutorial. Download the and the code.txt file and paste it in /home/pi/safe (you can put it anywhere, but then you will need to change the code.) Run it. It work's! Button up and down change the value of the digits, and the left and right set's what digit to change. And it start's to display the time if it's inactive for 2 minutes. To start it every time on startup edit the /etc/rc.local and type sudo python /path/to/ before the 'exit0'.

If you want also web server on it intall the apache2 web server and configure python script running using this tutorial. Paste this file in /var/www/html. Download the file and paste it in /usr/lib/cgi-bin. Make it executable, so type in the terminal window sudo chmod +x /usr/lib/cgi-bin/ Restart the web server using sudo service apache2 restart. Make the code.txt writeable by anyone, so code.txt →right click →Properties →Permissions →Change content →Anyone. Reboot rpi. Enter the raspberry pi's IP adress in your browser. Login with password 'mypassword'. It should now go to a page like the 2. image. You can change the password by editing the at the 11. line.

Note: Images resolution may be bad when viewing on mobile device.

If you have any problems please send me an email.