| Electronic Components Datasheet Search |
|
AN4112 Datasheet(PDF) 14 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4112 Datasheet(HTML) 14 Page - STMicroelectronics |
|
14 / 17 page ![]() Brightness control using a light dependent resistor (LDR) AN4112 14/17 Doc ID 023195 Rev 1 6 Brightness control using a light dependent resistor (LDR) In some battery operated applications, the microcontroller needs to be powered if the environment is lit; otherwise, it must be kept powered off. For such applications, a light dependent resistor (LDR), whose resistance depends on light intensity, is useful to control the microcontroller state. Using an LDR sensor, the microcontroller can switch to/from low power mode depending on the voltage provided by the LDR resistor. Figure 11 shows how to connect an LDR resistor to an STM32F05xx device. The COMP2 non-inverting input can be connected to an LDR resistor through a voltage divider (VIN). The threshold can be set externally to the PA2 or PA5 pin or set internally to VREFINT, 3/4 VREFINT, 1/2 VREFINT, or 1/4 VREFINT. The COMP2 output (COMP2OUT) can be internally connected to EXTI line 22 which, when configured to detect both rising and falling edges on COMP2OUT, can be used as an interrupt source to switch to/from low power mode. Figure 11. Connecting an LDR resistor to an STM32F05xx device 1. PA3 or PA1 can be used as COMP2 non-inverting input. Thus, VIN can be connected to PA3 or PA1. The voltage VIN can be computed using Equation 5. Equation 5 As the LDR resistance decreases with increasing light intensity, the voltage VIN decreases as more light shines on the LDR. MS30286V1 VREFINT ¼VREFINT ½VREFINT ¾VREFINT Other possibilities PA2/PA5 PA3/PA1 (1) COMP2 + - EXTI line 22 COMP2OUT Light dependent resistor (LDR) VDD Resistor (R) VIN STM32F05xx V IN LDR LDR R + () ---------------------------- V DD × = |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |