Hc05 dissconnects when phone locks

Thread Starter

utilityhacker

Joined May 1, 2014
48
So i'm doing this home automation project Using mobile phone and decided to use a bluetooth module hc05 for wireless communication along with an arduino. For prototyping i made a simple circuit on breadboard to toggle an led on or off. The connections were pretty simple HC05>>> vcc to 5v, gnd to arduino gnd, rx to arduino tx(pin1), tx to arduino rx(pin0). I used a bluetooth terminal app on my andriod phone to toggle the led on and off and it worked. The problem is when ever i lock my screen the Hc05 disconnects and i have to reconnect it every single time. this is no good and happens with all of the bluetooth terminal apps i tried. i could really use some help with this.
 

spinnaker

Joined Oct 29, 2009
7,830
Have you tried other bluetooth devices with your phone to see if it has the same issue?


I think you are going to have to modify the app on your Android to automatically reconnect to the HC05 when it comes out of sleep.
 

Thread Starter

utilityhacker

Joined May 1, 2014
48
Have you tried other bluetooth devices with your phone to see if it has the same issue?
I tried sending files to other phones and it worked fine. Also i connected another phones with the module and it behaves the same way (disconnects).
I'm using an app from the android store and im not good at android programming.
Maybe some at commands or firmare might do the job?
 

spinnaker

Joined Oct 29, 2009
7,830
Well it is a free app so you get what you get. I have only dabbled in Android programming. If I had to guess, I would say there is an event generated when Android wakes up from sleep. You texting app probably makes use of this event to reconnect to the last device that was connected.
 

Thread Starter

utilityhacker

Joined May 1, 2014
48
While I was trying to make it work, I found that untill I kill the task of the bluetooth app , it actually stayed connected even when the phone was locked. So yeah promblem is solved. All i had to do was minimize the app rather than killing it(app closes when back button pressed).
Thankyou for your help! :)
 
Top