Tuesday, July 17, 2007

Cell Phone Controlled Door Latch


Download Video (1.78 MB)

I’ve been reading a lot on how DTMF (Dual Tone Multi Frequency) tones work over the last couple of weeks. I’m sure you’ve noticed that when you press the keys on a standard telephone keypad, an audible ‘beep’ is generated. These beeps are actually the combination of two distinct frequencies. For example, the tone you hear when you press the number ‘9’ on a telephone, is actually a combination of a 1447 Hz and 852 Hz signal. In a telephone exchange, these signals are decoded by a computer which finally connects the dialer to the designated phone line. For example, the tone of 1447 Hz and 852 Hz will be decoded as binary ‘1001’. In this project, I have designed a simple DTMF decoder circuit which allows me to control appliances in my house from any place on Earth using a telephone.

I always wanted to be able to control things such as air-conditioners, lights, etc, remotely…but I never thought about putting the front door of my house under remote control until I saw this “knock to open” door hack on Hackaday. It’s a door that will unlock when the correct knock pattern is performed. After being inspired by the mechanical door opening system in that hack, I decided to do something similar to allow me to open my door with a cell phone! I mean c’mon, door locks with keys are obsolete..everyone uses them..they’re so old fashioned! They’ve been around for over 4,000 years. Yikes! It’s time for a little change.

This project would have been much simpler if I had an electronic door lock…but I didn’t! They’re expensive, so I didn’t want to buy a new electronic door lock. I wanted to open the front door of my house without “seriously” modifying/replacing any door components. I thought about using a servo/stepper motor to twist the door knob on the door, but their control circuitry is slightly complicated if you’re not using a microcontroller. So, I decided to use a simple, 24VDC, “pull solenoid”. They don’t have any complicated control circuitry and you just have to supply the required voltage to make them work. I simply fastened the solenoid to the door knob with a metal wire. When the solenoid is switched on, its linear motion twists the door knob and opens the door. Positioning the solenoid properly was probably the only mechanical challenge in building this door opener because the force applied by a solenoid, is theoretically inversely proportional the square of the length of the air gap. Thus, strongest force is generated when the air gap is smallest.



The second part of this project was to build a DTMF decoder circuit. I used a CM8870PI tone decoder IC for doing this. The circuit I have built is fairly simple, and can be used for controlling up to four devices. If you want to control more than four devices, check out this circuit. I had a Nokia 1100 cell phone lying around with a hands-free accessory which was rarely used. So, I hacked its hands-free accessory and connected it to the circuit (I just cut the wires which went into the earpiece). That’s about it! To control things in the house, you just dial into the base station and the Nokia 1100 auto-answers the phone call. Each function is just a matter of pressing the appropriate number on the phone and the DTMF chip decodes it and sends output to a transistor which controls a relay. To open my door, I just dial the phone, enter the magic code and voila - Alohomora! Watch the video above. :)





Now I’m thinking about building a password protected door by placing a keypad outside my house which will generate DTMF tones. A circuit on the other side of the door will check the numbers entered, and if the password is correct, it will open the door. However, there’s one little snag. Any nasty programmer would just love to use a computer to generate DTMF tones and crack the password using brute force…I would. :)

71 comments:

jeff said...

Maybe for your password protected door you could use a tone dialer like the ones in old redboxes

Chris said...

Just leave your key lock in place and lockout the keypad after a number of failed attempts :)

Ashish Derhgawen said...

Yeah, that's exactly what I was thinking. :)

Emanuel said...

Or have it set on a timer System, so that after 3 failed attempts it will lock you out for X amount of time. That will help against any one thats smart enough to make a brute forcer.

Alan Parekh said...

Well done!

rob said...

think asterisk man

then you don't need a extra cell phone account for this sort of thing and you can have many extensions directed to different devices

very sweet I think I'll be adapting it myself I have a electric door lock already was going to do a key fob for it but this is even better

Anonymous said...

if there is no network for x or y reason,you cant come in!

Ashish Derhgawen said...

If I can't get in for x or y reason..I can always use regular keys, can't I? :)

Nate said...

To be honest, I don't see how this would be commercially viable. Here in the USA garage doors use RF with advanced security. The code in the transponder is synced with the code in the receiver, and if you press the button they move together in excess of 128 bit cyphers. The same thing with really fancy Mercedes.

Perhaps a phone with RF, such as nextel would be easier. Unless your sending 128 bit cyphers through cell phone signal, hackers can pick up the signal and easily figure out your code. Brute force isn't necessarily needed for wireless, scanners do a much better and faster job.

robomaniac said...

