Connect with us

Help with polarity switching due to light levels

Discussion in 'LEDs and Optoelectronics' started by Thesecret20111, Jun 19, 2014.

Scroll to continue with content
  1. Thesecret20111

    Thesecret20111

    18
    3
    Apr 11, 2014
    Hello guys,

    I'm trying to come up with some circuit ideas that I can use to make a simple robot during the holidays. I've come up with an idea but I'm relatively new to electronics and so I'am unsure if its actually possible to do easily and cheaply.

    Basically I'm wanting to reverse the polarity of a motor depending on which of two light sensor has more light shining on it.

    I haven't yet purchased any light sensor, photo transistor, resistor, ect. I'm just curious as to how easy this would be and what sensors would be the best to use.

    Thanks,
    Thesecret20111
     
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,267
    Nov 28, 2011
    Yes, it's pretty easy. If you use LDRs (light dependent resistors), you can connect them in series across the power supply. The node tap voltage will be at half supply if equal light is falling on both. If more light is falling on the one that connects to VCC, it will pull the centre node up to a higher voltage, and vice versa. You can then feed this voltage into a comparator and use it to switch a relay wired as a reversing switch, or an H-bridge using transistors or MOSFETs.

    LDRs are fine as light sensors. They have a slight delay in responding, especially in low light, but they're easy to use. You should actually put a resistor (e.g. 1k) in series with each one to prevent possible high current from flowing through the series circuit if both are brightly illuminated. You could also use phototransistors or photodiodes but these can't be connected quite so easily.

    You would probably want to improve that design. I imagine it would get into a situation where the motor is constantly alternating direction. You could add a deadband in the control circuit so the motor only runs if one LDR is picking up significantly more light than the other; if they're both picking up roughly the same amount of light, the motor wouldn't run.

    If you want to start experimenting, get a few LDRs (http://www.digikey.com/product-detail/en/PDV-P8103/PDV-P8103-ND/480610) and LM393 dual comparators (http://www.digikey.com/product-detail/en/LM393N/LM393NFS-ND/458695).
     
  3. Thesecret20111

    Thesecret20111

    18
    3
    Apr 11, 2014
    Wow, thanks so much for the speedy reply!
    What you've said make a lot of sense. I'll pick up a few LDRs and comparators and muck around with them these holidays.
    'Let the experimenting begin!'
     
  4. shumifan50

    shumifan50

    548
    56
    Jan 16, 2014
    My immediate instinct would be to use a microcontroller as it means building a very simple circuit using the LDRs and feeding them into the ADC of the microcontroller. You can use the PWM to drive the motor or motors(with suitable drivers). Control is then a simple task of programming the microcontroller, rather than modifying the circuit.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-