Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Programmierbarer WS2812B LED-Strip Controller

  1. #1
    Junior Member
    Join Date
    Jun 2022
    Posts
    4

    Programmierbarer WS2812B LED-Strip Controller

    Hier mal ein programmierbarer LED-Controller für die WS2812B Strips.
    Umgesetzt mit dem Teensy 4.1 und einem Nextion-Display.

    Ist zwar momentan noch recht wust aufgebaut aber tut was er soll.

    Der eigentliche Controller für die LED-Strips
    Click image for larger version. 

Name:	LED-Strip-Controller.jpg 
Views:	10 
Size:	116.2 KB 
ID:	28546

    Gesteuert wird das ganze per Funkfernbedienung mit einem Nextion-Display
    Muss halt alles noch schön verpackt werden damit es handlich wird :-)
    Click image for larger version. 

Name:	Funkfernbedienung2.jpg 
Views:	6 
Size:	98.3 KB 
ID:	28547

    Hier mal ein paar Bilder von der Bedienoberfläche
    Click image for larger version. 

Name:	MainScreen.jpg 
Views:	3 
Size:	146.6 KB 
ID:	28548

    5 Effektprogramme können auf die Schnellwahltasten im Hauptbildschirm gelegt werden.
    Click image for larger version. 

Name:	Schnellwahl.jpg 
Views:	1 
Size:	157.6 KB 
ID:	28553

    Verschiedenste Einstellungsmöglichkeiten
    Click image for larger version. 

Name:	LED-Strip.jpg 
Views:	1 
Size:	112.8 KB 
ID:	28549

    Click image for larger version. 

Name:	DisplaySet.jpg 
Views:	1 
Size:	117.2 KB 
ID:	28550

    Click image for larger version. 

Name:	Clock.jpg 
Views:	0 
Size:	117.5 KB 
ID:	28551

    Click image for larger version. 

Name:	Settings1.jpg 
Views:	1 
Size:	146.4 KB 
ID:	28552

    Click image for larger version. 

Name:	Settings2.jpg 
Views:	3 
Size:	134.3 KB 
ID:	28554

    Sowie der eigentliche Effekteditor mit dem eigene Programme geschrieben werden können
    Click image for larger version. 

Name:	Effekteditor.jpg 
Views:	4 
Size:	132.7 KB 
ID:	28555

    mehr Bilder im nächsten Post...
    Last edited by XForce; 06-01-2022 at 12:23 PM.

  2. #2
    Junior Member
    Join Date
    Jun 2022
    Posts
    4
    Die Effekte können nach belieben kombiniert werden
    Click image for larger version. 

Name:	Effekte.jpg 
Views:	0 
Size:	176.6 KB 
ID:	28556

    Jeder Effekt hat noch einige Einstellungsmöglichkeiten
    Click image for larger version. 

Name:	EffektSettings.jpg 
Views:	2 
Size:	158.8 KB 
ID:	28557

    Die Programmierung von Pausen und Schleifen ist natürlich auch möglich.

    Die fertigen Programme können dann auf einer SD-Karte gespeichert werden.
    Click image for larger version. 

Name:	FileManager.jpg 
Views:	1 
Size:	166.8 KB 
ID:	28558

    Info's zum Erstellungsdatum und dem letzten Bearbeitungsdatum werden zu jeder Datei in der FAT gespeichert und lassen sich
    auch am PC in den Dateieigenschaften wiederfinden.
    Click image for larger version. 

Name:	FileInfo.jpg 
Views:	3 
Size:	151.4 KB 
ID:	28559

    Info's zum Akkustand sowie -verbrauch der Fernbedienung können bei Bedarf auch abgefragt werden.
    Click image for larger version. 

Name:	Akkumonitor.jpg 
Views:	3 
Size:	164.1 KB 
ID:	28561

    Als nette Spielerei gibts noch einen VU-Meter Modus.
    Click image for larger version. 