If you read Hackaday.com you probably heard of the GM862 Cellular Quad Band Module. That is a serious little awesome gadget! You could control the door and take pictures of inside your house if someone break in! The idea to connect to the hands-free is brillant! I have a electric door opener (114$ cdn) and want to implant the RFID first! Keep up the awesome work Ashish!

Jerome

Adam said...

I agree with Nate, rarity/novelty would be the only secure thing about this device.

Even if your cell signal is encrypted, with the DTMS base, you've still got a crappy key without an obscene amount of numbers. And if you can remember an obscene amount of numbers, where are your keys?

Wasn't "hacking" originated by getting free long distance emulating DTMF tones? Ironic that a "hacker " would use them to secure his home.

Prashant said...

Oye dude get rid of that craptastic header on your blog! :-P

And good project, btw!

rob said...

sorry Nate but most cell phones today are digital and use higher than 128 bit cypher already

so if you had this tied to your home phone it could be prety sweet but waiting for 4 rings or something could suck

thats why I say tying it in with asterisk or something could be very useful

Anonymous said...

Would this work with a landline phone ? For example, could you cut the ends off the phone cord and use it that way?

Ashish Derhgawen said...

Yeah, I was originally using this circuit with a landline phone.

Vinnie said...

Maybe if you upgraded the door to an electronic door opener you would have better luck with the password coded idea you want to run to open your door.

computer-stuff said...

thats all good but a sledge haammer and freeze on would go stright through it.try using a closed used group on the nokia makes it alot harder to crack as it gives the same effect as two pass words.

Anonymous said...

Love this! want to build it but:

The circuit drawing does not look complete. There are parts I can see in the picture (like the 3 blue things and big capacitors). That are not on the drawing??? Can you post a complete circuit?

Andrew said...

Great little project, nice and simple. Personally for me pasying 40c for a phone call everytime i want to open a door would get annoying, but for a remote operated system it is great.

For those in paranoia land who are worried about brute force hacking of the dtmf or sniffing out codes ill leave you to it, personally ill just use a bump key and go through the existing lock!!

Michael said...

Add a duration parameter to each digit of the code (ie, less than 1sec, 1sec-2sec, and greater than 3sec). That should sufficiently stymey any brute-forcer.

Anonymous said...

heyyyyyyyyyyyyy......

listen to me, you dont need nothing to do, so only you need setup the cellphone in the circuit with your cell number, so only recognice your own cell phone and nothin more

Anonymous said...

Great project. The super-minimal circuit is really cool.

The "brute-force" concern is way off-track. In the circuit, one button press triggers one solenoid. He's only pressing, say, "3" to get in, not a long code string. The "code" lies in knowing the specific phone number that goes with the door, and that's probably a reasonably large search space.

To brute force it, you'd have to dial a bunch of cell phone numbers and press 0-9 on each. This would take quite a while if it answers on the 4th ring.

Anyway, most door locks are reasonably easy to open and/or decode in comparison. Googling "bump key" and "master key vulnerability" is fairly eye-opening.

Cool project. And the security vulnerability it opens up is, IMO, second-order to how sweet it is to open up your door by cellphone.

Might have to implement this chez moi. Not telling you my address or cell number, though. :)

Ashish Derhgawen said...

"Anonymous said...

Love this! want to build it but:

The circuit drawing does not look complete. There are parts I can see in the picture (like the 3 blue things and big capacitors). That are not on the drawing??? Can you post a complete circuit?"


The 3 blue things are the relays. There are some parts I haven't shown in the circuit diagram..for example, (1) I'm using a 7805 regulator chip for providing a steady supply of 5 V. (2) There's an LED connected to pin 15 of the 8870 tone decoder chip. (3) The big capacitor is a part of a bridge rectifier circuit which converts AC supply voltage to DC voltage. That's it. :)

Anonymous said...

I agree with the "heyyyyy" anonymous comment - set up the phone to only ring when your own cellphone (or anyone else in the house) rings it and then use a microcontroller or something to detect the ringing (or the power going to the vibration motor - then it's silent) to open the door. That way the phone call is not connected and it's free to open the door and you just need to press one quick-dial button on your phone.
The quibbling about security is nonsense - someone would have to really know about your system to even know where to start cracking it and frankly if anyone really wants to get into the house they will use a crowbar to open the door or break a window.
Great project! Well done!
Benjamin Franzmayr

william said...

Hack a day brought me here but I will be back.Keep up the good work!

seesoe said...

may i ask where u bought your CM8870PI from?????

henry said...

you can send the complete cct diagram to henry_dayo@usa.com

Anonymous said...

Love this! want to build it but:

The circuit drawing does not look complete. There are parts I can see in the picture (like the 3 blue things and big capacitors). That are not on the drawing??? Can you post a complete circuit?"

The 3 blue things are the relays. There are some parts I haven't shown in the circuit diagram..for example, (1) I'm using a 7805 regulator chip for providing a steady supply of 5 V. (2) There's an LED connected to pin 15 of the 8870 tone decoder chip. (3) The big capacitor is a part of a bridge rectifier circuit which converts AC supply voltage to DC voltage. That's it. :)

