Remote operated magnetic lock: any interest?

Ideas and instructions how you can make your own bondage toys.
User avatar
aeon
**
Posts: 150
Joined: 21 Mar 2015, 08:55
Location: Europe

Remote operated magnetic lock: any interest?

Post by aeon »

Hi,

I'm about to add some stuff to my magnetic lock to allow it to be controlled by a computer. That'd be very useful in combination with e.g. qwerty212's excellent software. I also intend to provide a means to reliably control the lock over the internet.

Would there be much interest in something like this? If so, I might think a bit more about the design and ease of use/installation than if it's just for myself :whip:

J
* click *
User avatar
johnsub
*
Posts: 14
Joined: 16 Dec 2012, 07:27

Re: Remote operated magnetic lock: any interest?

Post by johnsub »

Sounds great, keep us informed.
User avatar
aeon
**
Posts: 150
Joined: 21 Mar 2015, 08:55
Location: Europe

Re: Remote operated magnetic lock: any interest?

Post by aeon »

johnsub wrote:Sounds great, keep us informed.
Thx, I will.

The basics are working already, but I'd like to make it more user friendly. I hope to be able to do some testing with a very select little group of testers soon :)
* click *
User avatar
Riddle
****
Posts: 1136
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: Remote operated magnetic lock: any interest?

Post by Riddle »

I am also curious about the magnetic lock with the computer control. Internet control is not currently one of my interests, but I always enjoy reading how others manage it.
Resident timer maker. :hi:
Let’s make timers together!
User avatar
aeon
**
Posts: 150
Joined: 21 Mar 2015, 08:55
Location: Europe

Re: Remote operated magnetic lock: any interest?

Post by aeon »

Here's a quick overview for those who are interested:

Hardware is simple: Raspberry Pi with a relay shield to control the lock, and an electro magnetic lock with power supply. The lock can be found on eBay or dhgate for around $25 + shipping. Here's an example
I'm using a relatively expensive relay shield, but based on some initial interest in my little project I did some searching and found a board that's plug & play for less than €20. It has 2 relays, which would open up interesting possibilities to allow someone to control something like a vibrator or anything that runs on electricity ;)
The Pi runs a simple web server with a web page where someone can enter a password and click on an "Unlock" button.

So, to make it work you
- plug in the power supply of the lock and attach the metal plate to the locking unit
- give your unlocker the password
- give your unlocker the IP address of your internet connection. If you don't have a fixed address you might want to look into services like dyn.org
- open up a port on your firewall and forward that port to the Pi
- give that port number to your unlocker

When the unlocker decides to unlock your lock, they open the web page, enter the password, and your lock unlocks.

I realize this involves a few technical steps, so I'm considering making things easier by using an external server. That would do away with the firewall and port forwarding stuff, but it's a lot of work & requires that external server.
In other words, don't hold your breath; I might give it a go just because it would be a more elegant solution, but it won't be high on the priority list unless there's a lot of interest.

Currently the difficult bits have been solved and the first version of the software is working. I just need to connect the wiring of the lock to the Pi, and then I can do the first real test :P

If anyone has ideas for additional functionality, please share them!

At the moment I'm thinking of allowing the unlocker to specify a release time instead of having to be online to release the lock.

Another thing on the todo list is to have the lock owner set a maximum lock duration in the software. There's no real necessity for this, as this can easily be forced by connecting the lock through a timer, but programming a timer might go wrong, so having a second way of ensuring that the lock opens after a certain amount of time never hurts.

And most importantly, I want to look into creating a simple release.exe to make it work with the excellent Windows programs already available.
* click *
User avatar
Riddle
****
Posts: 1136
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: Remote operated magnetic lock: any interest?

Post by Riddle »

Wow, that is a simple solution to web control. Can you give us more information on creating the web button and getting it to control the release? Web control in the past has meant that I needed to download and run someone else's program on my computer with Internet permission. Using this method, I may have to buy a Pi and set one up.
Resident timer maker. :hi:
Let’s make timers together!
User avatar
Blacky
****
Posts: 601
Joined: 01 Sep 2011, 15:07
Contact:

Re: Remote operated magnetic lock: any interest?

Post by Blacky »

Riddle wrote:...
Using this method, I may have to buy a Pi and set one up.
That's basically it. Set up a server and let some scripts

a) generate the web-GUI if you intend to have one at all and
b) do some weird stuff with the GPIO-pins.

A LAMPP-based approach should get you far enough without too much mindf*** going on, of course depending on the safety level you feel you need.
I think I'll have to tinker a bit soon. After all there's a PI with left-over capacities at hand.
If the doors of perception were cleansed everything would appear to man as it is, infinite. (W. Blake)
User avatar
Riddle
****
Posts: 1136
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: Remote operated magnetic lock: any interest?

Post by Riddle »

Blacky wrote:
Riddle wrote:...
Using this method, I may have to buy a Pi and set one up.
That's basically it. Set up a server and let some scripts

