0

I currently have a drawer lock model F5, which is typically installed inside drawers in rooms, shoe cabinets, wardrobes, and similar places. I possess a Bluetooth unlocking device A1, which functions as follows: when I use a successfully recorded NFC card, fingerprint, or password for verification, upon successful authentication, A1 initiates a Bluetooth connection with F5 and sends an unlocking command. Once F5 establishes a Bluetooth connection with A1 and receives the unlocking command, it performs the unlocking action.

It is a microcontroller program written in C language. How should I adjust it to reduce the failure of master-slave Bluetooth connections? When the Bluetooth connection fails, it always returns an error code 0x3E. The potential causes of this issue could be: the presence of many Bluetooth devices around, leading to a very crowded channel, or the master and slave devices are relatively far apart (more than 10 meters distance), resulting in very weak signal strength.

How can I resolve this issue and improve the speed of the master-slave Bluetooth connection?

I have attempted to adjust the frequency of the master-slave Bluetooth devices to ensure they are both centered at 2.44 GHz to mitigate Bluetooth connection issues caused by significant frequency deviation.

In fact, their connection speeds did improve.

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Jul 4 at 14:01

1 Answer 1

0

What kind of solution are you envisioning that would overcome channel contention that wouldn't violate Bluetooth specs? (You could always build a 1W transmitter, ignore the spec and just transmit over every other device in the room…but please don't.) If you control all the devices, though, you can consider a backoff scheme to more efficiently use available bandwidth.

If you want longer distances, then use a directional antenna. Given your description, your receiver only really wants to listen from one direction, and depending on how the user interacts with the transmitter, "pointing" it may be appropriate.

Scan intervals have a massive impact on discovery time. Advertising hops between multiple channels, and both sides need to wind up on the same channel at the same time to find each other. For information on designing that, see https://electronics.stackexchange.com/questions/82098/ble-scan-interval-and-window.

upon successful authentication, A1 initiates a Bluetooth connection with F5

For fast operation, this is not a great design IMO. On the assumption that only one "key" is going to interact with a given "lock," I would make the connection as soon as possible, before authentication. Then send the unlock command after authentication. Ideally avoid re-discovering the lock, and just re-connect directly.

You haven't really given us enough details to go into the specifics of this. These are just general parts of many BLE designs. A lot depends on how much control you have over the components of the system and the environment. There are a lot of trade-offs to good device design, and there's no general answer that will necessarily be ideal for a specific situation.

Not the answer you're looking for? Browse other questions tagged or ask your own question.