Espruino MDBT42Q Breakout for 1kHz Signal Acquisition #6542
Replies: 1 comment
-
Posted at 2021-05-26 by @gfwilliams Hi,
You're correct in that you can only get a max packet rate of 125Hz. This is a limitation of Bluetooth (7.5ms connection interval). However you can send a bunch of of data within that packet, and with up to date firmware 2000 bytes/second should be pretty attainable. You should be able to use the Waveform class to sample data at 2kHz: https://www.espruino.com/Waveform
The breakout board is about 18x28mm, but you could potentially use the module directly if you're able to design your own PCB
That's correct, yes. Hope that helps! Posted at 2021-05-27 by user129301 Thank you very much for your reply and it certainly helps! We are of course designing our own board which is why the dimensions are important. I am still getting around Bluetooth 5.0 and Java (I am more used to C). I found out that BLE 5.0 is capable of sending a max. of 244 bytes in a packet. I had been pondering on a pseudocode for a fast transmission of a 500 Hz biosignal. Suppose we receive the data from an ADC in INT or UNSIGNED INT format. In that case, I want to send 200 bytes (containing 100 sample values). These 100 values are sampled at 1 ms. These 100 samples (which would take roughly 0.1 s to record) would be placed in a TX buffer and would be sent to the Master device. I would be grateful if you could check my (rough and simple) pseudocodes below to see if my concepts are right. TX (Peripheral Side) START: setup() Loop() END: RX (Master Side) START: Global Var flag; // flag for receiving new values in buffer setup() } Loop1() Buffer = Receive Values Flag = 0; Timer Interrupt ISR (called after 1 ms) } I have written down this rough C based pseudocode off the top of my head. I request you to kindly critique on it and comment if I have to worry about timing issues i.e data back log or loss etc. Please understand my lack of knowledge of BLE. I would be grateful for any replies. Thank you Posted at 2021-05-27 by @gfwilliams Hi - it's worth noting that Java and JavaScript (what Espruino uses) are actually very different, despite the name - so be a bit careful! What device did you intend to use for the RX (Master Side)? Another MDBT42Q, or a phone/PC? Right now the standard builds of Espruino only handle a max 53 byte packet size (even though longer is supported by the spec), so worth bearing that in mind. Also, with Espruino you want to really handle data when an event happens, not in 'loop'. If you use 'loop' then you're just running the CPU constantly burning through your battery. The code required is simple enough it's worth just posting the whole thing rather than pseudocode. Something like this will probably work for the Espruino side:
Posted at 2021-05-27 by user129301 Thank you very much for your reply. I should have mentioned the Master side in my previous message. Yes, at this point I intend to use an MDBT42Q at the Master side too and in order to check the result of the transmission, I wanted to print the result. I would be grateful for your feedback on the Master side (RX) pseudocode as well. I am grateful for your event based transmission comment in your previous message, and the code seems simple enough to modify and test. Additional question: Is the process of receiving and handling data different when using a phone/PC. I would be grateful for your response. ZJ Posted at 2021-05-28 by @gfwilliams In the example code I gave I'm just using the standard 'UART' bluetooth mode, so on the RX side you'd just use this: http://www.espruino.com/BLE+UART#receiving-evaluating
On the PC side it's not that different, except you have to be able to access Bluetooth LE. Some code examples are at https://www.espruino.com/Interfacing#bluetooth-le I ask because the PC has more resources and the data transfer rate may actually be faster between one MDBT42Q and a PC than it is between two MDBT42Q. You'd just have to do some testing and see if it was good enough for your requirements. Posted at 2021-05-31 by user129301 Thank you very much for your reply. My first plan is to communicate the data with the PC from the Espruino. I have ordered the MDBT42Q and keep you posted of my progress. I am still a novice using this device so please don't mind me asking a lot of question in the future. Thank you again. ZJ Posted at 2021-06-07 by @gfwilliams Great, hope it goes well. No problem at all - that's what this forum is for! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-26 by user129301
Dear Administrator,
I hope that you are in good health.
I am working on an application for transmitting a 500 Hz biosignal from an external signal acquisition device wirelessly to a computer or another remote device. For this design, I require a board with an in-built ADC along with a wireless transceiver (preferably Bluetooth for stable connection). While searching the internet, I stumbled upon the Espruino MDBT42Q module.
I have some experience with Bluetooth 4.0 Low Energy using Red Bear Nano modules; however, as far as I remember, they could only provide 125 Hz using the Arduino IDE.
My main requirements are as follows:
To the best of my understanding, I found Espruino MDBT42Q which uses the Nordic Semiconductor nRF52832 the most appropriate to my application. I would be grateful if you can let me know if my understanding is correct. I would also be grateful if you could provide me with other options with improved features i.e. smaller size, higher resolution ADC, faster transmit/receive.
I have an additional question regarding programming the Espruino MDBT420 board. I was reading the "Getting Started" page and I found out that the device can programmed wirelessly using a Web IDE provided we have a compatible in built Bluetooth module and Web Bluetooth. Have I understood that correctly?
I would be grateful for any replies.
Thank you.
ZJ
Beta Was this translation helpful? Give feedback.
All reactions