Time lock box?


I've seen the movie city of ember and there you have a box that locks itself from the inside, only to open again once the preset time has expired. I'd love to make one for a friend of mine (and for me as well), who's always distracted during the examination, so he could lock his distractions away for the time needed.

I browsed hours to find timers and count down circuits. the best things that I could find, never were longer than e few hours or a day. but for this project it should at least last a month.
I got a weird Idea of hooking up egg timers in series, so if the first one ends, the next one starts, until your last one finished that opens the box (the more I think about it, the more it's sounding impossible to do)
the next best thing that would simplify the build was an arduino, but since these are essentially tiny computers I think it would be a wast to just let them count down. (and doesn't a arduino consume a lot of power too?) and I would like to only use an arduino as last resort... you can make robots out of these little board, it would be too tempting to pull it out of my project and try to make something cool with it.

would any of these idea's work descent?
does anyone know what could be the best way to pull this off?


sort by: active | newest | oldest
rickharris5 years ago
Far easier to investigate microprocessors that can count up to years if needs be.

Not an easy project i will add.
Jakwiebus (author)  rickharris5 years ago
just what I thought, but then the quickest and easiest way to to this would be arduino, because, although I'm fund of electronics, when it's about microprocessors I don't know where to start
(maybe starting by buying a book about it ;-D)

thanks for the reply
No need to buy, go to Picaxe.com and read through their free PDF manuals - the general principles apply and if you like the product then the commands manuals tells you all you need to know.
Jakwiebus (author)  rickharris5 years ago
at least they make it sound easy :-)
worth checking it out.
I think there is a trip to the nearest electronics store in my future, see what they have to offer
It is easy(ish) I used 100's to teach kids to program
Jakwiebus (author)  rickharris5 years ago
so which starter kit do you suggest?
dpomerleau1 year ago

It sounds like what your friend wants is the Kitchen Safe:


rickharris5 years ago
I suggest you use a motor to drive the mechanical latch as this is far easier and cheaper then fancy solenoids.

The smallest Picaxe will do what you want although if you need to drive a motor you either need to go for a transistor driver (one direction only) or an H bridge L239 driver and a small motor. If you can go the transistor circuit then the AXE003U kit will give you everything you need.

If you go the L239 route then the AXE023 will do it for you BUT you will need to buy the down load cable and download the programming software (free) from their site.

The connection details etc are in their manuals the software is easy something like:


W0=0 ; set the work variable to zero - can count to 65535


wait 60 ; this causes the microprocessor to do nothing for 60 seconds

W0=W0+1 ; increments variable W0 by 1

If W0=60 then goto unlock ; if 1 hour has passed unlock the box.

Goto Count_1_min:


High 1 ; turns on output 1 assumes motor is connected to it.
wait 10  ; waits 10 seconds for unlock to be completed
low 1 ; turns motor off
end ; ends program

Everything underlined is just a comment.

Naturally there is a lot you can do extra to this, make the time setting adjustable by the user, provide an emergency over ride. Add a limit switch so the micro know of the box is locked or unlocked.

Remember that the micro needs battery power all the time, you can reduce the power used considerably - see the manual sleep command BUT this effects timing.

Over a long time this isn't going to be spot on accurate. You need a real time clock for that - Picaxe do one if necessary.

Jakwiebus (author)  rickharris5 years ago
the programming sounds a lot like lego mindstorms NXT programing.
motors and switches I have out of lots and lots of dead appliances.
I'll go try and find a picaxe Project Board.

thanks for your time and effort.
I'll keep all of you up to date when it's finished.
ntewinkel5 years ago
I think Arduino is the easiest way :)

If you start with something like this countdown timer: https://www.instructables.com/id/Crazy-Countdown-Timer/

But instead of a basic clock display, use a 1602 LCD display (I think you can get them for about $3 on eBay). The LCD allows you to give more information. With the clock display it would be hard to indicate what is being displayed.

Then change the code to include years, months, and days.
And on the LCD display you can print out how much time is left.

Then for the action, have it run a motor or something to unlock the box.

Jakwiebus (author)  ntewinkel5 years ago
it's either that or buying a timer and hope it's smart enough to count beyond 7
I've seen digital programmable timers in hardware stores that let you set up different scheduled activations. I don't know if it would give you a month plus of delay, but it might be worth checking out. The timers I saw were for 120VAC appliances, so that might be a limitation if you need this thing to be portable.
Jakwiebus (author)  LargeMouthBass5 years ago
was also my thought cause when you have to not be distracted by something, it doesn't have to be portable
but if the power is down and the timers would freak out, your box might never open again, but maybe they indeed must have low voltage cousins of them somewhere.

and just popped to mind: the timer circuit inside these things... won't they run on low volts? every electronic solution involves a microchip of some sort ... they don't have them working on 120 VAC (or in Belgium 230VAC)
or do they?

thanks for the reply
The ones I saw also needed a single AA battery, so they might be ok. It wasn't clear whether the battery was just backup for a power outage of it that is what the unit was powered from all the time.

If the unit normally gets its power from the AC lines, then there will also some kind of circuit inside to step down the AC and convert to whatever is needed for the microprocessor.

It would be wise to have some kind of backup way to enter the box, in case the electronics failed and you were locked out.
Jakwiebus (author)  Jakwiebus5 years ago
it's also not really the instructable mentality to buy thing off a shelf and use them for what they were meet to do... but yeah, I've found some for a reasonable price, but they're quite vague (they never talk about times longer than weeks)
The key to using an "arduino", is not to use an arduino....

Use the same processor, but make a board that runs on the 3V minimum supply voltage. Also program the clock source to be the RC based one - its not deadly accurate, but it will do. Set the clock rate to the minimum possible - I don'tremember what it is.

Next: look for sketch designs that use the onboard timer to put the chip to sleep for extended periods - in your case, you could get away with only waking up every 10 seconds. Writing code that speeds the CPU up when buttons are pressed is also possible.
Use a 32kHz watch crystal, and two 4521 divider chips.

32K = 2^15 counts/sec

A 4521 divides by between 2^18 and 2^24 counts

If we assume a month is 2.64 million seconds, or say roughly 2^21, then we need a total division of 21+15= 36 ish,

If we take the 2^18 count out of one 4521 and drive the other 4521 with it, then the output of the second counter's 2^19 pin will flip once every 2^37 counts of the clock.

2^37 x 32768 = 4.14 million seconds, or 48 days.

Should cost you about 10 dollars in bits.

Jakwiebus (author)  steveastrouk5 years ago
but then it isn't programmable, you'll need to change the parts in order to change the time value, or am I understanding this wrong.
thanks for the reply
You can make it programmable, by taking a tap off the divider chain, other than the end.