That piggy bank is looking mighty low-tech these days, and you have to bash it open to get your cash. One piggy, one withdrawal. And then there are those cheesy, tin ”Wild West” lock boxes with the red combination dial. Not only do they lack wow factor, your granny could crack one in 30 seconds.
But stick an Arduino in a wooden box, along with a finger-operated sensor and small motor, and you’ve made a 21st-century treasure chest that’s suitable for a daily diary, petty cash, or even those special Rice Krispies recipes that your snoopy neighbor wants to steal.
There’s no key in this keyless electronic combination lock box; you just move your finger across a small optical window, and it’s “open sesame.” The combination to the lock is a secret movement pattern only you know.
How It Works
The keyless lock box uses a unique optical finger navigation (OFN) sensor as a combination decoder. The OFN sensor works much like an optical mouse, except it’s intended to be used in direct contact with your finger. They are used in handheld devices where a trackpad would be too large, but because they are more expensive than trackballs, they’re not common in consumer products.
Movement across the small surface of the sensor is converted to X and Y distance measurements — up, down, left, and right. Sequences of these movements make up the combination of the lock.
For this project I’m using the Parallax OFN module, which puts a commercial OFN sensor on a breakout board that provides connectors for power (3.3V to 5V), ground, and 6 signal lines. The OFN module uses 2-wire I2C to communicate with a microcontroller, and has additional I/O pins for such things as the momentary pushbutton switch that engages when you push the optical sensor down.
The locking mechanism uses a standard-size R/C servomotor that’s glued into the bottom of the box. To lock the box, the turning servo engages a metal arm attached inside the box’s lid. Turning the other way, it frees the bar, letting you open the lid.
An Arduino microcontroller works as the main brain of the lock box, handling all the communications with the OFN module, controlling the servo, and even making musical tones on a small piezo speaker.
For my box, I used a plain 8″ square cigar box from a craft store — no need to smoke a bunch of stogies. The wood is unfinished; stain or paint to suit. You don’t get Fort Knox with these boxes, but they’ll keep out the casual thief.
i am just starting on home projects but i have had prior experience with electronics on a larger scale, but what i was wondering is if you could give me links to where i could get all of the components, if so that would be awesome
Erotic Ev
I am interested in adding some pictures to my comments. Is there a way to do that?
not only that you can substitute this as a piggy bank, but like a safe as well.. great for keeping important things, even documents, money, jewelry, etc.. simple project that brings up more ideas from a mere storage substitute to anything that’s wanted to be locked out or something.. thumbs up!
The code to download for this project is found here:
cdn.makezine.com/make/32/keyless_lockbox_code.zip
how much do all the components to build this cost? roughly
I can not find the links for the programming. Can you tell me where I can find them. or can you post them.
hi, i written the programming but it did not work and i did not found OFN module in the serial monitor. can you help me please. the code is here: /*
This code connects to and reads data over I2C from a Parallax OFN module.
Device Info: http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/715/List/1/Default.aspx?SortField=UnitCost,ProductName
Datasheet: http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/27903-OFNModule-v1.1.pdf
Setup:
Arduino A4 connected to SDA
A5 connected to SCL
5V connected to VCC
GND Connected to GND
Removed these b/c they were causing errors with OFN (add ’em back if you can’t get it working)
–> 10K Resitor connected from SDA to VCC and from SCL to VCC
Parallax OFN Vdd connected to VCC
GND Connected to GND
CLK connected to SCL
SDA connected to SDA
Parallax OFN Register Table
Addr Register Read/Write Default Value
0x00 Product_ID R 0x83
0x01 Revision_ID R 0x01
0x02 Motion R/W 0x00
0x03 Delta_X R Any
0x04 Delta_Y R Any
0x11 Res Config R/W 00000000=500cpi 10000000=1000cpi
etc …
The values returned when set to 1000CPI resolution will cover the range from -127 to -127
*see below on how to change resolution by setting register 0x11
Trying a new I2C library that simplifies communication compared to wire.h
https://github.com/DSSCircuits/I2C-Master-Library
more info: http://dsscircuits.com/articles/arduino-i2c-master-library.html
*/
#include
//each device has a custom ID (parallax Unit is 0x33)
char deviceID = 0x33;
int result = 0;
boolean MOT = false; //is motion bit state
boolean OVF = false; //is OVF bit state
char deltaX = 0; //holds Delta_X reading from OFN
char deltaY = 0; //holds Delta_Y reading from OFN
int deltaXI = 0; //holds corrected (signed) Delta_X reading
int deltaYI = 0; //holds corrected (signed) Delta_Y reading
void setup()
{
I2c.begin(); // join i2c bus
Serial.begin(9600); // start serial for output
//if you need to chage the resoution of teh sensor uncomment the corresponding line below:
//I2c.write(deviceID, 0x11, B10000000); //Set the Resolution to 1000CPI
//I2c.write(deviceID, 0x11, B00000000); //Set the Resolution to 500CPI
}
void loop()
{
//read the Motion register to evaluate if MOT is set
I2c.write(deviceID, 0x02); //send Register 2 address which is what we’d like to read I think
I2c.read(deviceID, 1);
result = I2c.receive(); //read the byte from the motion register
//check if MOT bit is set
//this works by shifting the bits over 7 spaces and checking if the result is 1 or 0
if ((result & (1 << 7)))
{
//Debug to see if MOT bit test is working
//Serial.println("The Motion Bit is set.");
MOT = true;
} else MOT = false;
//check if OVF bit is set
//this works by shifting the bits over 4 spaces and checking if the result is 1 or 0
if ((result & (1 < 127) deltaXI = deltaX – 255; //working 256
else deltaXI = deltaX; //try 255 to get more sensitiveity?
if (deltaY > 127) deltaYI = deltaY – 255;
else deltaYI = deltaY;
Serial.print(“delataX, DeltaY: “);
//Serial.print(deltaX, BIN);
Serial.print(deltaXI, DEC);
Serial.print(“,”);
//Serial.println(deltaY, BIN);
Serial.println(deltaYI, DEC);
} //end if
delay(50); //delay for a moment to reduce the amount of readings
}
Hey, I am also working on a similar project and having problem with the code, do you have the working code?
Can’t someone out there just make me one? http://treasurehuntadventures.com/contact/
Thoughtful article . I loved the analysis , Does someone know if my assistant might be able to find a template Family Group Sheet example to type on ?
Greetings jeremygripe , my colleague got ahold of a template CBP I-94 copy at this place
http://goo.gl/kw3LrN
ConfigureACCEPT
Privacy Overview
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.