Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ULN2803 + Stepping Motor

Status
Not open for further replies.

SQLException

New Member
hi,

I am new to this topic, and I just want connect an unipolar stepping motor (have one motor with 15V and 0.4A from Teco Elec. & Mach Co. Ltd., but also a Mitsumi M42SP-4 and a M42SP-7)

www.mitsumi.co.jp/Catalog/compo/motor/m42sp/4/text01e.pdf

www.mitsumi.co.jp/Catalog/compo/motor/m42sp/7/text01.pdf

to the parallel port (I would prefer seriell, but parallel seems more common). however, is there any simple, basic circuit I can use? nothing special, just want get one of the motors working, coding the right program isnt the problem.

I mean I dont even know which components I need for building a small, compact, interface. seems for me the best choice is the ULN2803? but what else I need, any transistors, ics? just take the right circuit, some cables, a ULN2803 ic and a stepping motor and put this stuff together and mount it to the parallel port?
 
You just need the ULN2803. (It is basically a bunch of transistors in an integrated circuit package).

**broken link removed**

there is plenty of other stepper motor info at this site.
 
hi again,

sorry to bother, but im lost. I connected the 15v stepper with this circuit

**broken link removed**

to my COM port and tried a 12v (and also a 15v) power supply, but I cant get the motor to make a step using delphi.

the uln2803 is connected to DTR and RTS, but what now? how I can make just a single step? tried io.dll (function portout) and some components for delphi, nothing wanna work :?.

I thought I have to send 4 Bytes to the RTS line (0001, 0010, 0100, 1000) to make a step, but that must be wrong and I just mixed something up, cause e. g. with the portout function I can only send bytes to an address ($3F8 is my COM1), but not to a specific line (RTS!). please tell me what I am doing wrong :(.
 
I'm not sure if it will work on the com port.
I believe the uln2803 is designed for TTL logic voltage levels (5V=high) like what the data pins on the parrallel port use.

Sorry I cant be much help, I've never used the com port before. I'd say try to find a different schematic.

Oh, maybe try disconnecting pin 10 from +12V.
 
It's rather a strange circuit, only having two inputs?. So you can't do the normal single stepping routine on it.

I would suggest wiring four outputs from the parallel port to the ULN, and feeding the four windings individually. The parallel port also supplies the correct TTL levels for the chip - there are a great many such stepper motor circuits available on the net.
 
As Nigel said the circuit being used, has two inputs and you can not do a normal stepping sequence. You will need to send 01 and 10 to step the motor.

If you want to do halfstepping and microstepping, the circuit will not allow that.

Here is one that I have used with a 16f877 that uses a uln2003 to great success.
 

Attachments

  • uln2003a.gif
    uln2003a.gif
    14.2 KB · Views: 8,885
Yes you can use one stepper as you described.

Do you know the correct sequence to energize the coils to get the stepper to rotate? If the sequence is incorrect, the motor will not rotate.


spirosd may I ask what that circuit that you posted is for?
Also, why does the pin 10 (pin 9 on the uln2003's) have to be connected to your + voltage?
 
**broken link removed**

(and from somewhere the stepper gets 12v, not shown on the picture)

you mean if I know which cable from the stepper goes to which coil? dont have a datasheet, but I thought I can identify the cables with an ohm meter.
 
there is a way to figure it out with an ohm meter, but I never really learned it.
what I do is connect one coil to voltage. this will be the first coil in the sequence (Call it "Coil A"). Next I'll take a different coil and connect it to voltage and look at which way the shaft turns. Assume it turns counter clock wise (CCW), this will be the next coil in the sequence ("Coil B").

Now I connect a 3rd coil to voltage, if it turns CCW, then it is the 3rd coil in the sequence.
However, if the shaft turns CW, then this is actually the 2nd coil in the sequence, (so it becomes "coil B" and the 2nd coil you tried is now the 3rd coil.).

Next try the final coil, it should cause the shaft to turn CCW.

:roll: Hope this makes sense, it's alittle hard to explain...
 
jrz126 said:
spirosd may I ask what that circuit that you posted is for?
Also, why does the pin 10 (pin 9 on the uln2003's) have to be connected to your + voltage?

It is used to control the axis of a telescope :p

From the research that I did (both theoretical and empirical) it helps when stepping the motor fast (think about slewing the telescope ... you want something to happen in seconds; it redirects back emf from the motor to the battery/power supply - I believe). In addition is aids the heat dissipation of the ULN (I have also added a heat sink just in case, as I am powering 4V motors at 12V, with a current limiting circuit ... paranoid).

With respect to the checking of the coils of the motor, the resistance between the coils and the centre tap is the one identified by the datasheet, and double between coils. In other words ... say the datasheet identifies a resistance of 31.5 Ohms per phase, when reading the resistance between coils, the meter will read 62 Ohms, and 31.5 Ohms when reading between the centre tap and the coil. :roll: (I hope that was clear)

Take care
 
ok, one last question before I test it with some sourcecode. no ohm meter, no checking the coils :(. so I just connected the 4 cables (from the coils) to the uln2803, that means I dont know the sequence of the coils.

can I test it by sourcecode? I mean I would now send a byte to pin2 (parallel port), pin3, 4 and 5. if it dont work, try the next variation and so on... like:

2345
2354
2435
2453
2534
2543
3245
3254
3425
3452
3524
3542
4235
4253
4325
4352
4523
4532
5234
5243
5324
5342
5423
5432

one combination MUST work right?

edit: wooorks!!!

edit2: the stepper runs a little slow, my sourcecode is like:

voltage on coil1 and wait 1 ms
voltage on coil2 and wait 1 ms
voltage on coil3 and wait 1 ms
voltage on coil4 and wait 1 ms

if I increase the 1 ms, then the stepper runs even slower of course, with 0 ms (so no waits between turning each coil) the stepper do nothing. but once I had changed my code so the stepper turns really fast, but I lost this code... someone have an idea how to get the max out of it (speed)?
 
Just keep playing with the delay.
Keep in mind that as the speed goes up, you will start to lose torque/power.

It takes quite a few steps to get one turn out of it. at 7.5deg. per step, thats 48 steps per revolution.
 
the label on the stepper say 1.8°, but I need 50 for one whole turn... strange.

I cant do much with the delay, 1 ms is the lowest working delay. if I try "1/2" (means 0.5 ms I assume), the stepper then only make a sound like it dont have enough power to make a real step, although he try to.

once it worked so nice but I messed it up uhhhrrg.
 
When calculating the delay, take into account the operating system (scheduling and such). Driving the motors at these time delays (less than 2ms) cannot be guaranteed. (Hard real time control of the resources).

[from the nanosleep (setting a delay between pulse to the parallel port) man page in linux]
... nanosleep pauses always for at least the specified time, however it can take upto 10ms longer than specified until the process becomes runnable again.

I assume that something similar would be happening in a windows OS.
 
spirosd said:
I assume that something similar would be happening in a windows OS.

Probably worse in Windows, generating accurate short delays isn't really something that Windows is any good at - I use a Windows API call (which took a LOT! of finding), which will generate delays with mS resolution - UNLESS something else takes priority - where it will be longer.

For PIC programming this isn't a problem though!.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top