cancel
Showing results for 
Search instead for 
Did you mean: 

LDR example

axelsaff
Associate II
Posted on February 25, 2014 at 20:36

Hello,i'm a beginner in STM32 can someone give me an example of how to use the LDR with STM32F1.

6 REPLIES 6
Posted on February 25, 2014 at 20:53

What is LDR?

JW
Posted on February 25, 2014 at 21:08

Light Dependent Resistor

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 26, 2014 at 01:13

''i'm a beginner in STM32''

Do you have any experience with any other microcontroller(s)?

Do you understand basic electronics?

''can someone give me an example of how to use the LDR with STM32F1''

Have you looked at the examples included with the Standard Peripheral Library?

Posted on February 26, 2014 at 09:56

> Light Dependent Resistor

Ah thanks. So this is how photoresistors are called these days... :) One learns something new every day.

Quick googling revealed that there is some - as you say - LDR on some of the EVAL boards, e.g. http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259717 , so I guess the accompanying software might contain some examples...

JW

chen
Associate II
Posted on February 26, 2014 at 10:58

Hi

Follow what Jan says. I just wanted to add that you need to study the circuit for the LDR from the demo project, this is NOT just software!

I guess the LDR is being used in a resistor divider.

What are you trying to do? Just detect light/no light OR

Read the amount of light?

The former is quite easy - look up 'threshold'

The latter is a lot harder. You need to understand the LDR characteristics, where the linear region is.

axelsaff
Associate II
Posted on November 24, 2014 at 19:42

Thanks for your replies,i did like you said i had a long time reading the manuals and now i got a working program,thanks again.