The Ruuvitag is a Bluetooth LE beacon with an environment sensor and accelerometer built in.

Full details on flashing Ruuvitag can be found at

Binaries can be found in:


Ruuvitag can be used like any other Espruino Bluetooth LE device, with full access to the NRF class for BLE Functionality.

However to use the built-in sensors you will need to use the Ruuvitag library. For instance to get data, use:

var Ruuvitag = require("Ruuvitag");
// prints { "temp": 23.70573815741, "pressure": 1017.27733597036, "humidity": 42.0771484375 }
// prints { "x": 3.90625, "y": -7.8125, "z": 984.375 }

You can also call a function whenever acceleration data is received:

var Ruuvitag = require("Ruuvitag");
Ruuvitag.setAccelOn(true, function(xyz) {

By default Espruino uses the low power accelerometer mode, however the peripherals can be accessed directly:

  • Ruuvitag.env is an instance of the BME280 environment sensor library
  • Ruuvitag.accel is an instance of the LIS2DH12 accelerometer library


// Set whether the environmental sensor is on or off
exports.setEnvOn = function (on) { ... }

/* Set whether the accelerometer is on or off. A callback can be supplied
  which will be called with an {x,y,z} argument
exports.setAccelOn = function (on, callback) { ... }

// Get the last received environment data { temp: degrees_c, pressure: kPa, humidity: % }
exports.getEnvData = function (on) { ... }

// Get the last received accelerometer data, or undefined
exports.getAccelData = function (on) { ... }

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.