Skip to main content
rouaissi_ridha
Associate
May 25, 2013
Question

LDR-Light Dependent Resistor and STM32Discovery

  • May 25, 2013
  • 4 replies
  • 1455 views
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
    This topic has been closed for replies.

    4 replies

    emalund
    Associate III
    May 26, 2013
    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
    Super User
    May 27, 2013
    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

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    May 27, 2013
    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...
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Amel NASRI
    ST Technical Moderator
    June 28, 2013
    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 "Best Answer" on the reply which solved your issue or answered your question.