Help with Bluetooth and Smartphone

Hi everyone

Here's the deal. I need to connect my Bluetooth slave module (HC-06) automatically with my smartphone when I approach the distance to the BT Module. This is at least what I need. Something more complex is for a led to turn on when I approach the distance to the BT module and my smartphone connects me to it. I have tried to find a code but I can't find anything. Have you guys made something like this? Is for a school project and I don't have so much knowledge on coding.

raincoat:
Hi everyone

Here's the deal. I need to connect my Bluetooth slave module (HC-06) automatically with my smartphone when I approach the distance to the BT Module. This is at least what I need. Something more complex is for a led to turn on when I approach the distance to the BT module and my smartphone connects me to it. I have tried to find a code but I can't find anything. Have you guys made something like this? Is for a school project and I don't have so much knowledge on coding.

Interesting. Not sure if I've ever heard of automatic BT connections, but I'm sure it's possible.

Here's the wrinkle in the sheets: nearly every part of your problem with BT auto-connection is on the part of your smartphone app (that app, I assume, coded by yourself?). Doesn't have much to do with the Arduino.

Things you need to figure out to code the project:
1.) Find out what address your HC-06 has (using AT commands)
2.) Pair your HC-06 and your smartphone
3.) Figure out how to get your smartphone app to constantly look for available BT devices, see if any of the device addresses match your HC-06 address, and connect to it if the HC-06 has been found

What you will need to do during operation:
1.) Always have your HC-06 powered on
2.) Always have your smartphone app on
3.) Always have BT activated on your smartphone

Is this for Android or Apple? Any questions?

raincoat:
I have tried to find a code but I can't find anything.

I don't think that is surprising. For starters, I submit this is a smartphone coding problem, so look there first. Once you have sorted that out, your task at the Arduino end should be quite straightforward.