Programmimg help for hc 05 arduino uno relay

Dear Sir,
I trying to create a project in Arduino Uno which interfacing with HC-05 and a relay. when I will pair the hc05 module with an android device and get connect with each other it will turn on the relay. when an android phone goes far distance or gets disconnected it will turn off the relay automatically.
The problem is, I am able to control the relay by sending a signal/ character by Bluetooth command line from android, but I need pair and auto turn on relay and turn off auto when disconnected/unpair.
Can not find any clue to do this code. Please help.

Thanks

Does this blog post help at all?

http://www.martyncurrey.com/hc-05-fs-040-state-pin/

It appears that the HC-05 state pin (pin 6) indicates connection state.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.