Use android smarthone bluetooth as dooropener

Hi,
just trawling Google with this question does not turn up very much except the suggestion that I use a BLE bluetooth module.

But I have a normal HC-05 lying around and I can connect that easily to the arduino and do the normal things like throwing switches or send text back and forth from my android. So far, so good.

I would like to have the Arduino check for paired smartphones in the vicinity (approx. 5 metres) without taking the smartphone from my pocket. It should be possible, my car does it all the time. The arduino could be activated by pressing a button first, that is not an issue.

(edit)
So I walk up to the door, press a button, the Arduino says 'Hey, I know that smartphone he is carrying" and opens the door.

Suggestions?

Thank you

Paai

So I walk up to the door, press a button, the Android says 'Hey, I know that smartphone he is carrying" and opens the door.

What will the Arduino be doing, while the Android is strutting its stuff?

Sorry, that was a mistake. It should read "The ARDUINO says 'Hey, I know that smartphone he is carrying" and opens the door."...

The bluetooth device can pair with one other device at a time. If there is a fixed list of phones that you want to recognize, then just loop, continuously, trying to pair with each phone in turn. if the pairing happens, open the door, then disconnect.

BLE operates quite differently, where the phone advertises its name/capabilities, and the Arduino can use that information to perform, or not, an action without ever actually connecting.

Thank you, but I cannot find how to make the HC-05 detect the Android. Pairing the Android with the HC-05 is no problem, it asks the pincode of the HC-05 and it works. So my question probably is which commands to send to the HC-05 to make him query the environment and how he reports back.

I experimented with the AT codes, but you have to switch the TX and RX and press the switch on the HC-05 to send and receive AT commands, and even then the HC-05 does not detect the smartphone.

Paai

paai:
but you have to switch the TX and RX and press the switch on the HC-05 to send and receive AT commands,

This is nonsense. You may be able do what you want by having HC-05 sniff for the phone of known address address and open the door when it finds it. I don't suppose it would be necessary to actually make a connection. Check the Martyn Currey websites

You may find that the Arduino is redundant.

I do not understand why my question is 'nonsense'.

And I am familiar with the site of Martyn Currey. That is where I found how to send AT commands, by switching TX and RX and pressing the button. If the Arduino would be redundant, he would not use one.

Sniffing for known phones is indeed what I want to do, and I realize that I don't have to actually make a connection.

If you know how to get the HC-05 'sniffing' for known phones, I really would appreciate if you would share your knowledge with me.

Paai

It wasn't a question, it was a bald statement of non-fact. I suspect the problem is down to your poor use of language, but you don't switch anything, you simply wire the serial connections properly in the first place - once, and just like Martyn tells you.
I was probably wrong in saying the connection was not necessary, the exercise depends on a successful connection, but it probably not necessary to actually communicate. The auto-connect code and procedure on Martyn's site should suffice, whereby Arduino interprets the state of Bluetooth and opens the door. You may find Arduino is redundant but, if you want several users, Arduino would be used to constantly reconfigure Bluetooth to poll for incoming slaves. You may also find, as I think was suggested, that a BLE is more suited for this sort of thing.

Please explain me this: if I wire TX and RX one way, the HC-05 does NOT accept AT codes, but it WILL pair with the smartphone and recieve and send messages. If I wire TX and RX the other way, I can send AT codes, but the HC-05 will NOT communicate with the smartphone.

Now I don't claim to understand what exactly is happening here, but that is why I ask help.

Paai

paai:
Now I don't claim to understand what exactly is happening here

Nor do I, but I suspect you are kidding yourself. You might consider the nomenclature: Tx=transmitter, Rx = receiver, that is what they do, so you might then ponder the usefulness of connecting a receiver to a receiver.
Currey is very clear about the wiring, and neither he, myself, or anybody else I know do it any other way than Tx>Rx Rx>Tx, irrespective of bluetooth being in communications or AT mode. Note that with some versions of HC-05 there are degrees of AT mode that, other than that I understand it is a bug, I don't know anything about, but I am not aware, and would not expect, that that has anything to do with the wiring. Note also that the Rx/Tx wiring has nothing to do with communications with the phone, except that, if you insist on doing it wrong, you won't get any. Note finally that successful pairing and invitation to connect at the phone end is merely a precursor to communication with Arduino, not a guarantee.