Electronic – Modify circuit to turn motor on/off multiple times per switch press

capacitormotortimer

I purchased a timed air freshener kit which makes the motor spin when the switch (SW1) is pressed. I have created a schematic based on the diagram in the instructions (pdf).

schematic

simulate this circuit – Schematic created using CircuitLab

At the moment the circuit will run the motor once per switch press. How would I modify the circuit to make the motor "turn on and off" multiple times per switch press?

Requirements:

  • Continuous "on and off" motor cycles when switch is in ON state (currently the switch is a push button, thinking I should replace this with a toggle to make sure it is either ON or OFF)
  • Motor should turn on for 1 second
  • Motor should turn off for 5 minutes

If it's possible I would like to control both these periods using a variable resistor. R3 in the diagram is actually a variable resistor which controls the length of time the motor stays on for.

Best Answer

This is very easy to do with a microcontroller. The tiny and cheap PIC 10F200 can do this easily.

The button is wired between ground and a processor pin that has a internal pullup. The button is then only a input to the processor. The processor does the timing and whatever other logic you want, then turns the motor on/off via another output.

There is no need for a darlington if the transistor will be driven from a processor pin. I expect the motor takes relatively little current, so something like the cheap and readily available 2N4401 can do this. Give the base about 1/50 of the worst case motor current, and the transistor will stay saturated when on. I'd add a reverse Schottky diode accross the motor to prevent turn-off spikes from damaging the transistor.

Related Topic