a) generate the web-GUI if you intend to have one at all and
b) do some weird stuff with the GPIO-pins.

A LAMPP-based approach should get you far enough without too much mindf*** going on, of course depending on the safety level you feel you need.
I think I'll have to tinker a bit soon. After all there's a PI with left-over capacities at hand.
Looks like I need to do some more learning. I actually had a Pi B+ last summer and gave it away without ever powering it up. The only thing I did with it was see if it fit the case. I was more interested in real time embedded applications at the time (Arduino and Atmel attiny controllers). The Pi required me to learn a whole new system from scratch and did not seem worth the effort at the time. The rough translation is that I understand what you are saying, but could only basically do b) at this time.
Resident timer maker. :hi:
Let’s make timers together!
User avatar
aeon
**
Posts: 150
Joined: 21 Mar 2015, 08:55
Location: Europe

Re: Remote operated magnetic lock: any interest?

Post by aeon »

It's not rocket science 8)

The web interface is exceedingly simple. The script to control the relay is even simpler. Tying the two together took some research and experimentation, though.
Securing the connection to the outside world with SSL is pretty straightforward too.

For convenience sake I'll add simple password management to avoid people having to edit the files directly.
Supporting scheduled release is next on the agenda :P
* click *
User avatar
Blacky
****
Posts: 601
Joined: 01 Sep 2011, 15:07
Contact:

Re: Remote operated magnetic lock: any interest?

Post by Blacky »

aeon wrote:...
Supporting scheduled release is next on the agenda :P
That seems to be not too difficult.
Probably the easiest was to get it done is to store the desired release time (rt) in a separate file, use a script to check whether "now" is later than "rt" and release if so.
The script itself can be executed by a simple cronjob.

Not sure if this helps at all. I'm quite sure that there are better ways to do it, though, but this is the easiest I can come up with at the moment.
If the doors of perception were cleansed everything would appear to man as it is, infinite. (W. Blake)
anobody7
*
Posts: 2
Joined: 20 Dec 2014, 02:51

Re: Remote operated magnetic lock: any interest?

Post by anobody7 »

Hey,

I like where you are going with this and am very interested to see where you get.

I just ordered several 300lb hold capacity, 12V/0.5A electromegnetic door locks to play and bind myself with. Also ordered some programmable timers for current playing needs but planning to try one of the programmable fan ports on my spare computers to try to power the locks. Currently my main computer is built for gaming and is running from two separate power supplies using a switch to link two 600W power supplies. I'm planning to do some experimenting to see if if the computer can put out enough to activate the magnets and then see where I can get with remote control after that.

Shoot me an email if you want to team up.

anobody7@hotmail.com
SG
User avatar
aeon
**
Posts: 150
Joined: 21 Mar 2015, 08:55
Location: Europe

Re: Remote operated magnetic lock: any interest?

Post by aeon »

Blacky wrote:...
I'm quite sure that there are better ways to do it, though, but this is the easiest I can come up with at the moment.
I was thinking along the same lines. I'll put the release time in a database though.
* click *
User avatar
Riddle
****
Posts: 1136
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: Remote operated magnetic lock: any interest?

Post by Riddle »

aeon wrote:It's not rocket science 8)

The web interface is exceedingly simple. The script to control the relay is even simpler. Tying the two together took some research and experimentation, though.
I did some reading on LAMPP last night and read about setting up a web page. It was surprising how easy it was! Getting my microcontroller programs written in C to work appeared to be rocket science by comparison. Not that those are that hard, just tedious and delicate to make work right.

What OS are you running on the Pi?


Out of curiosity, since the Pi is basically Linux and this uses a relay board anyway, could I use any basic Linux computer able to control relays instead of a Pi? I already have a net book dedicated to run Linux (currently Mint LXDE).
Resident timer maker. :hi:
Let’s make timers together!
User avatar
Audrey_CD
***
Posts: 224
Joined: 04 Mar 2009, 22:46
Location: United Kingdom

Re: Remote operated magnetic lock: any interest?

Post by Audrey_CD »

I think you need to add a feedback system so you can tell from the web page the status of the locks.
You can do this with a couple of contacts that the lock's iron plate must touch when it is in the locked position. This can also be used to ensure the plate is correctly positioned before the magnets are energised.
User avatar
aeon
**
Posts: 150
Joined: 21 Mar 2015, 08:55
Location: Europe

Re: Remote operated magnetic lock: any interest?

Post by aeon »

Riddle wrote:What OS are you running on the Pi?
Raspbian
Out of curiosity, since the Pi is basically Linux and this uses a relay board anyway, could I use any basic Linux computer able to control relays instead of a Pi?
You could. As long as you use a relay board that can be connected to your computer and for which you have a means of controlling it.
Obviously the relay board for the Pi uses the GPIO connector of the Pi, which isn't present on your average computer.

I have an old Quasar relay board with a serial interface that I was tempted to use on my main server, but went with the Pi as it provides a standalone solution that others could adopt fairly easily.
* click *
Post Reply