Project: I am making a Pi powered photo frame with google photos integration.
Object: I have added a pir sensor for auto screen off when no activity is detected and now i am looking to control backlight brightness with output from the Pi's gpio. My backlight control board uses a 363hz frequency and pwm with 3.5 volts to drive and this is perfect for my needs.
Technical information: The current draw from the signal is 20 microamperes. The duty cycle from the monitors control board goes from about 25% at its lowest and then the square wave goes to "full high" 3.5 volts at full brightness. I have been able to replicate this with the pi with software pwm but it has drop-outs and glitches. When using hardware pwm (pigpio, pin BCM24) the backlight can be adjusted far lower than standard and is steady all the way in increments to 100%. The lux sensor I am using outputs a voltage inversely proportional to light in, with high light values are closer to zero volts and low light values output 5 volts at full darkness.
Question: My question is how can I implement a signal input from the lux sensor to be returned on gpio out with varying PWM output for backlighting control. I am a total novice and am not looking for an answer more than a direction to follow. This is a very interesting project for me and I am enjoying learning, although this is a gift for someone soon, I am having a lot of fun figuring this out. I fear without proper training/ guidance I may not be able to do this. Thank you anyone for any information as I have scoured Google for days and cannot seem to find a way to co-relate input voltage on gpio to output variance in pwm. Maybe I am not using the proper search terms. Here is the very very basic code i am using to successfully control my backlight editing the last number from 150-1000 to change brightness. Thank you again!!
Basic code: sudo pigs pfs 24 1000 prs 24 1000 p 24 1000