HC-06 module error

Hello there
I am using arduino mega to make a project to switch on/off 22 lights, I have faced a problem in the bluetooth module.
some outputs will be energize randomly or accidentally while disconnecting the smartphone from the bluetooth module, I have made the smartphone app using MIT app Inventor, the program is running perfectly while the device is connecting to the module.

you can directly contact me on (REMOVED)

kind regards and looking forward to hear you soon

Your topic was Moved to it's current location / section as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

You are probably blaming the wrong thing. It sounds like inadequate power at Arduino.

Hello dear, thanks for your kind response.
please may I get more information regarding this issue, the Arduino module, bluetooth chip HC-06 and all relays are fed by one 5V DC power supply 40Amp.

So you are powering the Arduino via its "5V" pin then?