NeoPixel with ESPEasy and Node-RED
Moderators: grovkillen, Stuntteam, TD-er
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
NeoPixel with ESPEasy and Node-RED
Hi,
I've just ordered a set of development boards (CJMCU-2812-8) that I plan to use with ESPEasy (Wemos D1 Mini) and via MQTT with Node_RED.
I have two main questions.
POWER
I've seen various people using 5v and 3V3 to power the strips.
What's the best voltage to use?
If I use 5v, do I need to level shift the data line from the Wemos D1 Mini?
COMMANDS
I've searched for documentation on commands/functions to drive the LED strips via MQTT.
All I can find is:
topic: /ESP_node/cmd
payload: Neopixel, number, color_value, color_value, color_value
e.g. payload: Neopixel,1,50,0,0 sets the first Neopixel to red.
Any help/suggestions/pointers to documentation would be apprciated.
Cheers from David.
I've just ordered a set of development boards (CJMCU-2812-8) that I plan to use with ESPEasy (Wemos D1 Mini) and via MQTT with Node_RED.
I have two main questions.
POWER
I've seen various people using 5v and 3V3 to power the strips.
What's the best voltage to use?
If I use 5v, do I need to level shift the data line from the Wemos D1 Mini?
COMMANDS
I've searched for documentation on commands/functions to drive the LED strips via MQTT.
All I can find is:
topic: /ESP_node/cmd
payload: Neopixel, number, color_value, color_value, color_value
e.g. payload: Neopixel,1,50,0,0 sets the first Neopixel to red.
Any help/suggestions/pointers to documentation would be apprciated.
Cheers from David.
Re: NeoPixel with ESPEasy and Node-RED
Hi dave,
Power:
The datasheet for the Neopixel LEDs (Technically a WS2812B led, datasheeet from https://www.parallax.com/downloads/ws28 ... -datasheet )
says 3,7 ... 5,3V for driving the neopixel leds.
So far the theory.
For my purposes I use 5V as VCC and a level shifter up to 5V for driving to stay on the safe side.
3.3V is out of sepcification but I know a lot of people using 3.3V for data driving.
As long as it works ...
Payload:
I don't use MQTT so I can't say much about the exact syntax.
The example you gave is exactly the way the neopixel is driven.
I'm using these LEDs as a status control, just sending a
to set the third neopixel led to a dimmed red.
<device> is the device name you give to the neopixel task in the devices tab in ESPEasy.
Power:
The datasheet for the Neopixel LEDs (Technically a WS2812B led, datasheeet from https://www.parallax.com/downloads/ws28 ... -datasheet )
says 3,7 ... 5,3V for driving the neopixel leds.
So far the theory.
For my purposes I use 5V as VCC and a level shifter up to 5V for driving to stay on the safe side.
3.3V is out of sepcification but I know a lot of people using 3.3V for data driving.
As long as it works ...

Payload:
I don't use MQTT so I can't say much about the exact syntax.
The example you gave is exactly the way the neopixel is driven.
I'm using these LEDs as a status control, just sending a
Code: Select all
<device> 3,100,0,0
<device> is the device name you give to the neopixel task in the devices tab in ESPEasy.
Regards
Shardan
Shardan
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: NeoPixel with ESPEasy and Node-RED
Hi Shardan,
Thanks for your input.
I've constructed a two-transistor voltage-up level-shifter (ready for when my NeoPixel strips arrive from China).
Looking at the creative things other people have done with the strips means I'll have a lot of fun when they arrive.
Cheers from David
Thanks for your input.
I've constructed a two-transistor voltage-up level-shifter (ready for when my NeoPixel strips arrive from China).
Looking at the creative things other people have done with the strips means I'll have a lot of fun when they arrive.
Cheers from David
Re: NeoPixel with ESPEasy and Node-RED
Happy to help 
But why 2 transistors for a level shifter if you can do with one?
https://letscontrolit.com/wiki/index.ph ... _Converter
In that wiki you'll find described this circuit:
https://letscontrolit.com/wiki/index.ph ... Inside.jpg
It's a bidirectional level shifter just with a FET and two resistors.
The 2N7002 is a SMD type and a bit unhandy if you just solder parts together without PCB.
You can use a 2N7000 instead, with is the same transistor in a standard wired housing.
Please keep in mind that the 2N7000 has another pinout!

But why 2 transistors for a level shifter if you can do with one?
https://letscontrolit.com/wiki/index.ph ... _Converter
In that wiki you'll find described this circuit:
https://letscontrolit.com/wiki/index.ph ... Inside.jpg
It's a bidirectional level shifter just with a FET and two resistors.
The 2N7002 is a SMD type and a bit unhandy if you just solder parts together without PCB.
You can use a 2N7000 instead, with is the same transistor in a standard wired housing.
Please keep in mind that the 2N7000 has another pinout!
Regards
Shardan
Shardan
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: NeoPixel with ESPEasy and Node-RED
Dead simple answer to that question.
I had some BC547 transistors in my scrap box (and couldn't wait to build the circuit) !!!
I've seen some of the "integrated" devices you listed in your email and will order some (including some 2N7000) today.
Thanks again for all your "inputs".
Regards, David
PS: I've ordered some 2N7000 FETs this afternoon so should be able to build a better circuit at the weekend.
I had some BC547 transistors in my scrap box (and couldn't wait to build the circuit) !!!
I've seen some of the "integrated" devices you listed in your email and will order some (including some 2N7000) today.
Thanks again for all your "inputs".
Regards, David
PS: I've ordered some 2N7000 FETs this afternoon so should be able to build a better circuit at the weekend.
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: NeoPixel with ESPEasy and Node-RED
Just received some strips of NeoPixels.
Having trouble "talking" to them.
When I send a MQTT command all the LEDs comes on together showing "white".
When I send a color command sometimes the correct LEDs fires, other times a random LED with a random color.
It seems like a timing issue???
I'm using the very latest version of ESP Easy mega-20180910
Any advice/help/suggestions would be appreciated.
Having trouble "talking" to them.
When I send a MQTT command all the LEDs comes on together showing "white".
When I send a color command sometimes the correct LEDs fires, other times a random LED with a random color.
It seems like a timing issue???
I'm using the very latest version of ESP Easy mega-20180910
Any advice/help/suggestions would be appreciated.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: NeoPixel with ESPEasy and Node-RED
You should try the 180908 version and see if the same is happening.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: NeoPixel with ESPEasy and Node-RED
Reflashed with 180908 - same effect.
When I send a command ALL the LEDs come on White.
Next time I send exactly the same command a single LED comes - sometimes the correct one, other times sort of random colors !!!
I'm using a 2N7000 to level shift the data line (as per the diagram on the wiki).
This circuit performs a zero degree phase of the data - I assume that is the correct requirement??
I'm running the 5V for the NeoPixel strip off of the 5V line on the Wemos D1 Mini board.
I've put a couple of 220uF capacitors on the 3V3 line as I thought there might be a power "dip" when the LEDs turn ON.
When I send a command ALL the LEDs come on White.
Next time I send exactly the same command a single LED comes - sometimes the correct one, other times sort of random colors !!!
I'm using a 2N7000 to level shift the data line (as per the diagram on the wiki).
This circuit performs a zero degree phase of the data - I assume that is the correct requirement??
I'm running the 5V for the NeoPixel strip off of the 5V line on the Wemos D1 Mini board.
I've put a couple of 220uF capacitors on the 3V3 line as I thought there might be a power "dip" when the LEDs turn ON.
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: NeoPixel with ESPEasy and Node-RED
Right - bit of an update on progress.
Eventually discovered I was using the setting for RGBW in the Device Tab - my NeoPixel strip was RGB - oops!!
I removed the level shifter for the Data Line and connected the NeoPixel strip's Din to D6 on my Wemos D1 Mini via a 270R resistor.
Now everything works - yippppppppeeeee
I re-flashed the Wemos with 20180910 and can confirm it works fine.
I need to go back and determine what's wrong with my 2N7000 level shifter.
I'm using MQTT in Node-RED to send commands to the NeoPixel strip via WeMos D1 Mini.
I think I'm going to have a lot of fun exploring what "one" can do with these strips.
Cheers from David
Eventually discovered I was using the setting for RGBW in the Device Tab - my NeoPixel strip was RGB - oops!!
I removed the level shifter for the Data Line and connected the NeoPixel strip's Din to D6 on my Wemos D1 Mini via a 270R resistor.
Now everything works - yippppppppeeeee
I re-flashed the Wemos with 20180910 and can confirm it works fine.
I need to go back and determine what's wrong with my 2N7000 level shifter.
I'm using MQTT in Node-RED to send commands to the NeoPixel strip via WeMos D1 Mini.
I think I'm going to have a lot of fun exploring what "one" can do with these strips.
Cheers from David
Re: NeoPixel with ESPEasy and Node-RED
can you tell me what you did in node red i am trying to do the same but can't control the ESPEasy form node red
thanks for your support
thanks for your support
Who is online
Users browsing this forum: No registered users and 32 guests