node-poweredup2.5.1 • Public • Published
LEGO Powered Up is the successor to Power Functions, the system for adding electronics to LEGO models. Powered Up is a collection of ranges - starting with LEGO WeDo 2.0 released in 2016, LEGO Boost released in 2017, and LEGO Powered Up released in 2018. It also includes the 2018 Duplo App-Controlled Train sets.
Node.js v8.0 required.
npm install node-poweredup --save
node-poweredup uses the Noble BLE library by Sandeep Mistry. On macOS everything should function out of the box. On Linux and Windows there are certain dependencies which may need installed first.
Note: node-poweredup has been tested on macOS 10.13 and Debian/Raspbian on the Raspberry Pi 3 Model B.
While most Powered Up components and Hubs are compatible with each other, there are exceptions. For example, there is limited backwards compatibility between newer components and the WeDo 2.0 Smart Hub. However WeDo 2.0 components are fully forwards compatible with newer Hubs.
|Device Name||Product Code||Type||WeDo 2.0 Smart Hub||Boost Move Hub||Powered Up Hub||Availability|
|WeDo 2.0 Tilt Sensor||45305||Sensor||Yes||Yes||Yes||45300|
|WeDo 2.0 Motion Sensor||45304||Sensor||Yes||Yes||Yes||45300|
|WeDo 2.0 Medium Motor||45303||Motor||Yes||Yes||Yes||45300
|Boost Color and Distance Sensor||88007||Sensor||Partial||Yes||Yes||17101|
|Boost Tacho Motor||88008||Motor/Sensor||Partial||Yes||Yes||17101|
|Powered Up Train Motor||88011||Motor||Yes||Yes||Yes||60197
|Powered Up LED Lights||88005||Light||Yes||Yes||Yes||88005|
In addition, the Hubs themselves have certain built-in features which this library exposes.
|Hub Name||Product Code||Built-In Features||Availability|
|WeDo 2.0 Smart hub||45301||RGB LED
|Boost Move Hub||88006||RGB LED
2x Tacho Motors
|Powered Up Hub||88009||RGB LED
|Powered Up Remote||88010||RGB LED
Left and Right Control Buttons
|Duplo Train Base||28743||RGB LED/Headlights
Color and Distance Sensor
Known Issues and Limitations
The Boost Color and Distance sensor only works in color mode with the WeDo 2.0 Smart Hub.
When used with the WeDo 2.0 Smart Hub, the Boost Tacho Motor does not support rotating the motor by angle.
Node.js Sample Usage
const PoweredUP = ;const poweredUP = ;poweredUP;poweredUP; // Start scanning for Hubsconsole;
More examples are available in the "examples" directory.
Thanks go to Jorge Pereira (@JorgePe), Sebastian Raff (@hobbyquaker), Valentin Heun (@vheun), Johan Korten (@jakorten), and Andrey Pokhilko (@undera) for their various works, contributions, and assistance on figuring out the LEGO Boost, WeDo 2.0, and Powered Up protocols.