Yes I'm interested in seeing the circuit for the rectifier circuit and where exactly you connected the relays (and what type of relays are suitable). Is it possible to post a complete schematic with parts list? This will help beginner hobbyists like me because when I google on rectifier circuits I don't get parts lists so don't know what type of diodes are suitable, what capacitor to use so that the bumpy wave (by mirroring the sine of the ac power with the four diodes in bridge you get indeed a bumpy dc power wave, but still need a certain capacitor to straighten it. But which capacitor, what value? what voltage?) .

Anyway I would be really happy with a complete circuit+partlist then I definitely want to build this for my door, will sent you pictures :)

Vitalik said...

Could you please tell what number combination do you use to activate something? I see 4 relays, so you have to press "1" for example to activate it? what are keys for each relay?

Vitalik said...

Could you please tell what number combination do you use to activate something? I see 4 relays, so you have to press "1" for example to activate it? what are keys for each relay?

Anonymous said...

http://www.raphnet.net/electronique/electronique_en.php

Most of your projects look similiar to projects on that site

Anonymous said...

The diagram shows two telephone wires. How did you connect the cellphone to those wires? With the handsfree connector?

Isabel said...

Hi...I loved your work...but could you help, please?...I don't know how to program the cm8870...could you send me your program?...thank you and good job..
e-mail: isabel.hanks@gmail.com

Rohit said...

Wow, Ashish - this work is amazing! Have you tried typing your name in google? This work is really incredible...

Anonymous said...

Hey...I really like this...it's really useful.

Anonymous said...

Hi..nice job.i like ur project.
it's really cool.but i am not getting the exact operation of how u r controlling.
when ur in the DTMF mode,TO TURN the device from normal conversation mode to appliance control mode u have pressed '0' on the key pad,and the number say 1 for controlling the device u have given (or) does it depends on number of rings should occur to ON the device,...
yaar iam little bit confused.
can u please help me out.
Email:madhujo@yahoo.co.in,
kondur.madhu@gmail.com

bylle said...

hello! is it possible to have more than one code? you said there that only one number serves as a code for your door... how can I make a code that consists of three or four numbers?

can you help me please?
here's my email: gigi_lao27@yahoo.com
thank you!
btw, your project is cool! I liked it that's why I wanna integrate it in our project... ASTIG!

oly said...

hey i live in the u.k and want to make this.can u tell me where i can buy the m 8870?

Anonymous said...

i have bought all the part and built your circuit perfectly, can you give me some troubleshooting steps. the chip I have is the de one is the pins the same for it I can;t find a datasheet for it thanks for your help
brandon@rockcastlehosting.com

Anonymous said...

Hy Greatwork,

But you are using a Nokia 1100 phone, and it hasn't the auto answer function. How do you manage to get this phone auto answer?

Thank you.

Ashish Derhgawen said...

Are you sure Nokia 1100 doesn't have an auto answer feature? My Nokia 1100 has auto answer..but I think it only works when it is plugged to a headset.

Anonymous said...

Nice....wonder how many innocent people died because you posted these easy to follow directions for any Islamic Extremist to build a command IED on your site. You are obviously a very intelligent person with either, no common sense or no sense of responsibility.

Ashish Derhgawen said...

Thanks for your comment. Read this post -
http://ashishrd.blogspot.com/2007/11/possibility-of-misuse.html

Wilsito said...

Keep up the Good work man, love the projects on here.

b18c5.org said...

I'm so glad I found/bookmarked this site a few weeks ago! Awesome stuff!

SomeDutchdude said...

Good project. I live in an appartment, with an auto door downstairs. Thinking of wiring the circuit to the button. ;-)
Keep up the work.

-greetings,

some Dutch dude. :-D

B said...

here's another good one: http://www.howtodothings.com/computers-internet/how-to-trace-cell-phone-numbers-free
lots of good ideas!

Anonymous said...

i made a eagle cad drawing so that i can create my own pcb for this circuit.pls have a look and let me know abt the mistakes.
http://img257.imageshack.us/img257/4849/12tc3.jpg

