Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Linear Actuator for Door Lock Demo

Wed Feb 19, 2014 2:48 pm

Hi,

A part of my project involves unlocking a door upon a receiving a certain command. The project is part of my undergrad curriculum. One of the ways to demo a door lock is to use a linear actuator. I worked on a linear actuator project last year and it turned out to be an arduous task; built a linear actuator using a stepper motor.

What is the easiest and best possible way to build a linear actuator using a DC motor? How do I attach a bolt and nut onto the shaft of the motor?

Any new ideas for a door lock demo or linear actuator are also welcome.

Thank You
Rishabh

CAP_Cadet
Posts: 9
Joined: Sat Jan 04, 2014 6:09 pm
Location: Akron, OH, USA

Re: Linear Actuator for Door Lock Demo

Wed Feb 19, 2014 6:14 pm

This might be a little more than what you're looking for, but MAKE has:
http://makezine.com/projects/make-34/th ... -actuator/

You could also use some sort of screw drive, with an interface to a drill motor, but that would cost more.
Hope this helps!
Joseph Anand

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Wed Feb 19, 2014 7:06 pm

I am sorry but I don't think I will be able get all the required tools.

Paul Moir
Posts: 46
Joined: Wed Dec 04, 2013 7:25 pm
Location: Nova Scotia, Canada

Re: Linear Actuator for Door Lock Demo

Thu Feb 20, 2014 8:15 pm

Possibly the easiest way would be to just get a cheap servo motor from a hobby store or ripped out of a cheap RC toy car and attach it with an arm (ie, a bent bit of clothes hanger) to a normal manual door bolt. You really don't need a linear actuator since you only need two positions.

