NeoPixel with ESPEasy and Node-RED

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

NeoPixel with ESPEasy and Node-RED

#1 Post by dynamicdave » 22 Aug 2018, 17:12

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.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: NeoPixel with ESPEasy and Node-RED

#2 Post by Shardan » 22 Aug 2018, 20:16

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

Code: Select all

<device> 3,100,0,0
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.
Regards
Shardan

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: NeoPixel with ESPEasy and Node-RED

#3 Post by dynamicdave » 23 Aug 2018, 10:23

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

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: NeoPixel with ESPEasy and Node-RED

#4 Post by Shardan » 23 Aug 2018, 10:52

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!
Regards
Shardan

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: NeoPixel with ESPEasy and Node-RED

#5 Post by dynamicdave » 23 Aug 2018, 11:13

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.

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: NeoPixel with ESPEasy and Node-RED

#6 Post by dynamicdave » 10 Sep 2018, 20:41

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.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: NeoPixel with ESPEasy and Node-RED

#7 Post by grovkillen » 10 Sep 2018, 20:50

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 :idea: :idea: :idea:

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: NeoPixel with ESPEasy and Node-RED

#8 Post by dynamicdave » 10 Sep 2018, 20:59

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.

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: NeoPixel with ESPEasy and Node-RED

#9 Post by dynamicdave » 11 Sep 2018, 20:44

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

mhagreis
New user
Posts: 1
Joined: 08 Jan 2023, 17:55

Re: NeoPixel with ESPEasy and Node-RED

#10 Post by mhagreis » 08 Jan 2023, 17:56

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

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests