Hello my friends
I am new to using Arduino and I am doing some experiment.
I wanted connecting two NanoEvery using bluetooth: so first programmed two HC-05 modules and paired them; then I used the master module on the main Arduino and the slave on the receiving one.
This now works for me: the connection is setup in few seconds after power on and data exchange is possible.
However I wanted to be able to connect to the receiving Arduino also from another device. I did this by controlling Vcc on the bt module, via a Nano port + one darlington. This also works, so the main Arduino board connects to the receiving Arduino board and they exchange data; the main Arduino programmatically can power down its bt module, so that the receiving bt module (in some 20 secs) times-out its connection and is available to be connected and controlled by a second controller (at this stage I used a sketch on the Bluetooth Electronics app for Android, and it works for me).
Now the questions:
-is removing power to the bt module in any way dangerous?
-which smarter way could I use to disconnect the bt communication without removing power to the bt module?
-how could I quickly release the receiving module without waiting for the 20 secs (an internal time out, I guess)?
Don't connect, or disconnect, anything to a circuit that is powered.
There are special contacts and circuits that allow for "hot swapping". General circuits face the risk of being permanently damaged.
Railroader:
Don't connect, or disconnect, anything to a circuit that is powered.
There are special contacts and circuits that allow for "hot swapping". General circuits face the risk of being permanently damaged.
Thank you for your message.
So you say that removing Vcc (power) to the HC-05 module is dangerous? How would you suggest to do? Thank you!
Removing the Vcc alone is okey. But don't ever remove GND.
Removing the power to the entire setup, let the circuit consume the last electrons, is the safest.
Know that if You remove Vcc from the HC05 it will draw current from any input having a high logic level. That's called phantom power and often brings undesirable results.
anthony47:
-is removing power to the bt module in any way dangerous?
-which smarter way could I use to disconnect the bt communication without removing power to the bt module?
-how could I quickly release the receiving module without waiting for the 20 secs (an internal time out, I guess)?
I don't think there is any danger, nor is there a smarter way. I understand your approach is actually determined by the "other device". I don't understand the problem with the receiver. I'm certainly not aware of any internal timeout and would reckon that, if the master is switched off, that's the end of the game. I don't see how HC-05 can draw current when its VCC is disconnected. On the opposite tack, very early breakout boards apparently could be caught powering Arduino if it had power and Arduino didn't, but I never heard of anybody having a problem. The JY-MCU board put in a protection diode to counter this, and I guess all its successors do the same.
Thank you Nick_P for your message.
I think that Railroader was talking about the risk that the BT Module get some power from any signal pin at High level; fortunately the Module has only Rx and Tx pins (in addition to Vcc and Gnd), and it is not difficult make sure that Rx pin be kept to Low before removing Vcc (Arduino itself remains On, ready to reconnect to the receiving module)
If playing with Vcc is acceptable, then to force the receiver BT Module to the "disconnected" status (now it remains "in connection" with the main module for some 20 secs after the master BT Module be put down) I shall send an "I am going to disconnect" flag just before removing Vcc; then I shall add on the receiver module the circuitry to remove/reapply Vcc to the receiver BT Module, and this will make the receiver ready for a new connection (from my second controlling device, or from the main Arduino controller) in 1-2 seconds.
Again, thank you for your time and your tips