As for attaching a bolt to a motor (like a jack screw) you would need to drill the bolt precisely on centre for it to work well. This is easily done on a metal lathe, or conceivably with a drill press. To lock it to the shaft, you could use a press fit (hole drilled *slightly* smaller than the or if you ended up loose try some locktite. Your chances for success would be better with a brass bolt. But that said, you'll need a decent size motor to directly drive a screw, since motors produce their power with high RPMs, which is why gearing is normally used even with a fairly fine thread on your bolt.

If you only need to open the lock for a short time, then just use a big honking spring return solenoid like they do in apartment building doors, etc. Look in a doorbell for inspiration. The thing with them is they don't like to be left powered for very long because it wastes power and heats.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Linear Actuator for Door Lock Demo

Fri Feb 21, 2014 11:42 am

Hi

Why not an electric strike? They are designed for the job. electric strike gets over 50 million matches on google.

It will only release the door latch, not actually open the door.

Linear actuators for a door/gate that swings thru 90 degrees is difficult geometry.

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Linear Actuator for Door Lock Demo

Fri Feb 21, 2014 12:07 pm

One idea might be to go for a cheap solenoid. They don't push/pull very far, but if you can find a used one somewhere it might do as a cheap demo of the principle. It will require the power to be held on to keep the solenoid actuated & pulled in (door unlocked) though.

And another idea is to use a cheap geared motor of some sort, and a cam. The motor turns a plywood disc that is cam shaped. The long end of the cam rotates into a slot on the door edge, locking it. Requires quite a lot of woodworking to make a neat cavity to hide the machanism though. Also needs two switches to detect each end of travel, so the computer stops the motor when a switch is pressed.

Both of the above will not run directly from the raspi - they both need a motor driver of some sort, but so will any mechanical device run off the raspi. The one using the motor will need a reversible driver like an H-bridge perhaps, to turn the cam one eay to lock, the other to unlock.

All depends on how short you are for budget, and how much electronics you can build yourself.

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Sat Feb 22, 2014 10:52 am

I have found a solution though not the best one.

Now another thing that I would like to know is how do I run a 12 V dc motor using L293D and pi's gpio pins. How can I ensure that nothing happens to my pi :!: :?:

Paul Moir
Posts: 46
Joined: Wed Dec 04, 2013 7:25 pm
Location: Nova Scotia, Canada

Re: Linear Actuator for Door Lock Demo

Mon Feb 24, 2014 7:55 am

Best bet is to optocouple it. That way no matter how bad you screw up the 12v side you're pi will never see it.

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Wed Mar 12, 2014 6:44 pm

Can anyone tell me where I can get a 5v solenoid actuator at an affordable rate in India?
I found online but the site doesn't say available.

http://shop.sumeetinstruments.com/index ... uct_id=556

User avatar
jbeale
Posts: 3481
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Linear Actuator for Door Lock Demo

Wed Mar 12, 2014 7:32 pm

For what it's worth, in the US you can get a surplus 12V car door lock actuator for about $6 here: http://www.allelectronics.com/make-a-st ... tor/1.html
Probably you could get a used one from a junkyard, from a car with automatic door locks.

To drive this from the Pi you would need to use a power transistor or FET, possibly in turn driving a relay. An optoisolated FET (AKA solid-state DC relay) or traditional mechanical relay would allow you to have your 12V system completely separate from your R-Pi to avoid any inductive switching voltage spikes causing trouble on the Pi.

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Sat Mar 15, 2014 11:57 am

The arrangement that I made is here:
Linear Actuator 4.JPG
Motor
Linear Actuator 4.JPG (36.23 KiB) Viewed 10370 times

How do I get a linear motion using this?

I have to fix both ends. The nut will move linearly in that case. I want a little more clear and observable motion. Just the nut moving isn't good enough for me.

User avatar
Douglas6
Posts: 4742
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Linear Actuator for Door Lock Demo

Sat Mar 15, 2014 2:33 pm

[Edit: Nevermind. That's a motor; I thought it was a solenoid. ]
Sounds like a mechanical linkage problem. Perhaps a popsicle stick flagpole with a flag on one end, connected with a bit of wire to the nut on the other end, and pivoted somewhere close to the nut? Of course the flag motion will be circular, but more observable for demo puposes. If it must be linear, perhaps three popsicle sticks with your threaded rod in a pantograph arrangment.
Last edited by Douglas6 on Sat Mar 15, 2014 6:53 pm, edited 1 time in total.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Linear Actuator for Door Lock Demo

Sat Mar 15, 2014 6:36 pm

Rishabhg wrote:The arrangement that I made is here:
The attachment Linear Actuator 4.JPG is no longer available

How do I get a linear motion using this?

I have to fix both ends. The nut will move linearly in that case. I want a little more clear and observable motion. Just the nut moving isn't good enough for me.
Hi

Mount the motor.

The output shaft will need support at it's end, bearing or similar.

When the shaft turns the nut will want to be in a slideway. You need to attach a something to the nut to stop it rotating.
nutrunner.PNG
nutrunner.PNG (12.28 KiB) Viewed 10291 times
Now just holding the flange will give linear motion on a well oiled thread. And if it is in a wooden slideway should give the desired effect.

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Sun Mar 16, 2014 9:47 am

Yes I know that but I don't want just the linear motion of the nut alone. I want some type of motion in which a cylindrical pipe kind of thing also moves, like the latch of a door.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Linear Actuator for Door Lock Demo

Sun Mar 16, 2014 10:33 am

Rishabhg wrote:Yes I know that but I don't want just the linear motion of the nut alone. I want some type of motion in which a cylindrical pipe kind of thing also moves, like the latch of a door.
Hi

Well if you want to unlock a door, buy a cheap and large door lock.

Put a small motor and cam in place of the key. Turn the motor CW, cam moves door locks.

CCW door unlocks.

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Fri Mar 21, 2014 6:10 am

I got a solenoid actuator ROB-11015.

I have written a script in Python to run the actuator. Here is the code:

Code: Select all

import RPi.GPIO as gpio
import time

gpio.setmode(gpio.BCM)

gpio.setup(18,gpio.OUT)
gpio.setup(23,gpio.OUT)

gpio.output(18, True)
gpio.output(23, False)
time.sleep(0.02)

gpio.cleanup()
I have used the same circuit as that of the DC Motor using a L293D IC. Here is the circuit : https://raw.github.com/rakeshpai/pi-mot ... tch_bb.png

The problem is its motion is different from that I expected. On making pin 18 high the solenoid should push out and stay in that position but it keeps alternating the push/pull motion for the time assigned(0.02 seconds in this case).

Does a solenoid actuator work the way I expect to or what I am observing is its actual working?

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Linear Actuator for Door Lock Demo

Fri Mar 21, 2014 1:33 pm

The problem is its motion is different from that I expected. On making pin 18 high the solenoid should push out and stay in that position but it keeps alternating the push/pull motion for the time assigned(0.02 seconds in this case).

Does a solenoid actuator work the way I expect to or what I am observing is its actual working?
I haven't worked with them myself, but I'm pretty sure that when you apply power, you'll get your push motion, and then when you remove power it will return to its normal position. This is why "normal" should be locked and "powered" should be unlocked. That way you're not continually applying power to the solenoid.

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Fri Mar 21, 2014 1:36 pm

If that the case when I set the time to sleep as 1s it shouldn't have changed but it kept on doing the lock/unlock for 1 second.

Which part of the script do you think needs change?

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Linear Actuator for Door Lock Demo

Fri Mar 21, 2014 1:56 pm

Rishabhg wrote:If that the case when I set the time to sleep as 1s it shouldn't have changed but it kept on doing the lock/unlock for 1 second.

Which part of the script do you think needs change?

Code: Select all

gpio.output(18, True)
gpio.output(23, False)
time.sleep(0.02)

gpio.cleanup()
If it's doing what I think it is, you're actuating the solenoid for 0.02 seconds, and then it's retracting. If you want it to actuate for longer, you can either increase your sleep, or if you don't want it to retract at all, remove the cleanup so that the solenoid stays activated.
If that's not right, can you post a link to the datasheet for your solenoid?


User avatar
jbeale
Posts: 3481
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Linear Actuator for Door Lock Demo

Fri Mar 21, 2014 4:02 pm

Just FWIW, some solenoids are not designed for continuous current and will overheat if you leave them driven all the time.

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Linear Actuator for Door Lock Demo

Fri Mar 21, 2014 4:11 pm

jbeale wrote:Just FWIW, some solenoids are not designed for continuous current and will overheat if you leave them driven all the time.
The datasheet shows (if I'm reading it right) that for 100% duty cycle it has an infinite maximum activation time. With reduced duty cycle, lower maximum activation times are permissible.

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Linear Actuator for Door Lock Demo

Sat Mar 22, 2014 5:06 am

Still looks like when you energize it, it should change to "push mode" or "pull mode" depending on the type of solenoid. So... what is yours doing, exactly? What happens when you turn it on for, say, 5 seconds, and then back off? And if it's not what you expect, what exactly do you expect to happen?

Rishabhg
Posts: 24
Joined: Thu Jan 30, 2014 9:41 am

Re: Linear Actuator for Door Lock Demo

Sat Mar 22, 2014 7:35 am

I made some changes in the script. Now it is in staying in the "push mode" and "pull mode" but still sometimes the script works,sometimes it doesn't.

Here are the two scripts:

Code: Select all

import RPi.GPIO as gpio
import time

gpio.setmode(gpio.BCM)

def openDoor():
    gpio.setup(18,gpio.OUT)
    gpio.setup(23,gpio.OUT)

    gpio.output(18, True)
    gpio.output(23, False)
    time.sleep(1)

    gpio.cleanup()


openDoor()

Code: Select all

import RPi.GPIO as gpio
import time

gpio.setmode(gpio.BCM)

def closeDoor():
    gpio.setup(18,gpio.OUT)
    gpio.setup(23,gpio.OUT)

    gpio.output(18, False)
    gpio.output(23, True)

    gpio.cleanup()

closeDoor()
I expect the code to two work exactly each time I run it. It is still showing some strange behavior like the same script working once and not working later on.

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Linear Actuator for Door Lock Demo

Sat Mar 22, 2014 9:09 pm

It is still showing some strange behavior like the same script working once and not working later on.
That's very odd indeed. It makes me think there might be a hardware issue, or something else that's going on here. What are you doing between it working and it not working? Maybe you can come up with a test procedure that will point out the problem, such as:

Code: Select all

Open
Close
Open
Close
Close
Close
Open
Open
Open
Close
If a consistent procedure works one time and not the next, something else is clearly going on. If it works every time and yet when you do something else it still doesn't act as you expect, maybe there's another factor that you haven't considered, such as another program interfering in some way.
I noticed that with the Close procedure you have no sleep. Maybe you're not always leaving the pin high for long enough for the actuator to actuate. It's probably worth putting a sleep in there too.
Also, how does the actuator respond to the cleanup() procedure? Perhaps by resetting your GPIOs, it's going into idle mode, and doing something that you aren't expecting.

Return to “Automation, sensing and robotics”