Contact me
my project is a smart piggy bank
to ensure me having my money safe
what inspired me to make it is my desire to save my money in a cool safe
and to lock it with a password
I inspired the design from the cash drawer used by cashiers
and I made a simple safe-like handle to combine the 2 designs together
I inspired the shape from this cash drawer
from the beginning I decided to join the bodies using brackets
I started by drawing the ground
then designed the rear of the bottom box
made one side and copied it to the other side
and using joint feature I joined them to the rear part
the money box top has a lot of details as all components will be placed on it
I projected the components on it so I can have a clear vision on the final result
the front panel will be having the solenoid lock and holes for the handle
the front panel of the top part was joined usin t-slot
the designed one side and copied it to the other side and joined it with the front panel
then draw the rear part and joined it to one side
then designing the top and final part
placing the electronics on the enclosure
brackets placement inside the design
I designed the handle like that to make it rotate as in a real safe ,it's just decorative but I learned a lot designing it.
a video of the design process , although beng a bit messy
for designing and drawing I used fusion 360
I used grab cad to get the electronic components
Ultimaker Cura
to prepare the Stl files into Gcode for the printer
Laser waorks
prepare the .Dxf files for laser cutting
Fusion360
fusion for exporting the ,DXF files
and the .STl
First I exported every single panel as .dxf files with total of 11 panels using fusion 360 plugin
then I divided them into 3 projects in laser work to make them on the laser cutter
as it's all cutting it was set for cutting at speed 15 and power 65
the laser cutting process
For 3d printed parts Firstly I exported them as an Stl from fusion 360
After that I sliced them in Ultiamaker cura
arduino uno r3
the main controller
Buzzer
output
to make a tone for the wrong password or the wrong one
crocodile wires
power management
Leds
output
red led to alarm with wrong password
green led for the right password
Jumper wires
power management
breadboard
power management
I2C LCD
output
to communicate with the user
and making the project more user friendly
3*4 Keypad
input
entering the password
solenoid lock
output
to lock the safe till the right password is entered
12v adapter
power source
220 resistors
power management
Relay
output
to control the 12 v needed for the solenoid
as the arduino is the heart and the brain for the project
I started by putting it and connecting it with
the keypad (input)
this keypad has 4 rows and 3 columns
each of them has its pin so 7 pins total
I connected the columns to the pins
2,3,4
and connected the rows to the pins
5,6,7,8
then I connected the I2c LCD
I2 c lcd has 4 pins
for powering:
vcc -> 5v
gnd ->gnd
for data :
SCL-> A5
SDA -> A4
separately I connected the solenoid lock (output) with the relay (output) to makea closed circuit
we connect the solenoid to the relay in series to let the relay work as a switch
here I put the the relay on arduino
, and on the othe side of the relay is the arduino related side
which has the vin and gnd for powering
and "in" for signal -> pin 13
As I will power the arduino using the 12v adapter
I did a little trick here for power management
I took the power source for the solenoid from the vin power output in the arduino and replaced the previous connection with this new one
As a result now I don't need 2 power sources for operating the arduino and the solenoid separately it's just 1 power source for both
here I connected the 2 leds with their resistors on the bread board
red led -> 10
green led -> 9
then connected the buzzer -> pin 11
here a video of the circuit operating
using the 5v from the laptop only
which is why the solenoid doesn't operate but the relay does
for the power source I used the 12v 2A adaptor
since the solenoid uses 12v for operating correctly
and the arduiono can work in the range of 7~12 v
Starting with including the needed libraries
Keypad.h for keypad controlling
Wire.h to communicate with I2C devices
LiquidCrystal_I2C.h for communicating with the LCD
this Line for defining the LCD type an how many columns and rows it has
for determining how many rows and columns the Keypad has
for defining the keypad buttons
to define which pins are for columns and which are for rows
using a pre defined function within the keypad.h library
To know more about Keypads I recommend visiting This website as it where I learned how to use the keypad
and it really explained it well
Here I defined the password in a string variable
And made an empty variable the user entered password
naming the arduino pins as a more understandable names for
easier debugging
used const as it will remain the same till the project end
the setup function for defining the pin mode for each pin
intializing the LCD
setting the LCD cursor at row 0 column 0
and write "Enter Password"
we make the variable key to store the entered keypad value
using customKeypad.getKey() from the library
an if condition activates whe n a button is pressed
and a nested if condition to check which button is pressed
Starting with " * " to delete the entered value and restoring the "input" vriable to empty
and clear the LCD and reshow "Enter Password" once again
inside the main if condition
an else if to cjeck if the button pressed is " # "
if true it checks if the input equals the password
if it's true
it lits the green led and make a note using the buzzer
and opens the solenoid lock
if the input doesn't equal the password
the else activates the wrong pass word condition which leads to
the red led is let
and making 3 different tones with the buzzer
and off the led again
the lock remain the same locked
after 2 seconds
the input return to be empty
the LCD clears and reshow "Enter Password" once again
if not " * " or "#" then it means that it's a number
then we start taking numbers for the password
using the length function we set the password length for 4 digits
and after each digit entered the cursors moves one step back and writes " * " instead till 4 digits are written
All what I needed for the integration
all components of the project
m3 screws and nuts
3d printed brackets
wood panels
safe handle
electronic components
Integration process
Bringing the ground pane and attach the brackets
Attaching the walls and the upper brackets
Starting at the top part
attaching the money box top panel
the brackets for the top part
putting the arduino
placing the relay
Finishing the money box
attaching the solenoid on the front panel
using 2 diagonal scews
join the groundand the front using hinge
attaching the safe handle
and the front panel of the top part
Connecting the main components
attaching the 3 -wall panels and joining them using the brackets
placing the bread board with the buzzer and the
2 resistors of the led
taking the power from the arduino
and connecting the buzzer to the arduino
placing the components on the very top panel
the 2 leds
the keypad
and the LCD
from the back
I used crocodile wires to connect the leds
connected the male-male jumpers to the keypad
placed the LCD using screws and nuts
Finishing the project
connecting the LEDs and the keypad to the arduino
connecting the LCD
sealing the top part
the features shown in this video
1. writing the password
2. delete the wrong written password
3. alarming for the wrong password using the buzzer and red led
4.openning the safe with soft toneand the green led
the first challenge I faced was how to program the kety pad and after searching , I found that there is a library for the keypad so I included it
and start using its functions what made it so easy
I found all things about the keypad HERE
the example which I copied most of the keypad programming from
the second challenge was about how to place my solenoid lock
as for safety I didn't want its screw heads to be shown
then my instructor Manar suggested if we make a handle to hide these screw heads
another feature is to link the safe with the phone using bluetooth module
to insert password or get alarmed when attempted to interact with the safe