I took a 'fastest project challenge' on myself and came up with this.
A LockerBox that you can open wirelessly. What's amusing is the small size of the Bolt Module. You can put as many features and functions to this box and none of it needs to be stored here. Everything will be controlled from the cloud.
I surely made it in a hurry, and the box turned out pretty ugly as well.
The project building steps will be very short as it is a mini-project.
STEP 1 - BOX HardwareI had a box from amazon delivery which I used in my case. Cut out an acrylic board for the roof. Which will open and close.
Used a wire hinge mechanism to make a roof the flaps open and close. The hinge was pretty easy to make as it only required a couple of iron wires to do the job. You can use the wires from paper clips as well to construct this. Take reference of the below image for that.
Make 2 of these hinges and attach it on two sides of the roof connected with the box for balanced support.
Overall, you can use ANY mechanism for making a box. Or buy abox for yourself, that's YOUR choice!
STEP 2 - IoT HARDWAREThe Next step is to use a locking mechanism for your box, which will be controlled using a servo motor.
I used a basic door lock mechanism and controlled the bar of the lock with a servo motor. You can look at the below GIF as a reference of what I have done. (VERY MESSY I KNOW)
When the box gets locked, the above servo motor mechanism takes place. And the wire rod enters into the hole of the roof flap. (Image below)
In this way, I have controlled the locking mechanism of the Box.
STEP 3 - PIN code Interface (Web-Page)Here, I have made a web interface with a customized hashing algorithm on the javascript side, which is a one-way pass-through. You can use any hashing algorithm on the internet, and in case you want to know how to make a customized one, you can get in touch with me.
So, in here, once the 4 DIGIT PIN is taken as input, the algorithm checks if the input matches the hash, If it matches, then it executes a function that controls the lockerbox servo motor.
Here, you can redirect this to the serverside code, so that the source code of the locking mechanism is not on the client-side. With this, the features of your box can be controlled from the client side.
Below is a hashing algorithm that converts string input to a 32bit integer. You can use this, to store your Pincode safe in source code.
function hashCode(pin) {
var hash = 0, i, chr;
if (pin.length === 0){
return hash;
}
for (i = 0; i < pin.length; i++) {
chr = pin.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
};
var pin = hashCode("1245");
console.log(pin);
That's it! If the pin matches, then the servoWrite function controls the servo motor using the Bolt Module.
You can make your versions of LockerBox as well !! Do comment below your versions of this project and send a video/project link too!|
Video Demonstration -
Comments