Name:	VU-Meter.jpg 
Views:	2 
Size:	139.1 KB 
ID:	28560

    An den Programmen der Teensy's gibts sicherlich noch einiges zu verbessern. aber das Ganze läuft aktuell stabil und ließe sich
    rein theoretisch per Funk in einem Umkreis von knapp 750m steuern (wer auch immer das in der Entfernung benötigen sollte).

    Zum Verzweifeln sind nur die Libary's die Itead für die Display's hergibt. Entweder war ich da etwas unbedarft, oder die Funktionen sind
    in gewissen Situationen recht langsam und nicht so wirklich zuverlässig, was mich dann dazu veranlasst hatte komplett von den Libary's wegzugehen und eigene Funktionen zur Displayansteuerung zu nutzen.

    Zudem hatte ich zwischenzeitlich das Problem, dass sich nach dem Anschluß einer RTC-Batterie an den Teensy die Timings komischerweise so geändert haben, dass es bei der Funkübertragung Abbrüche gab. Hat man die Batterie wieder getrennt lief alles wieder einwandfrei. Mittlerweile läuft es auch mit angeschlossener RTC-Batterie, warum aber die Fehler aufgetreten sind hat sich mir bisher nicht ganz erschlossen.

    Aktuell hab ich das Teil komplett über Akku laufen, ein Anschluß für ein Netzteil ist aber auch vorhanden.
    Über die Software können LED-Strips mit einer maximalen Länge von 4.000 LED-Pixeln gesteuert werden.

    Falls Interesse an den Schaltplänen und der Teensy- sowie Nextion-Firmware besteht gerne melden.
    Last edited by XForce; 06-01-2022 at 01:40 PM.

  3. #3
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    387
    Quote Originally Posted by XForce View Post
    Hier mal ein programmierbarer LED-Controller für die WS2812B Strips.
    Umgesetzt mit dem Teensy 4.1 und einem Nextion-Display.

    Ist zwar momentan noch recht wust aufgebaut aber tut was er soll.

    Der eigentliche Controller für die LED-Strips
    Click image for larger version. 

Name:	LED-Strip-Controller.jpg 
Views:	10 
Size:	116.2 KB 
ID:	28546

    Gesteuert wird das ganze per Funkfernbedienung mit einem Nextion-Display
    Muss halt alles noch schön verpackt werden damit es handlich wird :-)
    Click image for larger version. 

Name:	Funkfernbedienung2.jpg 
Views:	6 
Size:	98.3 KB 
ID:	28547

    Hier mal ein paar Bilder von der Bedienoberfläche
    Click image for larger version. 

Name:	MainScreen.jpg 
Views:	3 
Size:	146.6 KB 
ID:	28548

    5 Effektprogramme können auf die Schnellwahltasten im Hauptbildschirm gelegt werden.
    Click image for larger version. 

Name:	Schnellwahl.jpg 
Views:	1 
Size:	157.6 KB 
ID:	28553

    Verschiedenste Einstellungsmöglichkeiten
    Click image for larger version. 

Name:	LED-Strip.jpg 
Views:	1 
Size:	112.8 KB 
ID:	28549

    Click image for larger version. 

Name:	DisplaySet.jpg 
Views:	1 
Size:	117.2 KB 
ID:	28550

    Click image for larger version. 

Name:	Clock.jpg 
Views:	0 
Size:	117.5 KB 
ID:	28551

    Click image for larger version. 

Name:	Settings1.jpg 
Views:	1 
Size:	146.4 KB 
ID:	28552

    Click image for larger version. 

Name:	Settings2.jpg 
Views:	3 
Size:	134.3 KB 
ID:	28554

    Sowie der eigentliche Effekteditor mit dem eigene Programme geschrieben werden können
    Click image for larger version. 

