This is to connect a LED-Lamp (with up to 16 channels and 4096 steps resolution per channel) to a mqtt server
GPL-3.0 License
Table of Contents generated with DocToc
This thing is to connect a LED-Lamp (with up to 16 channels and 4096 steps resolution per channel) to a mqtt server
You can find the complete schematic (and PCB) here: https://easyeda.com/zebrajaeger/led_dimmer_v2
I tried some of these configurable projects (EasyESP, Tasmota, ESPHome, ...) but every solution of this list has big disadvantages like crashes, very slow wifi connection, no way to store the light brightnes values through power-cycles. At the end of this frustrating way I decided to write a software that matches (hopefully) all my requirements
Install platformio as described here: https://platformio.org/install/ide?install=vscode.
On the PIO Home tab within Visual Studio Code, go to the left toolbar and choose 'Platforms'
Install 'Expressif 32' platform
Clone this project into a directory of your choice or download it as a zip-file from here: https://github.com/zebrajaeger/esp32-led-dimmer/archive/master.zip (same link as 'Clone or download' -> 'Download ZIP').
In the PIO Home tab choode 'Open Project' and choose the folder with the project files.
Edit the platformio.ini and change the line
upload_port = COM4
to the serial port where youre device is connected to.
Click on the 'Alien head' icon on the left toolbar. the 'Project Tasks' List should be visible now.
If you don't have, change the platformio.ini file and change the 'monitor_port' line with your device port. Connect with the PlatformIO Serial Monitor (the plug icon at the bottom toolbar).
Because there are no WiFI credentials set, after a timeout of around 30s the device will spawn a accespoint you connect to with your Notebook or Smartphone. The name of the SSID starts with 'ESP'
Olimex JTAG debugger
Change in
<userhome>/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/board/esp-wroom-32.cfg
the value of adapter_khz to 1MHz (or higher if it works stable):
adapter_khz 1000
We have two types of storage for data. the first one is the flash which have a livetime of 100.000 erase/program cycles and is used for rarely written data:
The second is a small FRAM, the the MB85RC16 (I²C, 3.3V) (https://www.fujitsu.com/uk/Images/MB85RC16.pdf) which can be written 10^12 times per Byte. It is used to store the brightness values which may be changed very often.
// TODO Only as code today, sorry
Dictionary:
There are three topics:
{
"device": {
"name": "esp32-30aea485fe54",
"ip": "192.168.178.60"
},
"light": {
"frequency": 1500,
"data": {
"channel": 0,
"value": [50,500,50,500,50,500,50,500,50,500,50,500,50,500,50,500]
}
}
}
{
"frequency": 1500,
"data": {
"channel": 0,
"value": [50,500,50,500,50,500,50,500,50,500,50,500,50,500,50,500]
}
}
{
"frequency": 1500,
"data": {
"all"
"all": [0,500,4095]
}
}
I made the scheamtic and pcb with EASYEDA from JLPCB. A public link to this project is here: https://easyeda.com/zebrajaeger/led_dimmer_v2
For Development:
ESP32 devkit v1
Every N-Channel Mosfet that is sure fully on @ 2.5V gate voltage
I use:
Requirements:
I use:
For development: PCA9685 module from ebay:
I use 24V LED so some DC/DC modules from ebay/aliexpress are fine.
I decidet to use a high efficient transformer from Enertex (http://www.enertex.de/e-led-powersupply.html) which is explicit designed for PWM applications. The only disadvantage is the non waterproof design.
I use high CRI 24V LED stripes from https://shop.led-studien.de/ with aluminium profiles as case and heatsink.
For details see the hardware section.
For source see here: https://easyeda.com/zebrajaeger/led_dimmer_v2
Bottom, Top
Some connectors are not soldered because I don't need them.
No critical bugs found. Everything works as expected!