Lesson 4 - Lights!
π§βπ» Duration: 40 minutes
π― Target audience: individuals and groups
1. Introductionβ
In HARDWARIO Playground, you already know how to find inputs, process them, and print them to the Dashboard.
This gave you the basic skills for working with sensors and data visualization.
The next lesson will be a game with an LED strip, which will bring light to this part of the work and open new possibilities for creative use.
2. Whatβs Readyβ
β
A prepared and paired Button Module or PIR Module
β
Knowledge of working with messages in Playground (the Change and Switch nodes)
β
Power Module and LED strip
3. Flash Firmware for the Power Moduleβ
- Connect the Power Module using a USB cable.
- In the Firmware tab, select the latest version.
- Mine had
twr-radio-power-controller-rgb150
installed, but itβs definitely good to update it.
- Mine had
- The LED strip does not need to be connected at this moment, but it wonβt cause any issues if it is.
4. Pair the Power Moduleβ
The Power Module is unique in that it does not have batteries β it is powered directly from a power source.
- In the Devices tab, click Start pairing.
- Plug the Power Module into the power source β this puts it into pairing mode.
- After pairing, the Power Module appears as
power-controller:0
.

5. Start It Up!β
Programming in the flow again begins with a message that triggers something. There are several options:
β
Button Module β monitoring a button press
β
PIR Module β monitoring orientation
β
Any module β all of them have temperature, which you can change (a more patient option π)
6. What to Send to the Power Moduleβ
So far, you have used the mqtt in node to read from sensors.
Now we need to write to the device β we use mqtt out.
The topic that lights up the strip, for example, is: node/power-controller:0/led-strip/-/color/set
7. What Message to Sendβ
Directly connecting an input (e.g., Button
with message 1
) to an output (LED strip setting) wonβt lead to the desired result.
Therefore, use a Change node, where you reassign msg.payload
to a color value in RGB hex code (for example, red: "#FF0000"
).
π If youβre not familiar with RGB color coding, we recommend checking available color tables.

8. Playing with Codeβ
For code that can change the LED strip color based on PIR sensor orientation:
- Add a Switch node.
- According to orientation (1β6), set a different color (
msg.payload
). - Send it via mqtt out to the Power Module.

9. Colors and Effectsβ
It would be a shame not to light up the LED lights in their full range, so donβt hesitate to try, for example, the command node/power-controller:0/led-strip/-/effect/set
, to which you pass the message:
{"type":"rainbow", "wait":10}
Are your eyes hurting from too much brightness? node/power-controller:0/led-strip/-/brightness/set
takes values from 0β100 as the message and sets the brightness.
10. Addressingβ
The LED strip can also be addressed per individual LED using node//led-strip/-/set-pixel/set
, the message then contains information like {"type":"rainbow", "wait":10}
.
{"type":"rainbow", "wait":10}
Are your eyes hurting from too much brightness? node/power-controller:0/led-strip/-/brightness/set
takes values from 0β100 as the message and sets the brightness.
11. Summaryβ
You have paired the Power Module with firmware for the LED strip.
You know how to light up the LED strip in different colors and even add effects.