Light sensor to pwm output #256

Open
opened 2019-09-19 16:42:33 +01:00 by huskyte · 1 comment
huskyte commented 2019-09-19 16:42:33 +01:00 (Migrated from github.com)

A constant lightning of an enclosure would probably be wanted by some users to record proper timelapses and ensure a real time camera to deliver constant picture quality. A light sensor, like an BH1750 or similar, could be deployed, but is currently not within the hardware database. Additionally, pwm pins cannot be controlled in such an extent that this would be doable.

A light sensor would need to be implemented as input device, such as a BH1750. The readings would be in LUX.
A PWM pin as output would need to be programmed with a counterproportional bevaviour. Hence, the brighter the light sensor reading the less pwm duty cycles. Most preferable with a hysteresis. Some choosable mathematical function would be prefered with some parameters to set freely (see for example http://esp8266-projects.blogspot.com/2016/07/ac-pwm-dimmer-with-light-sensor.html): min Lux/pwm 0, max Lux/pwm 100, hysteresis, steps, linear/log behaviour, time for adjustment step. A stepwise algorithm would then bring the light level to the required amount (too dark, increase pwm cycle by x, wait, check again. if within hysteresis do nothing for a defined duration) .

Additionally, (but I can't think of any practical use right now) a check mark to invert the functionality.

A constant lightning of an enclosure would probably be wanted by some users to record proper timelapses and ensure a real time camera to deliver constant picture quality. A light sensor, like an BH1750 or similar, could be deployed, but is currently not within the hardware database. Additionally, pwm pins cannot be controlled in such an extent that this would be doable. A light sensor would need to be implemented as input device, such as a BH1750. The readings would be in LUX. A PWM pin as output would need to be programmed with a counterproportional bevaviour. Hence, the brighter the light sensor reading the less pwm duty cycles. Most preferable with a hysteresis. Some choosable mathematical function would be prefered with some parameters to set freely (see for example http://esp8266-projects.blogspot.com/2016/07/ac-pwm-dimmer-with-light-sensor.html): min Lux/pwm 0, max Lux/pwm 100, hysteresis, steps, linear/log behaviour, time for adjustment step. A stepwise algorithm would then bring the light level to the required amount (too dark, increase pwm cycle by x, wait, check again. if within hysteresis do nothing for a defined duration) . Additionally, (but I can't think of any practical use right now) a check mark to invert the functionality.
Sembazuru commented 2020-01-28 06:52:26 +00:00 (Migrated from github.com)

Inverting the functionality might be useful if the PWM output is controlling an inverting driver.

Inverting the functionality might be useful if the PWM output is controlling an inverting driver.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#256