Skip to content

fuxxociety/esphome-SM2235

 
 

Repository files navigation

SM2235EGH 5-Channel Constant-Current LED driver. Was integrated in a 'LightingInside' bulb purchased from Amazon, but is most likely present in other bulbs.

This is NOT a bulb you can easily replace with an ESP8266. A custom circuit board or hand wiring will need to be done, as well as modification of the LED disc itself.

IMPORTANT

--> make sure to copy both SM2235.yaml and SM2235.h to the 'esphome' configuration subdirectory <--

image

SM2235EGH based tuya lamps support for ESPHome

Project based off of the excellent preliminary work done by dbuezas. image

dynamic range mode

The SM2235EGH chip only allows 1023 brightness levels per channel, what makes it as bad as any other lamp at having good colors at dim levels and going very dim at all. To improve upon that, this custom component dynamically changes the maximum current settings. As an example, my particular lamp used 26mA as a maximum, making the minimum possible level equal to 26mA/1024=0.025mA, which is also its resolution. Using dynamic range, when the lamp is asked to go dim, the esp will tell the SM2235EGH chip to set the maximum current to 1mA instead, pushing the minimum to 1mA/1024=0.001mA, so 26 times less power and 26 times the color resolution at dim levels. This is not how this chip was designed to be used, so to avoid flickering it was necessary to change the max level continuously and in small increments instead of just using one threshold. As is, it is super smooth.

You can test how static (intended) vs dynamic range (my hack) perform by using the lamp effects in HA's UI. The difference is massive.

Links:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%