circuit design for automated motor on/off control

Thread Starter

averte

Joined Oct 6, 2025
5
hey everyone, I'm working on a project where I want a DC motor to turn on/off via motion control. I'm pretty new to building things with circuits and this is my first time posting here, so sorry if I'm in the wrong place!!

the idea is that I'll have a 12 V 1000 RPM DC motor hooked up to some motor speed controller. I want the motor to only turn on in the presence of some object, so I was looking into an optical sensor to act like a switch. I was also planning on powering this with a 12 V disposable battery.

Is this a correct setup? I'm not sure if that's the right optical sensor to use as I'm new to picking out parts. If anyone has done something similar, I'd appreciate any insight, thanks!
 

Thread Starter

averte

Joined Oct 6, 2025
5
Does this mean the motor should run as long as motion is detected or on a fixed timer?
A fixed timer would be ideal, but I was intending a simple / cheap design. The application is to spin a horseshoe magnet for a set amount of time to use with magnetic nail polishes, so it's a small DIY project. I assume a timer would introduce a logic board?
 

SamR

Joined Mar 19, 2019
5,470
As a safety requirement for motor controls, they are powered by the same source as the motor. Motor controls voltage may be stepped down with transformers powered by the same source as the motor. Motor starters have these control elements built into them. Which means that when you kill the motor's power and lock out the circuit power supply (or unplug it) there is no voltage present from a second source for safety. This is something you need to consider when designing any motor control circuit. Safety first always!
 

simozz

Joined Jul 23, 2017
170
For the digital control, you can opt for two solutions: a monostable timer (the timeout precision is usually not so accurate due to tolerances of RC components), or using a timer on an MCU (32768 Hz oscillator, internal RC or HSE clocked etc - timeout Is more precise).

The controller you linked is a 555 based PWM speed manually controlled, which is how you control the speed of these kind of motors.
At the following link some one traced the schematic:
https://www.hobby-machinist.com/thr...eed-controller-conversion-thread.86117/page-7

Being it manually controlled, adjusting the duty cycle with the trimmer pot, if this is set to 100% or so at power up, you will have an abrupt start-up (the motor is an inductive load).
I think it's better to always start gradually from 0 to the required duty cycle.

Also, placing transistors in parallel is a bad idea.
Cheers,
s.
 
Last edited:

meth

Joined May 21, 2016
298
I would still implement some kind of uC.. the idea of driver connected with sensor will work but it is too rudimentary in my opinion (and in general practice).
Later you might want to add indication lights, some push buttons... you can always upgrade but you will have to redo your entire hardware. Also dont forget the safety!!!
 

MisterBill2

Joined Jan 23, 2018
27,159
The proposed speed controller in post #1 lists a maximum current of 2 amps. The motor description gives no hint as to the required motor drive current. There could certainly be a problem. The motion sensor proposed IS ONLY A SENSOR, it requires an electronic circuit AND a special lens to even generate a motion detected signal. That makes it a very poor choice for a control system element.
There are many optical sensors intended for control available. With a more detailed description of the application we can provide a detailed description of a complete system that will work.
With the description in post number five we can actually provide useful advice instead of random guesses.
 
Last edited:

panic mode

Joined Oct 10, 2011
4,864
yup, it is a small motor so PWM module will be fine. the problem is the sensor. that is just a sensor without supporting circuitry that is required:
1759841086530.png

given level of experience or lack of it, i would suggest to consider using a sensor module as already suggested in post #7. this is a complete unit including sensor and supporting circuitry and the lense. you can get lower per unit price if you buy few, such as this.
 

Tonyr1084

Joined Sep 24, 2015
9,744
Hello and welcome to AAC.
The application is to spin a horseshoe magnet for a set amount of time to use with magnetic nail polishes
Are you willing to consider alternatives? I'm thinking if you need a changing magnetic field to move nail polish around while it cures perhaps instead of a motor you might just want to generate alternating magnetic fields. Two coils 90˚ to each other. Energize one coil Pos/Neg, energize the next coil Pos/Neg, reverse the first coil to Neg/Pos then the second coil to Neg/Pos. This will result in a swirling magnetic field. The orientation of each coil will need to be able to produce the desired affect. So positioning of the coils may need a little experimentation.

With coils you can control the amplitude (intensity) of the magnetic field as well as the timing of the switching each coil on and off and changing the polarity.

[edit] See post 16 for clarity. The following description is being deleted for lack of clarity. [end edit]
 
Last edited:

Thread Starter

averte

Joined Oct 6, 2025
5
wow, thanks for all the useful information! I definitely have a lot to think about in terms of control design, and I appreciate all of y'all's insight esp. with regard to safety and sensor vs. sensor modules.

