BLE rate counter

Thread Starter

pcmann2004

Joined Feb 17, 2022
2
I am trying to figure out the best way to connect multiple BLE chips to a phone/tablet. the BLE chip would send a open/close rate, EG how many times a switch opens/closes in a given time. Does anyone have a way of doing this? would the heavy lifting be done on the BLE chip side of things or on the app/device side of things? Can I use the chip below, add power, a contact switch and add some logic?

https://www.mouser.com/ProductDetai...VYimNs0Hq08Z6x2N5hbO2fjI0FnbPdIRoC3xcQAvD_BwE
 

Irving

Joined Jan 30, 2016
5,118
The device you linked to has an internal microcontroller, but I can find no evidence that it is user programmable so you would need an additional microcontroller to deal with counting the contact pulses and calculating the rate. You don't say how fast your contact rate is, but BLE is a serial protocol and while capable of streaming music it is not suited to handling large numbers of fast but discrete events so you need software at the source to convert the contact pulses to a time-stamped rate (eg pulses per 100 millisecond) transmitted on a regular basis. It needs to be time-stamped locally as the actual transmission arrival time will vary due to collisions at the RF level.

As to connecting multiple BLE to the receiving system, it is possible, but there are limits. What they are depends on the receiving system, the number of channels and the data rate. Without much more information its impossible to say whether it can work.
 

Thread Starter

pcmann2004

Joined Feb 17, 2022
2
The device you linked to has an internal microcontroller, but I can find no evidence that it is user programmable so you would need an additional microcontroller to deal with counting the contact pulses and calculating the rate. You don't say how fast your contact rate is, but BLE is a serial protocol and while capable of streaming music it is not suited to handling large numbers of fast but discrete events so you need software at the source to convert the contact pulses to a time-stamped rate (eg pulses per 100 millisecond) transmitted on a regular basis. It needs to be time-stamped locally as the actual transmission arrival time will vary due to collisions at the RF level.

As to connecting multiple BLE to the receiving system, it is possible, but there are limits. What they are depends on the receiving system, the number of channels and the data rate. Without much more information its impossible to say whether it can work.
The device you linked to has an internal microcontroller, but I can find no evidence that it is user programmable so you would need an additional microcontroller to deal with counting the contact pulses and calculating the rate. You don't say how fast your contact rate is, but BLE is a serial protocol and while capable of streaming music it is not suited to handling large numbers of fast but discrete events so you need software at the source to convert the contact pulses to a time-stamped rate (eg pulses per 100 millisecond) transmitted on a regular basis. It needs to be time-stamped locally as the actual transmission arrival time will vary due to collisions at the RF level.

As to connecting multiple BLE to the receiving system, it is possible, but there are limits. What they are depends on the receiving system, the number of channels and the data rate. Without much more information its impossible to say whether it can work.
It would be no more than 200 pulses a minute. The receiving side of things would be an application using the chips that are inside a tablet or phone. I would be targeting 1 connection. In the future, 6 devices would be connected.
 

Irving

Joined Jan 30, 2016
5,118
It would be no more than 200 pulses a minute.
...
In the future, 6 devices would be connected.
Per channel? ie 1200/minute in total eventally. That doesnt seem too onerous. Would there be a need for synchronisation between channels i.e. relating the timing of a specifc contact close on onechannel to that on another or is it just the contact rate per eg second that's important?

The receiving side of things would be an application using the chips that are inside a tablet or phone. I would be targeting 1 connection. In the future, 6 devices would be connected.
Do you mean the end device will be an app running on a phone or tablet or some dedicated user device (in which case what volumes? Chips used in phones might not be the most cost effective solutions for low volumes).

Multiple devices connected simultaneously on BLE5 is supported to a maximum of 7 but that's not the whole story. If 2 devices have the same profile, eg 'headphone' only one can be active at a time ie you cannot, as standard, stream music to two headphones simultaneously, even if both are connected. Similarly while you can connect two keyboards to a tablet you cannot receive keystrokes from both simultaneouly; you have to select which is the active device. Since you want 6 active devices you need a BlueTooth hub which effectively has 6 BLE transceivers (like the chip you linked to) and a coordinating microcontroller which combines the data streams. This would either be your end device or would forward the combined stream to the end device.

BLE5 might not be the best technology here. Normal Wi-Fi or straight baseband RF would be cheaper and easier.
 
Top