ESP32 with FreeRTOS driving some Christmas LED strings garlands
ESP32 animate 24V= LED system garlands with flashing and variable brightness (13 different parameters) with one ESP32 and FreeRTOS multi-tasking.
ESP32 code uses multi-tasking of FreeRTOS. See Diagram file.
After my first project with one Arduino controlling one LED garland, following by a second project multi-tasking with FreeRTOS on one Arduino (nano) to drive up to 3 garlands with asynchronous tasks using 13 different set of parameters ; here ESP32 drives multiple LED strings garlands asynchronously too.
Each task select randomly 1 parameter set among the 13 sets and drive its garland with PWM output, and a LosFET module driving the LED garland with an interface driving module.
Each garland is 24V= LEDs.
In this project, ESP32 supports four tasks. So it drives 4 LED garlands. But more PWM outputs are available for more garlands.
The PWM ESP32 outputs are on pins 16, 17, 18, 19.
The basis is a 240V~ transformer to 24V ~ and a rectifier for =24V, multiple coloured LED 24V= garland.
The components are as follows:
- 1 ESP32 board,
- 1 power supply module for the ESP32 board from 24V= (Internet shop),
- 4 interface drivers for the MosFET modules driven by the ESP32 PWM outputs,
- 4 MosFET modules for garland control (Internet far eastern shop),
- 1 printed circuit board with holes for mounting,
- several connectors for garlands & input power,
- 1 plastic box to encapsulate the project,
- 4 x 24V= LED garlands,
- 1 transformer & rectifier 240V~/24V=.coming with garlands.
For information, I found 24V= LED garlands at Lumitronix web site, with transformer and rectifier.
I choose to set 13 different control light parameters in two sets which may be extended:
- one set to control ON/OFF light with different ON and OFF time;
- one set to control variable PWM light with different up and down time.
The code is developed with IDE Arduino platform.
Each parameters set is selected randomly (ESP32 random is quite random as I saw in my tests). And for PWM control, I choose 32 steps for ON and OFF variations in sine wave because eye light perception is not linear.
Each of the 4 tasks is independent and asynchronous, so light animation is superb.
Each task (FreeRTOS name) drives an ESP32 PWM output.
The code listing is in zip file.
Setup defines parameters setting for each PWM outpout.
The task is defined one time before Setup code and gets in the given parameter the PWM output number in Setup function.
The Setup creates then the four tasks with each output in given parameter.
The scheduler is automatically started on ESP32.
The Loop is not used in this project, so discarded.
Have you any comment or remark ?
After my first project with one Arduino controlling one LED garland, following by a second project multi-tasking with FreeRTOS on one Arduino (nano) to drive up to 3 garlands with asynchronous tasks using 13 different set of parameters ; here ESP32 drives multiple LED strings garlands asynchronously too.
Each task select randomly 1 parameter set among the 13 sets and drive its garland with PWM output, and a LosFET module driving the LED garland with an interface driving module.
Each garland is 24V= LEDs.
In this project, ESP32 supports four tasks. So it drives 4 LED garlands. But more PWM outputs are available for more garlands.
The PWM ESP32 outputs are on pins 16, 17, 18, 19.
The basis is a 240V~ transformer to 24V ~ and a rectifier for =24V, multiple coloured LED 24V= garland.
The components are as follows:
- 1 ESP32 board,
- 1 power supply module for the ESP32 board from 24V= (Internet shop),
- 4 interface drivers for the MosFET modules driven by the ESP32 PWM outputs,
- 4 MosFET modules for garland control (Internet far eastern shop),
- 1 printed circuit board with holes for mounting,
- several connectors for garlands & input power,
- 1 plastic box to encapsulate the project,
- 4 x 24V= LED garlands,
- 1 transformer & rectifier 240V~/24V=.coming with garlands.
For information, I found 24V= LED garlands at Lumitronix web site, with transformer and rectifier.
I choose to set 13 different control light parameters in two sets which may be extended:
- one set to control ON/OFF light with different ON and OFF time;
- one set to control variable PWM light with different up and down time.
The code is developed with IDE Arduino platform.
Each parameters set is selected randomly (ESP32 random is quite random as I saw in my tests). And for PWM control, I choose 32 steps for ON and OFF variations in sine wave because eye light perception is not linear.
Each of the 4 tasks is independent and asynchronous, so light animation is superb.
Each task (FreeRTOS name) drives an ESP32 PWM output.
The code listing is in zip file.
Setup defines parameters setting for each PWM outpout.
The task is defined one time before Setup code and gets in the given parameter the PWM output number in Setup function.
The Setup creates then the four tasks with each output in given parameter.
The scheduler is automatically started on ESP32.
The Loop is not used in this project, so discarded.
Have you any comment or remark ?
Diskussion (1 Kommentar)