i saw some people asking for more info on the application. i was inspired by this post and wanted to build my own similar set up-- the idea is that you have a 30 lb horseshoe magnet spinning at some RPM (while I haven't found any rigorous testing, it seems that anywhere from 100-1000 RPM could get good results) above a wet painted nail to induce a specific effect in the magnetic nail polish. Currently, I have my horseshoe magnet attached to my power drill, which probably isn't safe (and my arm gets tired holding it over my nail after a while!!)

At minimum, the motor and the motor controller is necessary, as I'd like to dial in the speed for the best effect in the polish. The motion/optical controller would be nice so that I don't have to manually switch the device on/off and potentially risk bumping my finger and messing up the wet polish.

I'll start out with just the motor and PWM controller and see how that goes, and will have to think more on the motion control element...
 

Thread Starter

averte

Joined Oct 6, 2025
5
Hello and welcome to AAC.

Are you willing to consider alternatives? I'm thinking if you need a changing magnetic field to move nail polish around while it cures perhaps instead of a motor you might just want to generate alternating magnetic fields. Two coils 90˚ to each other. Energize one coil Pos/Neg, energize the next coil Pos/Neg, reverse the first coil to Neg/Pos then the second coil to Neg/Pos. This will result in a swirling magnetic field. The orientation of each coil will need to be able to produce the desired affect. So positioning of the coils may need a little experimentation.

With coils you can control the amplitude (intensity) of the magnetic field as well as the timing of the switching each coil on and off and changing the polarity.

Just a thought.
Coil 1 ON (Pos/Neg)
Coil 2 ON (Pos/Neg)
Coil 1 OFF
Coil 2 OFF
Coil 1 ON (Neg/Pos)
Coil 2 ON (Neg/Pos)
Coil 1 OFF
Coil 2 OFF
Repeat
honestly the thought of using coils didn't even cross my mind, since I've just been using the horseshoe magnet. this would be really interesting to experiment with... i bet i could get some pretty crazy effects with it too!
 

Tonyr1084

Joined Sep 24, 2015
9,744
Here's a drawing of two coils. Each coil has a DOT at one end to represent polarity of the coil. Each set of crossing coils shows 8 options for powering and the red arrow shows direction of magnetic flux.
View attachment 356864
Powering one coil you get a straight line either (in the case of coil 1) UP or Down, depending on polarity. In the case of coil 2 you get a magnetic line of either LEFT or RIGHT. Having both coils energized positively will deflect the magnetic direction 45˚ to the right (second image top row). As you switch coils on and off and change polarity you can rotate the magnetic flux in 8 directions. It's not 360˚ but it may suffice. And having just the coils in a fixture you can have an optical sensor detect the presence of a person's hand. Left hand, right hand, doesn't matter. The flux is always spinning in the same direction. With a little extra electronic hardware you can get it to spin in the opposite direction. No heavy drill, no 30 lb. magnet to hold up, no chance of bumping a nail.

An alternative to use of an optical sensor can be having the coils mounted on a pivoting lid so that when it's up the person can place their hand in the cradle and then lowering the lid activates the electronics.

Just food for thought.
 

Tonyr1084

Joined Sep 24, 2015
9,744
Depending on the size of the coils and on the voltage you can get as much or as little magnetic field as you may want. Varying the amplitude of the voltage you can possibly gain additional effects.
 

Tonyr1084

Joined Sep 24, 2015
9,744
Since the ferrous particles in the nail polish will follow the magnetic field, the abrupt changing position of the flux will cause the polish to move. However the polish will not snap suddenly to the next position. Given its viscosity it will move more slowly. You can vary the speed of switching coils on and off to suit the best possible effect you wish.

In addition, you can use a microcontroller and switch coils on and off in different patterns causing the polish to move not just in a circular pattern but in many unusual ways. At least that's what I would imagine to be the case. Nail polish is something I've never messed with, so I don't know how ferrous polish will react.

For instance: Having coil 1 rapidly switch polarity at a given power level while coil 2 switches on with an increasing energy level. I can imagine this giving a zig-zag pattern as coil 2 switches from a high positive voltage to a zero crossing voltage, culminating in a high negative voltage. And by "High" I mean whatever the full power happens to be when a coil is energized. There's going to be lots of experimentation with this. Coils give you more options than a spinning magnet. Changing patterns, varying powers, alternating directions - lots of options. I think.
 

sghioto

Joined Dec 31, 2017
8,633
I'll start out with just the motor and PWM controller and see how that goes, and will have to think more on the motion control element...
Another simpler solution is using a footswitch similar to This to activate the motor.
Or like This one to turn the 12 volt supply ON and OFF using a single tap of the switch.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,159
Consider that an electronic motion sensor will have a constant current draw, activated or not. That may not be the best choice for a battery powered system, because of the constant current draw.
 
Top