Light Sensor and Backlight Control Demo Video

The following video shows the light sensor readings displayed on the left LCD and Henrietta using the readings to adjust the LCD backlight intensity. There is also an oscilloscope to show the pulse width modulation waveform at various ambient light levels.

http://www.element14.com/community/videos/10809/l/the-henrietta-project--light-sensor


Light

The Henrietta Project uses a $3 cadmium sulfide light sensor module to detect incident light levels. This module has an analog output which is connected to an analog-to-digital converter input on the Pioneer Kit. The signal is simply converted to a percentage of full scale by dividing by 41. The 12 bit A/D converter full scale is 4095, so dividing by 41 ensures the result will always be 99 or less.

 

Backlight

The LCD backlight LEDs take about 48 mA, which is too much for a digital output from the PSoC4, so they are driven by a PNP transistor mounted on the back of one of the LCDs. This transistor is in turn driven by a pulse-width-modulated (PWM) output from the PSoC4.

PWM is very easy to set up in PSoC Creator - these are the relevant screenshots.

BLPWM1.png

BLclk.png

     PWMBL.png

 

 

Conclusions

Many commercial displays control backlight intensity based on ambient light levels, whether to improve power consumption, reduce eye strain, or simply to make the display adequately visible. This capability is easy to implement with the PSoC4 and it adds a professional feature to the Henrietta project.

 

Next Steps

I expect my next update to cover the GPS clock in more detail.

 

For more info on the Henrietta Project, which is entered in the Smarter Life Challenge, check these logs:

http://www.element14.com/community/videos/10631/l/smarter-life-challenge--the-henrietta-project-intro

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/15/smarter-life-challenge--the-henrietta-project

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/17/smarter-life-challenge--the-henrietta-project--touch-screen-subsystem

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/23/smarter-life-challenge--the-henrietta-project--personality-infusion

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/29/smarter-life-challenge--the-henrietta-project--wire-wrap-versus-jumpers

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/01/smarter-life-challenge--the-henrietta-project--bluetooth-operation

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/02/smarter-life-challenge--the-henrietta-project--furnace-interface