Ruuvi Tag - Ready To Go

The Ruuvi Tag is distributed ready to transmit environment data packets periodically in highres (raw) mode.
The (very) faint blinking of the green LED indicates URL mode while the red LED indicates raw mode.
The mode is changed by pressing the B button on the tag.

Be sure to enable Bluetooth in settings on the phone.
There are android apps that can display the data directly.

See the getting started video.

There are applications which issue a notification whenever a new beacon is detected.
Packets can be processed by a mobile phone with ruuviStation app or open beacon.
Another option is to establish a device, such as a raspberry pi, to receive the packets and run a progran to intrepret the data.

Blue tooth Low Energy Header for advertising packets

Reference:TI.com , Bluetooth.com Silicon labs KBA_BT_0201: Bluetooth advertising
byte
offset
0 01
04
HCI_EVT
1.0 3E LE Meta PDU haeader
2 2B
2A
packetLength variable payload from 6 to 37 bytes.
25 for fmt03, 2B for fmt05
ADV_NONCONN_IND - Non connectable undirected advertising(31 byte message) (not ADV_IND(31 byte message) , ADV_DIRECT_IND, 6x ADV_SCAN_IND(31 byte messsage)) 23 ??
2 02 subEvent: 02 LE advertising Report
3 01 numberOfReports
4 04
00
03
event type:04= scan response
00     connectable unidir adv
03 Non-connectable unidir adv flags 02 01 04; ll=1B;FF mfg specific;0499 Ruuvi Int ; fmt05 packet
len=11;UUID,len=0b,
6 01 peerAddressType : 01: Random Device Address
7..12 zz:yy:xx:ww:vv:uu 6 byte MAC LSB first !
13 1E†
15/17/19/1F
Length
14..16 02 flags
15 01
16 04
17 11/15/1B Length
18 FF Manufacturer Specific
19..20 99 04 Ruuvi Mfg ID
shown by hcidimp as 09 at end of line and second line begins with 04.

Advertising data
Scan Response: 11=Length; 07=128-bit Servie Class UUIDs; example:6e4000001-b5a3-f393-e0a9-e50e24dcca9e
0B=length; 09=DeviceName ; 'Ruuvi 20BC' xx=RSSI
ruuvi.drivers.c/src/tasks/ruuvi_task_advertisement.c:133

Max length for BLE 4.0 is 31, BLE 5.0 254.

Packet as seen by hcidump

hcidump --raw |grep --after-context=2 'FF 99 $'
> 04 3E 2B 02 01 00 01 DC 06 65 6D FD D0 1F 02 01 04 1B FF 99
  04 05 0F ED 30 77 C5 5D FC F0 02 98 FF D8 A5 B6 BE E3 41 D0
  FD 6D 65 06 DC B6=RSSI

High Res formats 3 and 5
Aka raw and RawV2

Used by:
See Tomi Tuhkanen's ruuvitag_sensor or Henrik Heikkil's ruuvi Collector .
or your own custom reader/interpreter and additional hardware for receiving .

The tag will indicate highres (raw) mode by faintly blinking the red LED

The data is decoded from "Manufacturer Specific Data" field, undirected, non-connectable bluetooth advertisement. More details are at Argenox .

Current sensor readings transmitted at 1 second intervals.
ruuvi's manufacturer ID is 0x0499.

Note that there are Bluetooth Generic Attributes (GATT) services specifications for services including ESP Environmental Sensing Profile, which include Humidity but those are NOT used here.

The payload is:

Offset
intrepreted values Description
0 05 Format type code
1 – 2 -40.000 — 84.995 Temperature (16bit signed in .005 centigrade units ie 200ths. )
Examples:
0x1388 = 5000, 5000*.005=25°C
0xFF67 = -0x0098+1 i.e. -153 , -153*.005 = -0.765°C
0x7FFF =  32767 *.005 = 206.695 ! 0x8001 = -32767 *.005 = -206.695
-32767 aka 0x8000 Invalid / not available

