How it works
Flexible, portable sensor integration
Making IoT development easier
The UPM repository provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platforms, as well as the attached sensors, through calls to MRAA APIs.
Compatible boards
Intel® Joule™ Module
Intel® Edison Module
Intel® Galileo Board
Intel® Quark™ Microcontroller D2000
Intel® Quark™ SE Microcontroller C1000
Intel® IoT Gateway
Intel® NUC
Arduino* and Genuino* 101
Banana Pi*
BeagleBone Black*
MEDIATEK LinkIt* Smart
MinnowBoard*
Raspberry Pi*
Terasic DE10-Nano Kit*
UP* and UP Squared*
96Boards*

About MRAA
Every sensor module on this site is compatible with the mraa.io API library—a Linux* Library for low-speed I/O communication in C with bindings for C++, Python, Node.js, and Java. It supports generic I/O platforms and compatible boards.
Getting set up
1Install or update to the latest version of UPM.
2Find your sensor/actuator.
3Most sensors/actuators include code snippets. Try them or explore the API documentation for your preferred programming language.
4Prototype, develop, and deploy your solution!
upm::Adxl345* accel = new upm::Adxl345(0);
while(true){
accel->update(); // Update the data
raw = accel->getRawValues(); // Read raw sensor data
acc = accel->getAcceleration(); // Read acceleration (g)
fprintf(stdout, "Current scale: 0x%2xg\n", accel->getScale());
fprintf(stdout, "Raw: %6d %6d %6d\n", raw[0], raw[1], raw[2]);
fprintf(stdout, "AccX: %5.2f g\n", acc[0]);
fprintf(stdout, "AccY: %5.2f g\n", acc[1]);
fprintf(stdout, "AccZ: %5.2f g\n", acc[2]);
sleep(1);
}
adxl = adxl345.Adxl345(0)
while True:
adxl.update() # Update the data
raw = adxl.getRawValues() # Read raw sensor data
force = adxl.getAcceleration() # Read acceleration force (g)
print("Raw: %6d %6d %6d" % (raw[0], raw[1], raw[2]))
print("ForceX: %5.2f g" % (force[0]))
print("ForceY: %5.2f g" % (force[1]))
print("ForceZ: %5.2f g\n" % (force[2]))
# Sleep for 1 s
sleep(1)
var adxl345 = require('jsupm_adxl345');
var adxl = new adxl345.Adxl345(0);
setInterval(function()
{
adxl.update(); // Update the data
var raw = adxl.getRawValues(); // Read raw sensor data
var force = adxl.getAcceleration(); // Read acceleration force (g)
var rawvalues = raw.getitem(0) + " " + raw.getitem(1) + " " + raw.getitem(2);
console.log("Raw Values: " + rawvalues);
console.log("ForceX: " + force.getitem(0).toFixed(2) + " g");
console.log("ForceY: " + force.getitem(1).toFixed(2) + " g");
console.log("ForceZ: " + force.getitem(2).toFixed(2) + " g");
}, 1000);
upm_adxl345.Adxl345 sensor = new upm_adxl345.Adxl345(0);
while (true) {
sensor.update();
val = sensor.getRawValues();
accel = sensor.getAcceleration();
System.out.println("Current scale: " + sensor.getScale());
System.out.println("Raw Values: X: " + val[0] + " Y: " + val[1] + " Z: " + val[2]);
System.out.println("Acceleration: X: " + accel[0] + "g Y: " + accel[1] + "g Z: " + accel[2] + "g");
Thread.sleep(1000);
}