Time to lock.

So the next step … lock the door.

Magnetic locks. We can’t use them because it relies on non-standard additions to the door jam (the magnet or steel plate). It also requires constant power to maintain the lock state.

If you take a look around google for controlling the locking of a door from a computer, the most common solution you will find is driving a bolt with a solenoid. The trouble with this is that EITHER you have to supply power all the time while the door is locked OR all the time while it is unlocked, or the bolt will move to its rest spot. So if we are running on batteries, that isn’t going to work. However, it is easy to do. Jaycar has solenoids for 30-40AUD.

So my next thought was stepper motors, which adds a huge complexity to the project hardware. Controller boards, sensors, programming. Riccardo pointed out that I could use the Arduino board, given that I have one, and have used them before. Nice. So of course, here is an example of an existing project, and here are notes on how to control arduino from python. Thanks Brad and Mark. The trick would be whether I can power on and boot the arduino just when I need to. Actually, it might be that the computer itself only powers up once an hour (or whatever), performs its whole procedure, and then shuts down.

Jaycar has a stepper motor for 20AUD.

With stepper motors we can move the bolt into position, using a cog (or worm drive) and a toothed shaft on the slide bolt. We can also have grades of lock, with a partially extended bolt. I’m just looking for ways to make visible a few greys around the black and white of locked / unlocked.

An additional advantage of using Arduino is that we can get physical feed back from the door. For example we can use light sensors to detect whether the door is open or ajar, before trying to lock the door. We can also use the same controller (hopefully) to drive an additional stepper that might push the door ajar, or pull it to.

If required, Arduino could control the entire workings of the door by remote using the Xbee Shield and a Zigbee (20USD).

The locking mechanism was intially intended to be seemless and hidden within the door (along with all the other parts) leaving the surface of the door to be like, well, a door. However, it could be that the drive cog could be exposed, or a window in the door could reveal the mechanisms. Although that would most likely only be visible from behind the door.