# Motor control

Status
Not open for further replies.

#### kwame

##### Member
hi folks
i am out with a new problem.ha ha.....
I need to control my motor.This is what i want the motor to do.I Want the motor to rotate once every hour for about 15 seconds and stop.During the next one hour it should be reversed and that should also last for 15 seconds and the cycle continuous indefinitely. How do i go about the whole process .

Kwame

##### Well-Known Member
AC or DC motor? If I assume DC then you may want to start looking at H Bridge circuits to handle motor direction. How big of a motor, in other words how much current draw? If I assume a big motor you may want to l;ook at a big H Bridge. Other than run 15 seconds in one direction pause for an hour and run 15 seconds in the other direction you aren't telling much.

Look for H Bridge than worry about the timing.

Ron

#### Vizier87

##### Active Member
a PIC12F might do the job, they're just 8-pinned babies which can drive an L293 h-bridge..

#### LightSpeed334

##### New Member
Controlling it would be easy with a simple PIC program (written with Swordfish):
Code:
Dim Motor as PORTB.0

Sub DelaySeconds(pSeconds as Word)
Dim Seconds as Byte

For Seconds = 1 to pSeconds
DelaymS(1000)
next
End Sub

// start of program...
Low(Motor)                      // initialise motor

While True
High(Motor)                 // turn on motor
DelaySeconds(15)            // delay for 15 seconds
Low(Motor)                  // turn off motor
DelaySeconds(3600)          // delay for 1 hour
wend

Interfacing with the motor depends on factors already discussed.

