Dear Amjad,
The only two things I can imagine realistically is this:
- You should use a smart phone with accelerometer in it. Here is why: the phones do not have much peripheral options. There is nothing much you can attach to it except… well, let's discuss it in next item.
You need to have the door which is flexible enough and shakes when someone hits the door strongly enough (a weak knock just don't count). The smart phone should be attached to the door, somewhere by its center (the center, not the place where people typically knock).
You need to develop an application which monitors the acceleration as frequently as possible. You need to do a little research to elaborate the criteria of what level of accelerations should be recognized as a knock on the door.
When the criteria for accelerations are met, make you program sending your a message or calling you. - Attach a microphone to the door and connect it to the smart phone. Tape the microphone pretty well firmly to the door; make sure the tape does not come off on a strong knock. Better don't use "scotch" or duct tape, use more expensive "gaffer tape" used in arts and with photographic equipment, available in art stores (see http://en.wikipedia.org/wiki/Gaffer_tape[^]).
Develop an application which can monitor the level of acoustic noise all the time. Again, do a little research to elaborate criteria use to consider certain acoustic characteristics as a knock on door. Try to make is as simple but dependable as possible.
When the criteria for the knock-like noise are met, make you program sending your a message or calling you. - One important detail — if you forget it, nothing will work. You should remove button of the electric ring. If you forget about it, most people will try to ring and may never try to knock on the door. :-)
That's it. Get to work now, do your research and implementation.
Good luck,
—SA