Operating range -40°C(-40°F; 0xE0C0 200ths) – 85°C(185°F;0x4268 200ths) BME280 accuracy ±1°C in the range of 0°C(32°F) – 60°C(140°F)

3 – 4 0 — 100 Humidity: 16bit unsigned; in .0025%, divide by 400 to get percent.
Example 0x9470 = 38000/400 = 95%. 0x9C40 = 100% .
Invalid results from the sensor are reported as 163.83% (packet value 0xFFFF ) or 0xBB80 (i.e. 120).

BME280 accuracy ±3% in the range for 20%-80%,
operating range -40°C(-40°F) – 85°C(185°F)
download BME280 datasheet( local copy) description.

5 – 6 500 — 1,100 atmospheric pressure ( 16bit unsigned, offset by 50000) 65535 (0xFFFF) indicates invalid or unavailable
Example:0xC340 = 49984, 49984+50000=99984 aka 999.84hPa(aka 29.52 inHg)

Considering that the weather related airpressure changes very slowly, a change of xxxx within a few seonds or even minutes can be used to determine change in height of the RuuviTag over a short time period. See .

7 – 8 -16,000 — 16,000 Acceleration-X ( 16bit signed Most Significant Byte first)
9 – 10 -16,000 — 16,000 Acceleration-Y STMicroelectronics LIS2DH12
11 – 12 -16,000 — 16,000 Acceleration-Z
Examples:03F8 = 1.016
This can be used to determine the orientation of the Ruuvi Tag. For example if it is flat on a table the Z component will report a value near 1.000.
See movement and orientation
( values over 16000 indicates error (implementation pending 10/04/17)
13 – 14.2
(13.14.)>>5
(13.14.)/32
1.600 — 3.646 Battery voltage above 1.600V, in millivolts, 11 bits unsigned (0-2046 )
2047 (FFEx or FFFx) indicates an invalid reading.
Examples:D4B6=3.3v(new); AC9x=2.98v; 9C4x=2.85v; 960x=2.800v ; 8FCx=2.750
Evaluate using:    echo 'ibase=16; print 640+(   9xxx   /20),"\n"' | /usr/bin/bc
Note: 1600 aka 0x640 and >>5 aka /0x20
14.3 – 14.7
byte 14 & x'1F'
-40 — +4 TX power above -40dBm, in 2dBm steps. 5 bits unsigned.
Actually Nordic nRF52832 only allows -40, -20, -16,-12, -8, -4, 0, +3 and +4 Value of x'1F' indicates invalid value.(?)
15 0 — 254 Movement counter ,8bit unsigned, incremented by motion detection interrupts from LIS2DH12 Accelerometer
Highest valid value is 254, with 255 is reserved for the "Not Available".

This seems too small a field since a single movement can cause manny intrrupts causing this to rollover too often.DGG

16 – 17 0 — 65,534 Measurement sequence number ,16bit unsigned. 65,535 indicates not available. Each time a measurement is taken, this is incremented by one.
Used for measurement de-duplication (depending on the transmit interval, multiple packets with the same measurements can be sent, and there may be measurements that never were sent). Takes 18 hours to rollover at 1 measurment /
18 – 23 C0:00:00:… –
FF:FF:FF:…
NRF_FICR->DEVICEADDR
MAC= NRF_FICR->DEVICEADDR | C0 00 00 00 00 00
Always leading Cx, Dx, Ex or Fx
 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
05 12 D4 9C 40 C3 40 00 38 00 E4 03 E4 90 76 41 AD EE F7 FA 74 4A 1E 1A            B8=RSSI
f  temp  humid atmp  xxxxx yyyyy zzzzz b   t  m  -seq- ---- MAC -------- 
m                                      a   X  o
t                                      t   p  v
                                           r  # 

Offset
intrepreted
values
Description
0 03 Format type code
1 0..100 Humidity: in 0.5%, example: 0x70 is 56%. Values > 0x64 indicate error
(accuracy tolerance ±3% in the range for 20%-80%)
2 -40..85 Temperature (MSB is sign, next 7 bits are value (akward?) centigrade.
3 0..99 Temperature (fraction, 1/100.)
Values over 99 indicates error (implementation pending 10/04/17)
cannot initalize, unreadable, excessive variation from previous reading, exceeds reasonable value (see Bosch selfTest
SHTC3 Sensirion.com
4-5 500..1,100 atmospheric pressure (Most Significant Byte first, value bias 50hPa)
Values over 1,100 indicates error (implementation pending 10/04/17)
cannot initalize, unreadable, excessive variation from previous reading, exceeds reasonable value
6-7 -16000..16000 Acceleration-X (Most Significant Byte first)
8-9 -16000..16000 Acceleration-Y STMicroelectronics
10-11 -16000..16000 Acceleration-Z Examples:03F8 = 1.016
( values over 16000 indicates error (implementation pending 10/04/17)
12-13 1700 .. 3300 Battery voltage (millivolts)
Sample:
99 04  03 C8     15 61      C4 4C        01 1D   FF 3D   03 9D    0B A1 00 00 00
mfgr  fmt hum    temp       atmo press     X       Y       Z      battery
          200    21                                                 2.977
          100%     .97


04 3E 25 02 01 03 01 D5 37 52 68 33 F2 19 02 01 04 15 FF 99 04 03 2C 1A 08 C9 79 00 0B FF F5 03 EB 0A ED 00 00 00 00 CD
                     |------MAC------|                   |CIC|fmt|hum|temp|press |  x | y   |  z  |batt              ||RSSI

See discussion.

Temperature: -127.99°C to +127.9 °C (well over boiling!) in .01°C increments.
Value:Measurement; x0000:0°C ; x8145:-1.°C; x0145:1 °C
Atmospheric Pressure
50,000 Pa to 115,536Value Measurement: Pa in 1 Pa increments. (1003-1026 range found by scrin https://graphs.2kgwf.fi/dashboard/db/ruuvi-demo)

Value:Measurement; 0-50000 Pa; 41325:101325 Pa (average sea-level pressure) ; 65534:115534 Pa ; 65535 error to be implemented 50,000 Pa to 115,536Value Measurement: Pa in 1 Pa increments. (1003-1026 range found by scrin https://graphs.2kgwf.fi/dashboard/db/ruuvi-demo)

Value:Measurement; 0-50000 Pa; 41325:101325 Pa (average sea-level pressure) ; 65534:115534 Pa ; 65535 error to be implemented

Acceleration -32000 to 32000 (mG), 16 G max (2 G in default configuration).
Values are 2-complement int16_t, 3 channels X,Y,X
Value:Measurement; 0xFC18:-1000 mG ; 0x03E8:1000 mG ; 65535 error to be implemented
Battery voltage 1800 mV to 3300 mV in 1 mV increments, accuracy? ; 1000 error to be implemented
ToDo: "special" values to indicate error.


Which begin at offset 25 within the packet. Hardware B7.1 Test Points

The System On a Chip used in the ruuvi nRF52832

This document adapted from: github.com/ruuvi/ruuvi-sensor-protocols

https://github.com/google/eddystone/blob/master/eddystone-url/docs/config-service-spec.md

Additional links for information:
ruuvi.slack
ruuvi forum

Apps for IOS

From the AppStore For example: NordicSemi

Maximu BLE packet length was revised with version4.2 to be 251

download Bluetooth.org core specs (26MB)

Regarding humidity and dew point

And then there's NFC python lib used to interact with the ruuvi.

Nearby Notification policy

GATT: read the logs with RuuviWebBLE using Chrome and Web Bluetooth

Documentation for depreicated URL formatsversion 05/13/21 DGG