Maker Pro
Maker Pro

Light sensor motor control

I am trying to make a device to run a DC motor based on the output from a light sensor. The sensor has an on/off output (12V/0V). It can be set to turn on when it senses light or turn on when it senses dark. I would like the motor to turn off when the sensor detects light but I want to manually restart the motor (regardless of what the sensor outputs) with a momentary on switch. I am using a 12v power supply and the motor is a brushed 12V DC gear motor. It has a rated current of 0.6 amps. It should not be necessary to use a speed control with the motor. The motor would typically run for 2 to 4 seconds and pause for 3 to 6 seconds before restarting. I was planning to power the motor with a MOSFET transistor.

I made a control circuit using a monostable 555 timer. The problem I am having with the circuit is that I cannot restart the motor with the switch if the light sensor is detecting light (output high). It only works if the sensor sees dark (output low). I am not sure how to work around the problem. I would appreciate any help!motor control1.jpg
 
I think I am using it as a latch. I am not using the timer function of the 555 anyhow. I am using the sensor output to turn off the motor and it should stay off until I manually restart it with a switch (producing a negative pulse on the trigger- pin 2).
 
So:
1; On start up: light off = motor on = pin 3 latched high
2: light on = motor off = pin 3 low
3: sw on = motor on = pin 3 latched high
4: the motor on for 2 to 4 seconds and pause for 3 to 6 seconds - is independent of the latch: The latch "allows" the motor to cycle like a slump pump would detect a bucket full of water pump it out and wait for it to refill ?
 
3: sw on = motor on = pin 3 latched high
My problem is that the motor will not start if the sensor sees light. Maybe the problem is that it is actually restarting but it is instantly stopping because the sensor sees light. I need the motor to stop only when the sensor goes from dark to light. The motor should be able to run when the sensor sees light. Sorry if I didn't explain this well originally.
 
IF IF IF the sensor output is *not* switch contacts, then:

Capacitor-couple the sensor to the Threshold input. If the light sensor is high when the circuit is reset, it will have to go low and then high again to set the latch.

You can leave pin 7 open.

ak
 
I wasn't quite sure what a capacitor-couple was but I tried adding the capacitor between the sensor and the reset as shown on the schematic. This did not work for me. The reset pin always was low regardless of the sensor output. Maybe I have set this up wrong. My sensor uses a transistor to switch the output. motor control1 copy.jpg
 
Perhaps your sensor has a pull-up transistor only. In the post #8 circuit try adding a resistor (say 10k) with one end connected between the sensor output and the cap, the other end grounded.
 
The sensor has 2 output transistors, an npn (sink) and a pnp (source). I am using the pnp output so I think it would be a pull-up. I will give the resistor a try.
 
In the first photo is a circuit that maybe helpful. It works in the simulator as best I understand your requirements, If not we can make changes until it is what you need, In the photos the n numbers reference the pins as pin2(trigger), pin3(output), and pin4(reset). The mosfet is just one I grabbed from within the simulator you may try any you have.
The jest of the circuit is the voltage source (input) is set at 0 initial volts, a start delay of 1s, rise and fall time 1nano s, pulse on time of 2s, period of 6s and number of cycles at 8.
The second photo shows the output that tracks the input source, Next is the input to the mosfet and pin4. The third is the input at pin2 (trigger) , last the input at pin4(reset).
I am not sure about the large postive pulse at pin4; a diode stopped the output.
 

Attachments

  • circuit.png
    circuit.png
    19.2 KB · Views: 5
  • NE555 output.png
    NE555 output.png
    12.8 KB · Views: 3
  • Hi and low pules.png
    Hi and low pules.png
    13.1 KB · Views: 3
  • Input at pin 2.png
    Input at pin 2.png
    13.9 KB · Views: 3
  • Input at pin 4.png
    Input at pin 4.png
    9.1 KB · Views: 3
Last edited:
I am not sure how involved you want to get with this but maybe a better explanation of my project will help. I am making a machine to apply self adhesive labels. The motor is used to advance a roll of labels until the light sensor sees a gap between labels on a roll. At that point the motor should stop. The operator will restart the motor after applying a label by depressing a foot switch. The motor needs to restart regardless of whether the sensor is positioned over a gap (sensing light) or over a label (sensing dark). The important thing is that the sensor should stop the motor when it senses a transition from dark to light.

In the circuit you made, I assume that V1 is the output from the light sensor. I am not sure where the foot switch would go. Would your circuit seem appropriate for what I am trying to do? Thanks for your help on this. It is a bit over my head!
 
I learning to use the LTspice circuit simulator so this is a good project to practice on.
So when the light sensor senses the light its output goes from 0 to 12 volts. Then the output of the 555 timer at pin 3 goes low. Thus stopping the motor. When the operator presses the switch the output goes high thus starting the motor regardless of the current state of the output of the sensor. When the sensor transisitions from light to dark (12 volts to 0) no response is required.
 
Providing R3 is at least ~2k, connect the foot-switch (it needs to be a normally-open momentary type) in series with a 1k resistor between pins 6 and 8.
Did you try a pull-down resistor at C1 left end?
 
I have not tried the pull down resistor yet. I have just been too busy lately! Hopefully tomorrow I can get back to it. I will let you know.
 
Oops. Ignore the suggested foot-switch connection in post #15. I misread your start/stop requirements.
It occurs to me that if the operator keeps the foot-switch pressed the light sensor won't turn the motor off. You could overcome that by capacitively coupling the foot-switch to pin 2 :-
MotorControl.PNG
 
Last edited:
This circuit works perfectly! Thank you everyone for your help. Just one other question that perhaps someone could help with. When I started working on this I began with another circuit I came across for a motor controlled by a light sensor. That circuit had a 2 ohm, 10 watt resistor at the start of the control circuit. I thought maybe it was for a resistance brake for the motor it doesn’t seem to have an effect on how fast the motor stops. Would the resistor be needed for protecting the control circuit from motor generated current?control circuit.jpg
 
Your right. I didn't draw that very well. Actually the current flows through the motor and to the mosfet in the control circuit. The circuit diagram at the start of this thread shows the layout better.
 
Top