Name:	Effekteditor.jpg 
Views:	4 
Size:	132.7 KB 
ID:	28555

    mehr Bilder im nächsten Post...
    Translation:

    Translation types
    Text translation
    Source text

    1,742 / 5,000
    Translation results
    Programmable WS2812B LED strip controller

    Here is a programmable LED controller for the WS2812B strips.
    Implemented with the Teensy 4.1 and a Nextion display.

    It's still a mess at the moment, but does what it's supposed to do.

    The actual controller for the LED strips
    Click image for larger version. Name: LED-Strip-Controller.jpg Views: 2 Size: 116.2 KB ID: 28546

    The whole thing is controlled by radio remote control with a Nextion display
    Everything has to be packed nicely so that it is handy :-)
    Click image for larger version. Name: Radio remote control2.jpg Views: 1 Size: 98.3 KB ID: 28547

    Here are a few pictures of the user interface
    Click image for larger version. Name: MainScreen.jpg Views: 0 Size: 146.6 KB ID: 28548

    5 effect programs can be assigned to the shortcut keys on the main screen.
    Click image for larger version. Name: Schnellwahl.jpg Views: 0 Size: 157.6 KB ID: 28553

    Various setting options
    Click image for larger version. Name: LED-Strip.jpg Views: 0 Size: 112.8 KB ID: 28549

    Click image for larger version. Name: DisplaySet.jpg Views: 0 Size: 117.2 KB ID: 28550

    Click image for larger version. Name: Clock.jpg Views: 0 Size: 117.5 KB ID: 28551

    Click image for larger version. Name: Settings1.jpg Views: 0 Size: 146.4 KB ID: 28552

    Click image for larger version. Name: Settings2.jpg Views: 0 Size: 134.3 KB ID: 28554

    As well as the actual effects editor with which you can write your own programs
    Click image for larger version. Name: Effect Editor.jpg Views: 0 Size: 132.7 KB ID: 28555

    more pics in the next post...
    More about this source text
    Source text required for additional translation information
    Send feedback
    Side panels

  4. #4
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    387
    Quote Originally Posted by XForce View Post
    Die Effekte können nach belieben kombiniert werden
    Click image for larger version. 

Name:	Effekte.jpg 
Views:	0 
Size:	176.6 KB 
ID:	28556

    Jeder Effekt hat noch einige Einstellungsmöglichkeiten
    Click image for larger version. 

Name:	EffektSettings.jpg 
Views:	2 
Size:	158.8 KB 
ID:	28557

    Die Programmierung von Pausen und Schleifen ist natürlich auch möglich.

    Die fertigen Programme können dann auf einer SD-Karte gespeichert werden.
    Click image for larger version. 

Name:	FileManager.jpg 
Views:	1 
Size:	166.8 KB 
ID:	28558

    Info's zum Erstellungsdatum und dem letzten Bearbeitungsdatum werden zu jeder Datei in der FAT gespeichert und lassen sich
    auch am PC in den Dateieigenschaften wiederfinden.
    Click image for larger version. 

Name:	FileInfo.jpg 
Views:	3 
Size:	151.4 KB 
ID:	28559

    Als nette Spielerei gibts noch einen VU-Meter Modus.
    Click image for larger version. 

