Please help me with arduino!!!

Thread Starter

rezvisquikz

Joined Jun 9, 2016
15
Hi All

I am doing a small project where the objective is to control a DC small motor.

My tools : Arduino mega 2560 & L298N IC

Closest match to this project here : http://www.allaboutcircuits.com/projects/control-a-motor-with-an-arduino/

The above link rotates the motor in each direction for 3 seconds, but my requirement is that the motor should turn slowly 180 degrees clockwise then 180 degrees anti clockwise. This needs to be repeated for a 10 cycles.

Is there any way I can control the motion ? Is it advanced programming required?

In my head I was thinking to stop the motor using the time delay at 180 degrees, is this the way to go on about it?

Let me know thanks.

(bear in mind I am noob) :(
 

DickCappels

Joined Aug 21, 2008
10,185
I can think of two ways to do this and there are probably better ways.

Use a stepper motor. With each step the motor will rotate a fixed amount and then stop. That's a different motor and a different driver.

Use an indexing device, though this is likely to work poorly, but you can use the same motor and the same driver you have now. With this method you attach a disk to the motor's shaft and make hole in it, and then use an optical detector to tell when the disk is in the position in which light passes through the hole. To make the motor run slowly enough to stop right after the hole is in front of the sensor, job the motor will narrow pulses at a low frequency. A lot of experimentation will be required.

 

Thread Starter

rezvisquikz

Joined Jun 9, 2016
15
wow, good advise but that is too advanced for me i think :( .

I havent even got to drive my moto using the link I provided in my previous post.

Any easy way?
 

Sensacell

Joined Jun 19, 2012
3,451
Sounds like a job for a Hobby RC servo.

You can control them using an Arduino, you don't need any feedback hardware to sense the position, it's built into the servo.
 

Thread Starter

rezvisquikz

Joined Jun 9, 2016
15
Well mainly its a project at work. I have a small motor geared down, I have used it using a DC source, and the motor is operatable at 0.3mA. I want the motor to operate at 0.3mA constant (slow motion), and want to use it so that the motor starts and stops at 180 degrees clockwise motion and then stops and moves back to 0 degrees anticlockwise for 5 times. Hope that explains it.
 
Without feedback of some sort, its the wrong motor. You can't guarantee 180 degrees with a DC motor. An AC synchronous, RC servo or stepper could be a better choice.

I'd consider limit switches and possibly an adjustable clutch and possibly go that route.

Yes, you should brake, stop briefly and reverse direction. Time won't cut it. Errors will accumulate.
 
Top