Android Question BLE multisensor nRF51, data interpretation

peacemaker

Expert
Licensed User
Longtime User
HI, All

Who tried to read such BLE modules ?
Any info about the temperature, pressure, acceleration interpretation from the received bytes ?
I see that the digits depend on the exact model's firmware, but any some variant...
 

f0raster0

Well-Known Member
Licensed User
Longtime User
Any info about the temperature, pressure, acceleration interpretation from the received bytes ?
I see that the digits depend on the exact model's firmware, but any some variant...
Have you tried the link I posted?

What module nRF51 do you have?

Edit, you probably already did it
Also you can start with this:
then convert to hex.
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Have you tried the link I posted?

I do not see here the interpretation of the received data bytes, just receiving and logging HEX data, no data in degrees, kPA, m/c*c....

What module nRF51 do you have?

Round 30mm PCB named as "SENSOR PRO" with internal services starting "6a80" (the general service is "6a800001-b5a3-f393-e0a9-e50e24dcca9e")

Also you can start

Thanks, i have already started :)
Now it's interesting the very important thing - see the parameters in degrees and g-acceleration.
CN seller gives the PDF description of wrong model, on CN and even if to translate it - no description how to interprete the HEX data from this model... :(
Espesially about the acceleration, for temperature, seems, i have "hacked" something, below.
And general question - how to use\interpret the advertizment data ?

B4X:
Service: 00001800-0000-1000-8000-00805f9b34fb; Char: 00002a00-0000-1000-8000-00805f9b34fb  name, 'SENSOR_PRO'
Service: 00001800-0000-1000-8000-00805f9b34fb; Char: 00002a01-0000-1000-8000-00805f9b34fb  appearance (ignore readonly)
Service: 00001800-0000-1000-8000-00805f9b34fb; Char: 00002a04-0000-1000-8000-00805f9b34fb  connection parameters (ignore readonly)
Service: 6a800001-b5a3-f393-e0a9-e50e24dcca9e; Char: 6a80ff0c-b5a3-f393-e0a9-e50e24dcca9e  interval, msec
Service: 6a800001-b5a3-f393-e0a9-e50e24dcca9e; Char: 6a80b280-b5a3-f393-e0a9-e50e24dcca9e  pressure + temperature BMP180
Service: 6a800001-b5a3-f393-e0a9-e50e24dcca9e; Char: 6a806050-b5a3-f393-e0a9-e50e24dcca9e  accelerometer MPU6050
Service: 6a800001-b5a3-f393-e0a9-e50e24dcca9e; Char: 6a803216-b5a3-f393-e0a9-e50e24dcca9e  light


Advertizing:
Found: SENSOR_PRO, FC:7F:24:05:D9:B0, RSSI = -44, (MyMap) {9=[B@79647e8, 1=[B@a557e01, 7=[B@89124a6, 0=[B@d5b5ee7}
53454E534F525F50524F
06
9ECADC240EE5A9E093F3A3B50100806A
0B0953454E534F525F50524F02010611079ECADC240EE5A9E093F3A3B50100806A0000000000000000000000000000000000000000000000000000000000
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Round 30mm PCB named as "SENSOR PRO" with internal services starting "6a80" (the general service is "6a800001-b5a3-f393-e0a9-e50e24dcca9e")
I see, hope someone can help here I'm not an expert.
 
Upvote 0

emexes

Expert
Licensed User
I do not see here the interpretation of the received data bytes, just receiving and logging HEX data, no data in degrees, kPA, m/c*c....

Round 30mm PCB named as "SENSOR PRO" with internal services starting "6a80" (the general service is "6a800001-b5a3-f393-e0a9-e50e24dcca9e")

Thanks, i have already started :)
Now it's interesting the very important thing - see the parameters in degrees and g-acceleration.
How far did you get with this?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Already finished: this round sensor PCBs are very interesting, but its firmware is buggy - it cannot work all the time, accelerometer data got zero after 4-6 hours of work, temperature sensor works OK, and the main BLE connection is OK all the time (20-40 hours of test). But without accelerometer data it's useless.
But the CN seller sent me 700+ MB of developing software, including sch diagram, PCB, seems some FW source codes, but ..... it's huge materials qty to develop myself after payment for the ready product.
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
"its firmware is buggy"

Surely not! :rolleyes:

"accelerometer data got zero after 4-6 hours of work"

So it works ok for 4-to-6 hours, and then the accelerometer data freezes at zero, but the temperature reading still works? Or is it that both readings stop being updated, and instead continually return the last value, which would be probably zero acceleration and a reasonable-looking temperature.

From a battery-preservation point-of-view, having a timeout on powering the sensors is a reasonable safety-net, although you'd think it'd be documented.

If you disconnect and connect again, do the readings become live again? Or perhaps there is some other way to "wake up" the sensor.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
at zero, but the temperature reading still works

Yes! No hangs and freezes, just zero bytes of the acceleration after hours. Tested during a week, 3 examples. I needed them for the industrial control system. I even prepared the PCB of Li-ON battery charger controllers, batteries, wireless QI-chargers that allow to use these sensors for long time, but .... not stable sensor's result. Re-powering by the switch helps to reset, but ... it's a bug.
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
Does "just zero bytes of the acceleration" mean:

1/ you get no acceleration reading at all ie no bytes, or

2/ you still get acceleration readings, but they have value of 0

But you still get a temperature reading? Is the temperature reading still alive, like... if you stick the sensor in a fridge, or aim a heater at it, does the reading change?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
I hope i explained clear, added video of 2 sensors among 3 (there is first video about the first sensor), dispute is won, adapters are on the way to the seller.
Nothing more to say. Just - no warranty to order these interesting sensors to get them ready to use. I have found 4 PCB versions of the exactly same sensors, just different PCB texts and colors.
51822_ITC_PolyU_HK.jpg
 
Last edited:
Upvote 0

biologeek

New Member
Hi everyone,
I'm struggling to get my ble sensor tag to work properly. Did you manage to convert the 8-bytes that sensor produces for temperature and pressure from BMP180 sensor ?
 
Upvote 0

biologeek

New Member
do you have a datasheet for it?
Nope, I asked Aliexpress vendors to provide it but all I received is a PDF with screenshots of an obscure chinese android application.

eg Bosch BMP180 datasheet indicates it has an I2C interface, not BLE

Here's the sensor : https://fr.aliexpress.com/item/4000...earchweb0_0,searchweb201602_,searchweb201603_
It shows several BLE services corresponding to the sensors on the board.

From nRFConnect I got this for BMP data : 0x00-01-80-F4-00-00-00-1C which is supposed to be both temperature and pressure. I've compared to BMP180 datasheet but couldn't find how to calculate temperature and pressure from that.

I saw on several forums that people modified the firmware of nRF51822 to get it working as desired but I'm not an expert in that field. I'm just trying to monitor temperature from an Android device.

Any idea ?
 

Attachments

  • Screenshot_20210808100103.png
    Screenshot_20210808100103.png
    263.2 KB · Views: 173
Upvote 0

emexes

Expert
Licensed User
Nope, I asked Aliexpress vendors to provide it but all I received is a PDF with screenshots of an obscure chinese android application.
That's more than I usually get. :cool:

From nRFConnect I got this for BMP data : 0x00-01-80-F4-00-00-00-1C
...
Any idea ?
Before I even look at the datasheet, your 8 bytes of data look like two 4 byte (32 bit) numbers, the first one around 100000 which could well be air pressure in Pascals and the second is 28 which could plausibly be temperature in Celsius. Or that could all be a complete coincidence. 😂 Hang on a moment while I check out your doc.
 
Upvote 0

emexes

Expert
Licensed User
Hang on a moment while I check out your doc.
it looks like this one: https://forum.mysensors.org/topic/6951/nrf5-multi-sensor-board-12-14
which also looks like this one: https://www.linksprite.com/wiki/ind...h_4.0_BLE_Sensor_Tag/iBeacon_Station_NRF51822

but I think you've already got that far. The simpler solution might be to raise or lower the ambient temperature a couple of degrees, and see if the 1C (hex = 16 + 12 = 28 decimal) changes accordingly. You could try putting the device in the fridge for a while... not sure if BLE will make it through the metal outer, but a few minutes of cooldown should be enough to see a change even after it's removed from the fridge.

Also try raising and lowering the height of the sensor from the floor. Each metre should be around 11 Pascals.
 
Last edited:
Upvote 0

biologeek

New Member
Before I even look at the datasheet, your 8 bytes of data look like two 4 byte (32 bit) numbers, the first one around 100000 which could well be air pressure in Pascals and the second is 28 which could plausibly be temperature in Celsius. Or that could all be a complete coincidence. 😂 Hang on a moment while I check out your doc.


Here's what I found based on your (most probably correct) interpretation : I put the sensor in the freezer and waited to get down to negative values.

Here's what happened : indeed the last 4 bytes changed and decreased down to zero (00-00-00-00) then got negative (FF-FF-FF-FB) so I guess I can calculate temperature this way :

if [ hexString > 100 or anything high enough]
then
temperature = 255 - last byte
else
temperature = last byte

Thanks a lot for your answers !
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
if [ hexString > 100 or anything high enough]
then
temperature = 255 - last byte
else
temperature = last byte
That will work, provided that you're operating within -155 to 100 degrees, and you change "255 - last byte" to "last byte - 256".

If the temperature is ambient and you're in it, then if it's outside of that range, presumably you'll be distracted by more pressing problems than integer wraparound. 🍻
 
Upvote 0

emexes

Expert
Licensed User
decreased down to zero (00-00-00-00) then got negative (FF-FF-FF-FB)
That 99.99% confirms that it is a 32-bit integer. If it was 8-bit it would have changed to 00-00-00-FF, and if 16-bit then 00-00-FF-FF.

Did the previous value of 28 (decimal = hex 1C) match with your ambient air temperature? It is entirely possible that the temperature integer might be in 0.5 degC and that your ambient temperature was more around 14 degC, or in 0.25 degC (which I think is the scale used by OBDII) and ambient was around 7 degC.

edit: nope, OBDII temperature is in unit steps; it is RPM which is in 0.25 steps
 
Upvote 0
Top