HC-05 Bluetooth Module : Password not saved after power cycle

Author: Arvind Kumar

The problem

Lot of us have faced this issue that in case of cheap bluetooth module HC-05 with firmware VERSION:4.0-20190815. For these modules which are cheaply available in the market there is a problem than even after connecting EN pin(pin 34) of HC-05 to enable Full Set of AT Commands the Password doesn’t get saved. When we set passord we get ok response from HC-05 module. However after turning power off and then switching back on we can see that the password did’nt got saved. It still shows default password. When we set other parameters like module name we did not faced such problem.

The Setup
Solution 1

This is a solution which I came across internet. connect up to arduino as illustrated above, using the voltage divider and 3.3V connected to EN
change the password AT+PSWD=4321\r\n you get response +PSWD:4321\r\nOK\r\n
Connect to the bluetooth module using a Windows laptop – connecting to the device using the new password saves it properly
The module doesn’t need to come out of AT mode to do this, just leave EN connected to 3.3V
and now power cycle – the module still has the new password.

Solution 2

This is more better solution. Suppose we want to set HC-05 password to 9639 to do that we will send the following command to HC-05. AT+PSWD=9639\r\n. This will return the following response from HC-05:- +PSWD=9639\r\nOK\r\n. Now Issue another command:- AT+ROLE=0\r\n which should result in the following response:- OK\r\n. Now the password should be saved from RAM to Permanent memory. Now you will get the set password even after Power cycle.

Conclusion:

This is a solution which I came up after a lot of experimenting. This behavior of HC-05 might be specific to this particular VERSION:4.0-20190815 and if your firmware is different then you might not get the same behavior.

Leave a Comment

Shopping Cart