cancel
Showing results for 
Search instead for 
Did you mean: 

LDR-Light Dependent Resistor and STM32Discovery

rouaissi_ridha
Associate
Posted on May 26, 2013 at 01:24

I want to use a Light Dependent Resistor (LDR) to control a door ( open when it feel light and close it when it's darkness).

Can you help me how can I do this,.

Thanks a lot

#basic-electronics #getting-start #cross-post
4 REPLIES 4
emalund
Associate III
Posted on May 26, 2013 at 15:25

a fixed resistor in series with the LDR between Vref and gnd.  an A/D input connected at the junction.

Erik

Andrew Neil
Evangelist III
Posted on May 27, 2013 at 11:59

''I want to use a Light Dependent Resistor (LDR) to control a door ( open when it feel light and close it when it's darkness)''

 

Why do you need a microcontroller (any microcontroller - let alone an STM32) to do that?

A sinlge transistor should be sufficient; eg,

http://electronicsclub.info/p_lightalarm.htm

''Can you help me how can I do this''

What ''help'', exactly, do you need?

For basic electronics - such as how to use an LDR - try

http://electronicsclub.info/study.htm

For 'C' programming - try

http://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/

For details of the STM32, see its Data Sheet and User Manual - and the many examples provided by ST.

You didn't say which particular ''STM32 Discovery Board'' you are using - there are at least four  different ''STM32 discovery'' boards!

http://www.st.com/stm32f0discovery

http://www.st.com/stm32f3discovery

http://www.st.com/stm32f4discovery

http://www.st.com/stm32l-discovery

Andrew Neil
Evangelist III
Posted on May 27, 2013 at 15:45

So now you have 2 separate threads running on exactly the same question:

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/LDR-Light%20Dependent%20Resistor%20and%20STM32Discovery&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&TopicsView=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/AllItems.aspx&currentviews=19]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Discovery%2fLDR%2dLight%20Dependent%20Resistor%20and%20STM32Discovery&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&TopicsView=https%3A%2F%2Fmy%2Est%2Ecom%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FAllItems%2Easpx&currentviews=19

I hope you're going to keep up with both...
Amel NASRI
ST Employee
Posted on June 28, 2013 at 17:42

Hello,

The duplicated thread will be removed.

It should be better to keep discussion in only one side.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.