Fully fledged Staircase implementation

Usermod now merged, see top of this thread…

1 Like

Awesome project , truly amazing.
Did you get the IP65 or IP67 ones, assuming you got the 60 LED’s/meter ?
And a 5m strip can just be cut into 1m parts right ?
I have the same revolving staircase whereas most steps are 1m some are a little larger so some extra leds on those larger steps aren’t an issue ?
these LEDS are dimmable as well , for night stairs ?

@Tyrian81 I used indeed WS2812B in IP67 seal. This is not needed for an indoor stairs and it might even be easier to glue the strips without the silicon housing. To me however, the advantage was that the data output line at Tthe “other” end of the step could be drawn back through this silicon tubing which enabled me to only drill one small hole to the back of the stairs with all the cables going through. Indeed I use 60 LEDs per meter and the strips can be cut wherever you like. In my example, each step has a different length, so just cut them to the desired length and note the number of LED’s per step carefully, otherwise it is counting after having them mounted. The LED count per step is then entered into WLED segments. LED’s are dimmable…

Hello pa1okz. First of all, asume job! Very nice. Because i have almost the same install (14 stairs and underneath evey stair a LED strip) i want to make use of your usermod.

Meanwhile i also received an ESP32. I followed your instruction to implement the staircase usermod and so far so good. WLED also starts and i’am able to connect to it. Only the LEDS are not responding to any effect (de datacable is connected to D2) but also when i click at PEEK in WLED, non of the effects are showing any output (the bar stays black). Do you have any idea what i’am doing wrong and is it otherwise possible that you share yours .bin file?

Thanks in advance

@madradrakie Did you follow the exact instructions?

Pitfalls are:

  • sensors not configured in the right manner, the stairs should light up with detection, if not at all, the problem is to be found there probably
  • if there is light, but not step by stwp: did you configure segments acc instructions? Don’t forget to save them in a preset.

@pa1okz

i followed the instructions from the github page.
The steps i took:

  1. I downloaded the WLED dev zip file and opened it in VisualStudio
  2. I added at the top of the file the following:

  1. At the bottom i added:

  1. in usermods i changed the pin nummering:

  1. I compiled the file and used default_envs = wemos_shield_esp32

  2. I flashed the esp32 and logged in to WLED


  1. I attached the led strip to pin D2 but the lights are not doing anything. Also when i press at peek normally you see the effect in the bar underneath the buttons butt nothing appears. No animation is displayed.

That is the point were i am stuck…

@madradrakie The steps you followed are okay. I see you have defined pin 25 and 26 for PIR sensor use. Of course you can easily check whether the selected pins work fine by connecting them to the 3.3V pin, pulling them up. This should either trigger a walk-up or walk-down light effect.

  • If this DOES trigger lights to lit-up, then obviously something is wrong with the way you have connected the PIR sensors.
  • If this DOESN’T trigger lights to lit-up, then the pins may not work or something else is wrong. In this last case I would test one of the following things:
  1. You can turn the usermod off by sending a HTTP POST request to WLED, for example by means of CURL: curl -X POST -H “Content-Type: application/json” -d {“staircase”:{“enabled”:false}} xxx.xxx.xxx.xxx/json/state < enter your local WLED IP address
  2. Alternatively ee-flash the ESP with a standard distribution to see if the LED’s lit in that case. I believe however this is last resort: as you have the information window showing that the usermod is functional, it should work flawless.

Hope that helps you to isolate the problem.

Edit: I see in your information box that the current DEV branch is on V12, I have to check whether that may have introduced an anomaly, which is not expected. The staircase usermod has been developed on the master branche. Will keep you posted on that as soon as I have fount time.

Great and thanks for sharing your hard work, can u provide us the hardware shopping list? :heart_eyes:

@Sebastiaan72 I suppose the shopping list should simply be derivable from my description; it is dependant from your situation / stairs. Fundamentally spoken:

  • addressable LED strip in the needed length, e.g. WS2812B
  • An ESP32 board, e.g. ESP32 NodeMCU or so, most will do
  • Sufficient PSU, e.g. 5V 20A
  • Wires of choice
  • Mounting material.
1 Like

Thx for sharing, what type of pir did you use and what type of ultrasonics did you use?

@Sebastiaan72 I suggest you read the docs…

1 Like