and i have some basic doubts(sorry if they sound dumb) in the circuit.
--A0,A1,A2,A3 are the output.what are the codes required to switch them on.
--relay will switch on,once the respective output is on.will this output stay on(high)? if yes how can i reset it.imean can i switch
on and "off" a device?

pls help me
regards

Ashish Derhgawen said...

The only mistake I found was that in your circuit, diode D1 is backwards.

Yeah..you can switch devices on and off. For this circuit, you can use the numbers 1, 2, 4 and 8.

Cheers :)

Anonymous said...

thanks a lot for ur reply.
i'll make the correction and will post the populated board soon.

so 1,2,4,8 are the switch on codes for A0,A1,A2,A3 outputs respect..
then how can i switch the particular outputs off.shld i use sames codes again to rest their status.

and you said LED is connected at pin15.is it between pin15 and ground or supply.

iam sorry for keep asking such silly doubts,but iam trying to clarify myself and to other dumbs like me
:-)

thanks once again for ur effort.

Anonymous said...

i was wondeing if this could be used as a car security system, say your car gets stolen you dial the number and viola your car engine dies out leaving the thieves stranded in the middle of road.

iam a novice , iwould love to build this circuit for my car, does this require any programing of the chip? thanks

firoz said...

well i think it can be done.
say we will take a nc/no relay and wire the cars ignition kill wire thru the NO contact.so when we activate the relay using 8870 IC(NO becomes NC),it will always be in ignition kill mode.until we reset it back.

i too made a eagle cad design.in this design i placed a 7805 and an LED between pin15 and GND.
**i hope ashish don't mind.
http://img207.imageshack.us/img207/5569/12uy2.jpg

regards

kathy green said...

Can this be done with an iPhone?

Ashish Derhgawen said...

Kathy: Yeah, it could. After all, the iPhone is EVERYTHING! :D Well, as long as it comes with a hands-free cable..and has an auto-answer feature, you should be able to do this project.

Good luck!

john said...

Yeah

This is good for our mobiles



Celllular Phones

Sanmati said...

I want to start an irrigation pump using cellphone using DTMF
I am not getting how to connect cellphone to MT8870 DTMF decoder
plz help.
cutting the earphones isn't working.
email M sanjainsuny@gmail.com

rahul said...

I working with robot control using cellphone using DTMF
I am not getting how to connect cellphone to MT8870 DTMF decoder
plz help.
cutting the earphones isn't working.
can u help me out with ckt iam using the simple ckt given in datasheet of MT8870
please send me ur reply on electromania619@gmail.com

ashish said...

i built this circuit yesterday but when i power the circuit my relay( driven from pin 11) is activated,the relay is not switched off with the code (ie number 1).
where have i gone wrong.

lankythoughts said...

I know it is unlikely, but still I hope those ads from the service providers wont open your door or stop your car :-P

Anonymous said...

hey ashish i want to make this circuit....can u give details abt dis circuit? really i m looking forard 4 ue reply

Anonymous said...

hi......
i want to do this project but i cant understand the working of the circuits so plz can you give the detail information and complete circuit so that i can make this project succesfully

so plz reply me quickly

Anonymous said...

hi Ashish,great work,i am a biggner ,i also want to make this,but in ckt u r using headphone wire but in video there is no wire please send me the complite ckt at
sourabh_soni0711@yahoo.co.in
please

Monty Alexander said...

hi dear, nice blog, you have a good knowlege about mobile phones configuration. you will sure made that password protected door.

Matt said...

Very cool!

Anonymous said...

Hi Ashish,

I tried to setup the circuit. But I couldn't power any of leg. I guess I2m wrong about telephone lines. So that I connected the lines from my pc and sent the signals by a software. Can you give some information how you conect the lines and maybe troubleshooting information? Is there a way to check the circuit by a multimeter?

regards

Nanogear said...

Hello,

I did something very similar with an iphone and a DTMF circuit to control a magnetic lock.

If you want, you can watch a video I uploaded in youtube: http://youtube.com/watch?v=x88I8GQlYDs

Anonymous said...

Hi,

I watched that video before, thanks anyway. Could you send your circuit diagram. Maybe I can over come my ptoblem.

nanogear said...

Hello,

The circuit is the same.

Please tell me what is your problem and I will help you.

Ashish Derhgawen said...

Nanogear: You video is really cool! Great job :D

Nanogear said...

Thank you Ashish Derhgawen, you gave me the idea!!!!

Anonymous said...

dude great device but a had a question... How do you configure the circuit to get the code you want.. i mean if i want 1570 to be the code, how should i configure???