I'm making a lock with arduino. I plan on using a servo motor. I need the motor to not consume power when the pins that lock the door and the body together are held in place until it opens. This is because it will be a mechanical failsafe in the case that the electronics fail. I've read that a solenoid can do this, but I didn't find any explanations. Some of the suggestions had ways that didn't consume power to hold it in place but still needed it to unlock it. If this is not specific enough an electronics question, than please move it to the appropriate section


I did a quick mockup, I don't have a mouse so cut me some slack. And this is my first design of a motor system ever. I know I can handle the mechanical aspect well enough. I tried to make it pretty straightforward. The failsafe I mention is a function specific failsafe in which if the electronics fail a mechanism slowly pulls the barrier out of the way over a period of time and lets the spring #1 push the bolt back through to the unlocked position. I know I could probably use 2 solenoids, but I would rather use a servo and a solenoid as I can actually lock the bolt in place after so it can't be tampered with. I see now spring #1 in its current position would definitely be in the way of the second hold, I would move the spring to be pulling it from the other side instead

I suspect I will be laughed at for overcomplicated design with no advantages.

  • \$\begingroup\$ I'm trying hard to find anything related to electronics here. You're asking about gear ratios, and the overall question is about failsafe mechanical systems. \$\endgroup\$ – pipe Jul 12 '16 at 4:03
  • \$\begingroup\$ What do motors run on? It's a motor question mostly, if anyone can chime in on the gear ratio question that would be cool too. I have searched for information on using servo motors as locks and I find very little detailed information. I will dig deeper as well. If even the motor question is in the wrong area, then I apologize, and would ask for this to be moved. Thanks. I don't have a servo motor so I can't do any testing and I'm not going to buy one without knowing how it could function as a lock. I don't know exactly how to phrase my questions about the motor \$\endgroup\$ – ahugeC_change Jul 12 '16 at 4:14
  • \$\begingroup\$ I added a more specific question. \$\endgroup\$ – ahugeC_change Jul 12 '16 at 4:22
  • \$\begingroup\$ Please incorporate the comment into the actual question, it's perfectly fine to edit a question with additional details. Comments may be cleared out, and it's not always easy to find info in the comments. \$\endgroup\$ – pipe Jul 12 '16 at 4:24
  • \$\begingroup\$ Good! It's still unclear to me what you actually need, but that might be because I'm not at all interested in motors. I'll leave that up to the other users here. \$\endgroup\$ – pipe Jul 12 '16 at 4:36

What do you mean by 'failsafe'?

Do you want fail open, so if there's a fire that damages the electronics, people can still get out alive?

Do you want fail closed, so that if prospective burglars crash the electronics with a spark lighter, they still can't get in?

You can have both if you opt for a 'nightlatch', which can always be opened from the inside, and have the unlock from the outside fail closed. But then that always opens from the inside.

You cannot have all three, personal safety from inside, and access barring from both sides in the event of a failure.

If you use a motor and gearbox to move a deadbolt, then any high ratio gearbox will be difficult to push back. A worm gear is impossible to push back if the efficiency is <50%, and you have to work really hard to get worm efficiency higher than that.

Going to a nightlatch release, there are two types of lock. Blocking, and transfer. You can make either work with a solenoid, which is locked in the power-off condition. As it doesn't have to actually move the bolt, it could be quite low power so suitable for battery use.

A blocking mechanism is the easiest to make work, but it's also the least secure. Something that can be withdrawn by the solenoid gets in the way of the link from handle to bolt. This has the disadvantage that if someone uses enough force on the outside handle (and they will feel the block preventing movement) eventually something will break. If the block breaks, they have access. If something else breaks, you still have a busted lock. Early Mini's could be opened by slipping a 12" piece of steel tube over the door lever, and leaning on it.

A transfer mechanism is better. The handle moves freely but impotently when locked, with no link to the bolt. On unlock, the solenoid inserts the final link into the movement chain. This is far better. You can concentrate all the vandal-surviving strength in the simple handle, and as the bad guy can feel it move freely, he is not tempted to apply force.

That's all locks and mechanics. How about the electronics? It needs to check battery state, and bleat if it's low. How do you stop it being crashed by a spark lighter? Watchdogs to bleat and reset, and 'crash-guards', jumps to a 'help I'm being hacked' rescue function, installed throughout your interrupt vector table, and in all unused portions of your code. And no monolithic code, insert jumps over your crash-guards. This raises the likelyhood that if the program counter gets corrupted, you will soon execute a jump to its rescue code. And as MCUs are pretty cheap, triple redundancy?

  • \$\begingroup\$ Well it's not really to protect against any thieves. Just maybe snoopy family. Aka the person won't be trying thaaat hard. if there's a way that won't break it but grants access, that will be used. Otherwise, no real force would be applied. The only thing I can think of is a magnet. But would that mess with the electronics? It will be battery powered or directly from the wall, depending on if it's plugged in. I was considering redundancy, but then I would be left depending on all the components still when I would prefer potential energy alone to be the backup \$\endgroup\$ – ahugeC_change Jul 12 '16 at 7:00
  • \$\begingroup\$ I should have maybe added, it's mostly a hobby project with functionality \$\endgroup\$ – ahugeC_change Jul 12 '16 at 7:02
  • \$\begingroup\$ No, I'm afraid your 'clarifications' are too confusing. Write a functional specification, for what you want it to do under this, that and the other circumstance. \$\endgroup\$ – Neil_UK Jul 12 '16 at 7:07

I think you may be using the wrong mechanism for the lock. Maglocks (magnetic locks) are widely used for this type of application in building security. They come in two modes: release when power off (suitable for most applications) and require power to release (prisons, etc.).

enter image description here

Figure 1. Maglock with magnetic poles exposed and keeper.

I don't know this for sure, but I suspect that the three poles are arranged as south-north-south (or vice-versa) and that the coil is wound, pushed into the black slots and potted in position. Once the (electro) magnet hits the keeper the magnetic circuit is closed. As anyone who has played with a horseshoe magnet will know, opening the closed loop is very difficult. Interfering with this closed circuit from outside would be very difficult due to the relatively low permeability of the air relative to the iron. Iron is about 5,000 times more permeable than air.

enter image description here

Figure 2. Cross-sectional view.

Here we can see that with the lock open the exposed faces are poles of the electro-magnet. Note also that the magnetic path is twice as wide in the centre pole as on the upper and lower poles so that flux density is fairly constant. Once the lock closes the flux forms a loop through the iron core.

Some of the suggestions had ways that didn't consume power to hold it in place but still needed it to unlock it.

The "normally locked" version requires power to unlock. The coils are typically 12 or 24 V so that the controller can run with a small lead-acid battery backup. You would need to check the datasheets to learn how much current they consume.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.