Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN3248 Datasheet(PDF) 14 Page - STMicroelectronics

Part # AN3248
Description  Using STM32L1 analog comparators in application cases
PDF  17 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3248 Datasheet(HTML) 14 Page - STMicroelectronics

Back Button AN3248 Datasheet HTML 9Page - STMicroelectronics AN3248 Datasheet HTML 10Page - STMicroelectronics AN3248 Datasheet HTML 11Page - STMicroelectronics AN3248 Datasheet HTML 12Page - STMicroelectronics AN3248 Datasheet HTML 13Page - STMicroelectronics AN3248 Datasheet HTML 14Page - STMicroelectronics AN3248 Datasheet HTML 15Page - STMicroelectronics AN3248 Datasheet HTML 16Page - STMicroelectronics AN3248 Datasheet HTML 17Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 14 / 17 page
background image
Brightness control using a light dependent resistor (LDR)
AN3248
14/17
Doc ID 17758 Rev 3
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 12 shows how
to connect an LDR resistor to an STM32L1 device. COMP2 non-inverting input can be
connected to an LDR resistor through a voltage divider (VIN). The threshold can be set
externally to PB3 or set internally to VREFINT, 3/4 VREFINT, 1/2 VREFINT, or 1/4 VREFINT. The
COMP2 output (CMP2OUT) can be internally connected to EXTI line 22 which, when
configured to detect both rising and falling edges on CMP2OUT, can be used as an interrupt
source to switch to/from Low power mode.
Figure 12.
Connecting an LDR resistor to an STM32L1 device
1.
PB4 or PB5 can be used as COMP2 non-inverting input. Thus, VIN can be connected to PB4 or PB5.
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.
VDD
COMP2
Resistor (R)
VIN
Other possibilities
V
REFINT
PB3
¾ V
REFINT
½ V
REFINT
¼ V
REFINT
PB4/PB5 (1)
+
-
EXTI line 22
ai18728
CMP2OUT
Light dependent
resistor (LDR)
STM32L1 device
V
IN
LDR
LDR
R
+
()
----------------------------
V
DD
×
=



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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