A way to connect a WS2812-strip or ring directly to the Raspberry Pi.

What you need:

If you want to use a lot of LED´s, you have to use an external power supply. You have to connect the Ground of the Pi with the Ground of your power supply. In my case a ring with 16 LED´s works fine directly to the 5V of the Pi.

The data line goes to GPIO18.

In Node Red install the plugin node-red-node-pi-neopixel via “Manage palette”

Here is a Flow, to get startet:

[{"id":"edb27438.2943d8","type":"function","z":"9dcfc85e.b28928","name":"LED 2 (Value)","func":"var LED = \"2\"; //LED-Number\nvar Ron =\"255\"; // Color On-State\nvar Gon =\"255\";\nvar Bon =\"255\";\nvar Roff =\"0\"; // Color Off-State\nvar Goff =\"0\";\nvar Boff =\"0\";\nif (msg.payload>1500)\n    msg.payload=msg.payload=LED+\",\" + LED + \",\" + Ron +\",\" + Gon +\",\" + Bon;\nelse\n    msg.payload=LED+\",\" + LED + \",\" + Roff +\",\" + Goff +\",\" + Boff;\nreturn msg;\n","outputs":1,"noerr":0,"x":390,"y":80,"wires":[["33edf5a4.2ffb0a"]]},{"id":"33edf5a4.2ffb0a","type":"rpi-neopixels","z":"9dcfc85e.b28928","name":"","pixels":"16","bgnd":"Black","fgnd":"Grey","wipe":"40","mode":"pixels","rgb":"rgb","brightness":"50","gamma":true,"x":610,"y":80,"wires":[]},{"id":"f5fac0f3.4c9cb","type":"function","z":"9dcfc85e.b28928","name":"LED 3 (State)","func":"var LED = \"3\"; //LED-Number\nvar Ron =\"0\"; // Color On-State\nvar Gon =\"255\";\nvar Bon =\"0\";\nvar Roff =\"255\"; // Color Off-State\nvar Goff =\"0\";\nvar Boff =\"0\";\nif (msg.payload==true)\n    msg.payload=msg.payload=LED+\",\" + LED + \",\" + Ron +\",\" + Gon +\",\" + Bon;\nelse\n    msg.payload=LED+\",\" + LED + \",\" + Roff +\",\" + Goff +\",\" + Boff;\nreturn msg;\n","outputs":1,"noerr":0,"x":390,"y":180,"wires":[["33edf5a4.2ffb0a"]]},{"id":"330ce926.7d4616","type":"inject","z":"9dcfc85e.b28928","name":"Value","topic":"","payload":"1600","payloadType":"str","repeat":"","crontab":"","once":false,"x":123,"y":70,"wires":[["edb27438.2943d8"]]},{"id":"24ad5b1e.478194","type":"inject","z":"9dcfc85e.b28928","name":"Value","topic":"","payload":"100","payloadType":"str","repeat":"","crontab":"","once":false,"x":124,"y":115,"wires":[["edb27438.2943d8"]]},{"id":"ee8d7f21.5d902","type":"inject","z":"9dcfc85e.b28928","name":"State","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":120,"y":180,"wires":[["f5fac0f3.4c9cb"]]},{"id":"b1583764.afdb28","type":"inject","z":"9dcfc85e.b28928","name":"State","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"x":120,"y":230,"wires":[["f5fac0f3.4c9cb"]]}]