Electronic – Using capacitor to maintain current flow past opening of switch

capacitormotortimer

This circuit turns on the motor when something blocks the beam from the LED to the phototransistor. I want the motor to remain on for 5 seconds after the beam stops being blocked (i.e. from when the phototransistor resumes conducting).

enter image description here

I first thought to add a capacitor in parallel with the motor, but 9V/(.120A * 5s) = 15F (I think?)

So then I thought to put the capacitor where it is highlighted in the circuit diagram, but I don't know how to determine what capacitor to use.

  1. Will the capacitor charge in a few seconds in this arrangement? What if its positive terminal goes above the 1K resistor?
  2. What size capacitor do I need? (The transistor is 2N2222). I'd love to see how this is calculated, but given how hairy the math seems to get with capacitor discharge there might be some rule of thumb?

I'm new to this, so would appreciate having any errors I made pointed out to me.

Best Answer

Don't use 2N2222, use 2N7000 MOSFETs (that motor must be small) and it will be much easier. Try this:

enter image description here

You will have to tweak the value of R5 to fine tune the timing. D2 is there to avoid C1 discharging through anything that isn't R5, and to charge C1 as fast as possible. The time constant between R5 and C1 determines the turn-off time.

This circuit could be improved by doing a harder switching action on M1 to lower switching losses, but if it is not switched on-off very frequently, it will work fine.

Oh, and dont forget about the flywheel diode D3, the motor inductive spike can be very nasty.

Related Topic