Name:	VU-Meter.jpg 
Views:	2 
Size:	139.1 KB 
ID:	28560

    Aktuell hab ich das Teil komplett über Akku laufen, ein Anschluß für ein Netzteil ist aber auch vorhanden.
    Über die Software können LED-Strips mit einer maximalen Länge von 4.000 LED-Pixeln gesteuert werden.

    Falls Interesse an den Schaltplänen und der Teensy- sowie Nextion-Firmware besteht gerne melden.
    Translation:

    Translation types
    Text translation
    Source text
    1,242 / 5,000
    Translation results
    The effects can be combined at will
    Click image for larger version. Name: Effects.jpg Views: 0 Size: 176.6 KB ID: 28556

    Each effect still has some setting options
    Click image for larger version. Name: EffectSettings.jpg Views: 0 Size: 158.8 KB ID: 28557

    The programming of pauses and loops is of course also possible.

    The finished programs can then be stored on an SD card.
    Click image for larger version. Name: FileManager.jpg Views: 1 Size: 166.8 KB ID: 28558

    Information about the creation date and the last editing date is saved for each file in the FAT and can be
    can also be found on the PC in the file properties.
    Click image for larger version. Name: FileInfo.jpg Views: 0 Size: 151.4 KB ID: 28559

    As a nice gimmick there is also a VU meter mode.
    Click image for larger version. Name: VU-Meter.jpg Views: 0 Size: 139.1 KB ID: 28560

    Currently I have the part running completely on battery, but there is also a connection for a power supply unit.
    LED strips with a maximum length of 4,000 LED pixels can be controlled via the software.

    If you are interested in the circuit diagrams or the Teensy and Nextion firmware, please let me know.
    More about this source text
    Source text required for additional translation information
    Send feedback
    Side panels

  5. #5
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    387
    @XForce: very nice !!

    Mark J Culross
    KD5RXT

  6. #6
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    758
    To despair are only the libaries that Itead gives for the displays. Either I was a bit inexperienced, or the functions are
    quite slow and not really reliable in certain situations, which then led me to completely move away from the libaries and use my own functions for display control.
    I too am using the Nextion display and wrote my own Library. I had heard bad things about the Itead library and in any case I prefer to know what is going on in my system so I wrote my own library.
    Have a look here and here. Not that I am suggesting that mine is better than yours, just that I might have done something different to you and it might give you a few ideas.
    Regards
    Bob Bridges

  7. #7
    Junior Member
    Join Date
    Jun 2022
    Posts
    4

    Nextion Library

    Quote Originally Posted by BriComp View Post
    I too am using the Nextion display and wrote my own Library. I had heard bad things about the Itead library and in any case I prefer to know what is going on in my system so I wrote my own library.
    Have a look here and here. Not that I am suggesting that mine is better than yours, just that I might have done something different to you and it might give you a few ideas.
    Regards
    Bob Bridges
    From my experience the only possible way to get a well function communication with the Display is to use something else instead the out of the box librarys from Itead. If I will have some more time I will study your Library in every detail. The first look at it was a very fine programmed library.
    I can say it's definitly much more structured than mine.
    But the LED Controller was also my third project with Arduino/Teensy because I began microcontroller programming just a year ago ;-)

    But I wonder that you make more communication with the Display in use of numeric values because I have some problems with it. Generaly everything works but only the reading of numeric values from Display components makes some problems. I get the correct numeric value returned but the reading process needs much more time than the reading of text values so if I first make use of numeric values for the menu options of the LED-Controller it needs some seconds between the Save-Button press and the confirmation that everything was saved. With the use of text values I have
    no noticable delay in reading and saving the values.

    This is why I was very excited in your library how you solve this problem.

    Many thanks in advance.

  8. #8
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    758
    Hi XForce, thanks for those kind words.
    As far as numbers are concerned, I see very little delay (about 5ms).
    What numbers are you returning from the Nextion?
    Perhaps you could give a snippet of your Nextion code.
    For instance when one of the Dual-state buttons is pressed I have this Nextion code.
    Code:
      swResult=0x0600+page0.Sw6.val
      get swResult
    The 0sx600 indicates which switch was pressed and obviously page0.Sw6.val the value.
    So I see 0x601 or 0x600 as a returned value.
    All my switches work the same returning values in the range 0x000 or 0x001 to 0x600 or 0x601.
    I don't use "Send Component Id as it does not send the State of the Dual-State button, only that it is pressed or not.
    Given that it is a press-on, press-off type of component the lack of return it's value is a deficiency in the Nextion.

  9. #9
    Junior Member
    Join Date
    Jun 2022
    Posts
    4
    That method you described is a really good one I didn't think about before. I have to try this one instead of what I do at the moment.

    In past when I tryed to read numeric values the Display needs much more than approximately 5ms on top. First of all I read out direct the "val"-State of dual state buttons for example. Later I tryed to let the Nextion first write the button-value into a numeric variable and then read out the variable from Arduino/Teensy side. Both methods ends in the same issue with the unperformant delays. When I convert the numeric value over "covx" in text variable and read out this it's much faster although the Nextion has to do a little more to convert the value before I think. The last method is what I use at the moment if I want to read out a number. But the delays only happend while reading numbers. Writing a numeric value is as fast as read/write text values.

    I had also the issue in past that every time after reset and newstart of the Display only the first try to read a number failed completely (Display return something but a completely different number) and after that every next try everything works correctly with exactly the same command line.
    I absolutely didn't know why.

    There is another thing that I'm wondering about. The serial communication of the Nextion doesn't support umlauts so I replace them with the ascii char code before send the text to the Display. Is it right that Arduino's doesn't support the function "replace". When I try to compile exactly the same code it run's when compiled for Teensy-Boards but when I chose a Arduino board the compiling failed. Do you know any other method to display umlauts in Text which is send from Arduino's to Nextion Display?

  10. #10
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    758
    After "Reset" Nextion returns the following:-
    |-------- Start up message -------| |- Ready Message -|
    0x00 0x00 0x00 0xFF 0xFF 0xFF 0x88 0xFF 0xFF 0xFF
    You have to handle all of that data before getting any other values.
    Have a look at my code for
    Code:
    Nextion::reset(uint32_t br){
    in my Nextion.cpp

  11. #11
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    758
    ...further to the above it might be that you are not reading all the reset data coming from the Nextion and the characters left in the serial buffer are corrupting the following data. Of course as soon as those corrupt values have cleared everything works ok.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •