Maker Pro
Maker Pro

Help with polarity switching due to light levels

Thesecret20111

Apr 11, 2014
18
Joined
Apr 11, 2014
Messages
18
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
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
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).
 

Thesecret20111

Apr 11, 2014
18
Joined
Apr 11, 2014
Messages
18
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!'
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
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.
 
Top