Hello madradrakie, the steps you followed seem correct. The Staircase usermod has been developed on de dev branch of WLED. I have just now checked, if you downloaded the latest version of the dev branch, the Animated Staircase should work.

Additional things to check:

  1. To check the sensors: Open the Serial Monitor in PlatformIO (your Visual Studio). When one of the PIR sensors triggers, you should see a “On → Swipe up” or similar message.
  2. To check the led data output: Remove the Animated_Staircase lines from usermods_list.cpp, rebuild WLED and upload that to the ESP. The default implementation of WLED should give you 10 orange LEDs when booting up.

If you have a multimeter, you can check at GPIO25 and GPIO26 that the voltages indeed go from 0 to 5 and back. If both PIR inputs stay high or both stay low, the Animated Staircase will not be triggered.

I hope this helps, cheers,
Rolf

Hi Sebastiaan72, the ultrasonic sensors are HC-SR04, the PIR sensors are SR501, SR602 or compatible (any PIR sensor that prodices a “high” output when it detects movement will work). Please see the readme for information on how to connect them.

1 Like

is it possible to exclude in the code 0 and the last segment. changes here do not help me
for (int i = 0; i < MAX_NUM_SEGMENTS; i++, segments++) looks like i need to change something else

@denver I think you have to be a bit more specific. From what I read, I am unsure whether you talk about particular staircase usermod code, or the general WLED code? What is it you want to achieve?

Hi, I’m talking about the usermod. and the idea is that the first and last steps of the staircase are always highlighted. from the second step to the previous last step would be switched on by PIR sensors.
something like below
---- segment0 is on all the time
**** segment1 on\off
**** segment2 on\off
**** segment3 on\off
---- segment4 is on all the time

@denver I wonder if, over time, this would give you a satisfying result but it will imply a modification to the usermod, this is currently not foreseen as it is likely not a requirement for larger audience…

thanks, i’ve changed the code a bit and added the ability to turn off and on
,if enabled to allow the first and last stage to light up as required (all the time) or if disabled so that -works as default in the usermode

enable/disable

curl -X POST -H “Content-Type: application/json”
-d {“staircase”:{“segment-first-last”:false}}
xxx.xxx.xxx.xxx/json/state

changed a bit void updateSegments()

// this value is used for API and in updateSegments()
// bool flval = true; false or true

if (flval == true){
if (i >= onIndex && i < offIndex ) {
segments->setOption(SEG_OPTION_ON, 1, 1);
} else {
if (i != int(flval) - 1 && i != maxSegmentId -int(flval) +1 ) {
segments->setOption(SEG_OPTION_ON, 0, 1);
}
}
}

if (flval == false){
if (i >= onIndex && i < offIndex ) {
segments->setOption(SEG_OPTION_ON, 1, 1);

  } else {
    segments->setOption(SEG_OPTION_ON, 0, 1);
  }

}

now the next thought is to keep the first and last ones with a minimum brightness (5% or so), and when the sensor is detected, turn on all (include first and last ) with common brightness (let’s say 70%)

1 oooo → OOOO
2 ---- → OOOO
3 ---- → OOOO
4 oooo → OOOO

Good afternoon,

First of all, thank you for the comprehensive report for installing WLED stair lighting.

Unfortunately, I am missing exactly what I need to buy to install these beautiful lights.

13x WS2812B LED’s strips 1 meter each

  • or did you order 3x 5 meters and shortened and soldered the wires yourself ?
  • should i order 5v or 12v and 30/60/144 leds ?
  • should i do regular leds or water resistant ?

13x housing for ledstrip

  • Which one can I use best for that

1x ESP32 | NodeMCU
1x PIR upper step
1x Ultrasonic HC-SR04 lower step
How many meters of AWG14 / 2.5mm^2 cable?
?x How many meters and what thickness of cable for power and ground?
1x power supply

  • which voltage and how many amps should i use.

On the picture with the power supply I see breadboard with the NodeMCU on it, next to it I see three more parts, what are these?

Am I reading correctly that the data cable enters ledstrip 1 and at the end is led back to the beginning of ledstrip 2 and so on?

I also see a serial connection and a network cable, what are these for?

Thank you in advance for your feedback so I can order and install the correct one.

After this I will make a step-by-step plan with pictures to help the next one again.

README. I can’t open the link