- Here's an example of a light weight DC Motor H-Bridge that can drive up to 2A.
- If your going in one direction, then perhaps a single N-Channel FET would do the job? Most FETs can drive +++Amps (don't forget the EMF protection diode!)

#### Vizier87

##### Active Member
...yep, combine post #3 and #4 and you'll complete your project.

##### Well-Known Member
...yep, combine post #3 and #4 and you'll complete your project.

Close but the OP has yet to return with details. The use of a PIC would be a very good way to go, however, many don't want to have to setup and start doing dome programming. Therefore they prefer the use of discreet components.

From a PIC standpoint, since the OP seems to want forward/reverse I believe the PIC would need to have two output pins programmed. The posted code would I believe work for a unidirectional motor but not bidirectional.

I guess we will know more when the OP returns.

Ron

#### Vizier87

##### Active Member
oh.. I'm an assembly guy.. swordfish isn't my stuff. But the programming's sure gotta be simple.

#### kwame

##### Member
Hi
The motor is a 12v Dc Motor .it does not consumes much current.It is used widely in automobiles.

AC or DC motor? If I assume DC then you may want to start looking at H Bridge circuits to handle motor direction. How big of a motor, in other words how much current draw? If I assume a big motor you may want to l;ook at a big H Bridge. Other than run 15 seconds in one direction pause for an hour and run 15 seconds in the other direction you aren't telling much.

Look for H Bridge than worry about the timing.

Ron

#### kwame

##### Member
Hi Lightspeeed
the swordfish programming stuff is above my head.I am hearing the word for the first .If I paid for the PIC and the components could you do it and mail it over to me in africa.

#### kwame

##### Member
Electronic timer

Hi folks the dc motor h bridge sounds very complicated as one needs logic IC and a programmed PIC etc.
If want to use an electronic timer to sweep the motor in opposite direction once every hour how should i go about this.I think this will be much simpler.

a PIC12F might do the job, they're just 8-pinned babies which can drive an L293 h-bridge..

##### Well-Known Member
Hi folks the dc motor h bridge sounds very complicated as one needs logic IC and a programmed PIC etc.
If want to use an electronic timer to sweep the motor in opposite direction once every hour how should i go about this.I think this will be much simpler.

OK, so to revisit things you want to run a motor forward for 15 seconds then off for about an hour or 3600 seconds. Then run reverse for 15 seconds and off for about an hour and repeat.

Now we have a few things to get done here. Running a DC motor in one direction then stop then run again is easy (pretty easy), however, we want a reverse function in here. To achieve reverse we need to reverse the polarity to the DC motor. That complicates things a little as in how to reverse the polarity to the motor. There are some options here like a relay network or the use of what we call an H bridge. The H Bridge does not have to be driven by a microchip, or micro controller, or anything fancy. The H Bridge is simply a way to reverse polarity to a motor. Personally I think the use of an easily built or bought H Bridge is the way to go.

Next we need to configure a timer scheme which for the times involved isn't all that easily done.

The question becomes if the project is just a home project or is this an actual industrial application. The more people know, the more they can give ideas. Additionally how good are your building skills?

Ron

#### kwame

##### Member
I am using this motor reversal mechnanism for a home project.I am going to use the motor to turn my eggs in a home made prototype incubator.
I will rate my building skills at 40%.How much would the h bridge cost.I how much the total components if wanted to assemble them personnally.

OK, so to revisit things you want to run a motor forward for 15 seconds then off for about an hour or 3600 seconds. Then run reverse for 15 seconds and off for about an hour and repeat.

Now we have a few things to get done here. Running a DC motor in one direction then stop then run again is easy (pretty easy), however, we want a reverse function in here. To achieve reverse we need to reverse the polarity to the DC motor. That complicates things a little as in how to reverse the polarity to the motor. There are some options here like a relay network or the use of what we call an H bridge. The H Bridge does not have to be driven by a microchip, or micro controller, or anything fancy. The H Bridge is simply a way to reverse polarity to a motor. Personally I think the use of an easily built or bought H Bridge is the way to go.

Next we need to configure a timer scheme which for the times involved isn't all that easily done.

The question becomes if the project is just a home project or is this an actual industrial application. The more people know, the more they can give ideas. Additionally how good are your building skills?

Ron

##### Well-Known Member
OK, then all things considered I would think about just buying a simple H Bridge rather than build your own. Something like this one is fine for small DC Motors. I am only using Spark Fun as an example seller as it seems out of stock right now with them. However a L298N is about what you want. I am guessing as I don't know your actual current needs.

I am sure a Google of H Bridge will bring up other vendors depending on your location. Mouser comes to mind or DigiKey.

Ron

#### kwame

##### Member
IC and programming

Hi
if i paid for the IC and the programming cost, would you be willing to do it on my behalf?

oh.. I'm an assembly guy.. swordfish isn't my stuff. But the programming's sure gotta be simple.

#### Vizier87

##### Active Member
erm any guy can do it even on this forum.. no need to pay, no need for PMs. when you have bought all the stuff tell us. it's useless if programming works but the electronics fail to function properly.

#### kwame

##### Member
Rc constant

Hi folks
this ' h bridge' sounds complicated and the spare parts are not locally available eg PIC,mosfet etc.
I want to use two astable 555 ICs for the same job.
However, i need help to determine the rating of the the capacitors and resistors to use such that the motor will rotate ,say once ever hour or once two hours.The motor a Dc motor which consumes 12v.
How ohms should the capacitor have and how farads should the capacitor have?

Wisdom Kwame
erm any guy can do it even on this forum.. no need to pay, no need for PMs. when you have bought all the stuff tell us. it's useless if programming works but the electronics fail to function properly.

##### Well-Known Member
Hi folks
this ' h bridge' sounds complicated and the spare parts are not locally available eg PIC,mosfet etc.
I want to use two astable 555 ICs for the same job.
However, i need help to determine the rating of the the capacitors and resistors to use such that the motor will rotate ,say once ever hour or once two hours.The motor a Dc motor which consumes 12v.
How ohms should the capacitor have and how farads should the capacitor have?

Wisdom Kwame

OK, one more time. First of all a single or pair of 555 timers (556) will not do what you want. Not with anything close to accurately. They don't work for times like an hour (3,600 seconds). You would use the 555 as the clock then add additional counter chips to get the ultra long delay you want. I suggest you read a 555 data sheet. Then read this and understand what is going on.

Next, as I pointed out in the beginning of this thread there is a matter of timing and there is a matter of reversing polarity to your motor. So short of an H Bridge you tell me or anyone here how you want to reverse the motor's polarity? A crude but workable H Bridge can be built using 4 everyday generic switching transistors. Real crude but workable using 2 each 2N3904 and 2 each 2N3906. You are telling me you don't have access to basic switching transistors? How about a 2N2222 and a 2N2907?

I made it clear you don't need a PIC, the function of the PIC was the timing. Did you read any of that?

Use a 555 as a 1 second clock, then look at using a 4017 family chip (decade counter divider) to create your delay. I suggest you read and understand the 555 data sheet to calculate the R/C timing values.

Ron

#### kwame

##### Member
OK

OK
Thanks once again for taking time to really do a thorough explanation.I will comb town tomorrow to try and see if i can find the switching transistors 2N3904 and 2N3906 / 2N2222 and a 2N2907 as it is very late now around 9:30 pm.
I have read the 555 data sheet. If possible send a simple schematic of the 4 transistor cruude H bridge .I think that with that i can burn the candle at both ends to put it together.

Wisdom kwame Samlafo
kwameklu@gmail.com

OK, one more time. First of all a single or pair of 555 timers (556) will not do what you want. Not with anything close to accurately. They don't work for times like an hour (3,600 seconds). You would use the 555 as the clock then add additional counter chips to get the ultra long delay you want. I suggest you read a 555 data sheet. Then read this and understand what is going on.

Next, as I pointed out in the beginning of this thread there is a matter of timing and there is a matter of reversing polarity to your motor. So short of an H Bridge you tell me or anyone here how you want to reverse the motor's polarity? A crude but workable H Bridge can be built using 4 everyday generic switching transistors. Real crude but workable using 2 each 2N3904 and 2 each 2N3906. You are telling me you don't have access to basic switching transistors? How about a 2N2222 and a 2N2907?

I made it clear you don't need a PIC, the function of the PIC was the timing. Did you read any of that?

Use a 555 as a 1 second clock, then look at using a 4017 family chip (decade counter divider) to create your delay. I suggest you read and understand the 555 data sheet to calculate the R/C timing values.

Ron

##### Well-Known Member
Once you have some transistors give this link a read as he covers some of the transistors we have been mentioning. There are some very good and very simple H Bridge circuits.

Hope that helps a little...

Ron

Status
Not open for further replies.

Replies
9
Views
1K
Replies
8
Views
1K
Replies
13
Views
2K
Replies
13
Views
2K
Replies
18
Views
5K