DIY small motor that turns for x seconds every y seconds

I'm a civil engineer, hiker, and hobby photographer. I am trying to build a little device that gently turns a small motor on every x seconds, keep it on for y seconds, and stop it for z seconds. For example, Set the motor to run every 30 seconds, have it run for 45 seconds, and stop it for 37 seconds. In addition, the movement of the motor must be such to minimize vibration on the camera that it will support.

Above all this device must be portable in a regular backpack.

I have played with the raspberry pi a little bit (I don't own one) and have dabbled in electronics a touch

• If every 30 seconds it runs for 45, it's running all the time, but you probably mean stop for 30 seconds after running. A very simple micro with a PWM to a servo drive can do that easily. Certainly overkill for a PI. – kenny Oct 20 '12 at 10:53
• @kenny True, I reflected your comment in my question – dassouki Oct 20 '12 at 10:55
• What's the purpose? – starblue Oct 20 '12 at 10:58
• Overkill for a Pi yes, but perhaps not wildly extravagant for a total newbie to buy a Pi + IO board + follow one of the tutorials to wire a motor to it & control it from Python script or something. Certainly more likely to yield a result than trying to learn micros from scratch. – John U Dec 3 '13 at 22:19
• What voltage and current (power) requirements are we talking about here, ie what´s the motor? In any case, you could start by looking at the 555 timer. Plenty of circuits out there if you search around a bit. – F. Bloggs May 20 '15 at 16:21

Even after your edit the data on timing don't make sense: you can't run a motor for 45 seconds every 30 seconds. But the pattern isn't important for the solution.

I would use a small microcontroller like the PIC10F200, which doesn't need any external components to create the on/off pattern. You can have the 10F200 in a DIL package (left), or a 3 mm long SOT23-6 package.

The microcontroller can't drive a motor directly, so use an output pin to control a transistor which drives the motor:

You don't say anything about RPM, but this small geared DC motor is available gear-ratios from 4.4:1 to 499:1 for 2020 RPM down to 12 RPM. For even slower you can add an extra gearbox.

Stepper motors are also often used with microcontrollers because you can control their position very accurately, but they require more complex control signals than the simple on/off, and especially at low RPMs don't run smoothly: they're not called "steppers" for nothing.

• Much better to use a small low threshold NFET than a bipolar transistor, but the basic idea holds. – Chris Stratton Sep 14 at 22:09

Pi may be an overkill, but that can be justified. Pi is a development platform that the O.P. already has some familiarity with. It fulfills the portability requirements. The resulting gadget is a one off (as opposed to mass production), so I would think that cost of parts is not so critical.

On the opposite (low) end of complexity is the venerable 555 timer. If it's wired in the astable circuit with variable R1 and R2, it can produce a square wave with variable frequency and duty cycle.

Like microcontroller, 555 can't drive the motor directly. It will require a BJT arrangement similar to one in the post by @stevenh, or a MOSFET.

I recommend using a 555 timer for your 30-second intervals. It's not terrifically accurate, but I imagine it will be close enough:

You can calculate the on-time (t1) and off-time (t2) using the values for Ra, Rb, and C.

You'll need to drive the motor through a transistor though. Make sure you choose a transistor that not only can handle enough current to properly run the motor, but that can also be driven by the 555 timer.

[This answer have arrived to this thread as a result of a merge.]