Discussion in "General help Guidance and Discussion" started by    thcmagus    Feb 13, 2010.
Sat Feb 13 2010, 07:13 AM
Hey all just wanted to see if anyone could give me a hand.. Recently we discussed stepping motors. I understand the idea and seeing your tutorial page with the stepping motor.gifs was awesome. We are currently doing this in lab but ran into a problem tonight.. when given our motors we found that it used a different coloring schematic.. I check the forum and found one pic that showed different wiring setups but none had purple in them lol. Anyway I also did a google search for my motor and found that someone had a similar motor just a different chip driving it.. and he was nice enough to label the coil order. Following both we were still unable to get our motor to rotate at all. As far as I understand in the 2nd pic the 0 , 3 , 2 . 1 order represents the p2.0 etc connection on our 8051 trainer.. I just wonder if anyone is seeing something that jumps out at them.. In the assembly code we are told to use p2. which made me wonder why we were using pull up resistors for the outputs.. I thought resistors were internal for all ports except p0.. so I tried changing the assembly and the wiring to our trainer but still nothing.. any help would be greatly appreciated..

Mon Feb 15 2010, 10:10 AM
0,2,3,1 is the coil number not port number.

are you using ULN to drive your motor?

and i feel that your are energizing your motor coil in wrong order. Follow the order given in second picture and connect it to port as per order. if still cant get it to work then find the correct order of coils.

To find the correct order of your coil, follow the procedure below:

4 coils are named as coil1,2,3 and coil 4. Assuming coil1 to be Purple. Motive is to rotate motor in one direction either clockwise or counter clockwise. Now,

1. Connect Vcc to Common wires (white in your case).
2. Select any coil to start with. (better to go with Purple (coil1)).
3. Connect Ground to Coil 1, Motor may or may not rotate. ignore rotation.
4. Now remove GND from Coil 1 and connect it to Coil 2 (try with blue). check the rotation of motor. (assuming clockwise)
5. Now remove GND from coil2 and connect it to Coil 3 (Try with Yellow). check the rotation of motor, if your motor rotates in Clockwise direction then Coil3 is in order skip step 6, if your motor rotates Counter clockwise, it means its not correct coil.
6. Remove GND from coil3 and connect it back to Coil2 to return to last position and then connect GND it to Coil4 (try with Orange). check the rotation of motor, if your motor rotates in Clockwise direction then Coil4 is in order. (current order is Coil1, Coil2, Coil4).
7. Last will be coil 4 in order if you have skipped step6 in procedure else coil 3.
so order will be either (Coil1, Coil2, Coil3, Coil4 or Coil1, Coil2, Coil4, Coil3).
 thcmagus like this.
Tags stepper motor wiringstepper motor connectionswriting stepper motorhow to connect stepper motorstepper motor connectionsfinding stepper motor wires
Mon Feb 15 2010, 10:10 AM
Tue Feb 16 2010, 03:18 AM
I went to school the next day and worked on it some more.. after awhile I dug up a spec sheet and found that these are 12v motors.. ac I ran 12v to the white wire and then held the wires up in the order labeled above and dragged a ground wire across them and the motor twitched to the right : )
Tue Feb 16 2010, 07:12 PM
great.. program it accordingly.. let me know the results.
Tue Feb 16 2010, 09:33 PM

I went to school the next day and worked on it some more.. after awhile I dug up a spec sheet and found that these are 12v motors..


Both the motors mentioned in your post are 5 volts..
which motor do you have ?.
Wed Feb 17 2010, 07:46 AM
Well it says its a J835L .. doing a quick google search will find you the .pdf and the one I found has this as far as specs.. I found a teacher and explained my problem and he replied that we could test the motor. I used some test clip connections and ran 12v to the white wire.. then held the other wires in my hand in the coil order the other student mentioned above ( purple0 , orange1, blue2, yellow3 ) and dragged my ground test lead across the wires in that order and the motor would step a bit clockwise.. I didnt have time to connect my 8051 trainer because there was a free ISCET review test I didnt want to miss.. I appreciate all the responses and will gladly post my results if anyone is interested..

*posted a pic of the 2nd sheet of the J8335L.. thats what ultimately lead me to the 12v.. hope these pics arent too big and annoying I just thought it would be easier for me to post this stuff instead of sending people off to search for it : )
Wed Feb 17 2010, 05:38 PM
No the image is fine.
It does say 12 volts, but in the rest of the pdf it gives other figures.

Use 12 volts if you want, but keep an eye out for overheating at low step rates
or when stationary.
Sat Feb 27 2010, 06:29 AM

I went through as Ajay Bhargav suggested and confirmed my coil order.. I had the lab setup and was still having issues.. I used a multimeter to check my signals from the 8051 trainer and found that they never seemed to go to ground.. here is a pic of the trainer we use..

In the lab we are using p0 , p2 .. I never thought about the other ports until I noticed the GND pin (bottom left corner under p3) I ran a wire from there to GND on my breadboard and my motor turns like a champ using 9v to drive the motor still... my teacher explained to me that there was not a common ground.. I was actually hoping if someone could help me understand that a little more.. since the 8051 trainer is plugged into the wall I figured it had GND.. but now come to think of it.. the trainer is AC powered.. maybe there wasnt a path to ground? I know the trainer coverts to DC power to run my logic chips but im not sure if I am thinking about it the right way..

Now that I have that knocked down we are going about getting it to rotate to set degrees (90 , 180, 270, 360) and rotating clock and counter-clock wise. All seems well.. working on code that would allows us to use the dip switch to select which mode we would like.. I think I have the code figured out.. have paper finals and then we get graded on how much we can do as far as this lab goes. I dont want you to do my homework I want to understand this. If someone could just tell me if the code seems like its right or if there is some kind of program I could use.. we use multisim to do testing of simple circuits but I dont believe it would allow me to replicate this.

If I get an okay from someone Ill post my .asm
Sat Feb 27 2010, 07:28 PM
sure you can post your asm file, we can suggest you incase you have any errors. but if you can try your code on hardware first and note down the problems, it will be easy to figure out the errors then

Good luck!

Get Social


Powered by e107 Forum System


Sun Oct 13 2019, 12:23 AM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 12:18 PM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 09:37 AM
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Wed Sep 18 2019, 10:48 PM
Caryn Kover
Thank you for your time,
Mon Aug 05 2019, 09:09 PM
@Ismail ..post in forum, give details
Mon Aug 05 2019, 06:33 PM
Ismail balghmi
Hello. Please I won't download
Wed Jul 24 2019, 02:47 AM
@BUSTER123 Please post in the forum
Tue Jul 23 2019, 08:13 PM
hello! newbie here. i am kind of a guy who hates using ready - made existing libraries, so this helped a lot as i was trying to control and write to a character lcd display. however, i can't figure out how to set the cursor position. for example, i want to set it to the 5th column in the first row, so position 5. so according to the table, i am sending 10000101 on the 8 data lines of the lcd (register select pulled low). the cursor does not move there however. and i cant move the cursor left or right too. is it something wrong that i am doing? thank you.
Thu Jul 11 2019, 09:55 PM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html
Thu Jul 11 2019, 09:44 PM
@praveen123. Can you give a link to the project ?



Mon Nov 11 2019, 01:31 PM
Sun Nov 10 2019, 04:42 AM
Sat Nov 09 2019, 03:41 PM
Fri Nov 08 2019, 10:06 AM
Fri Nov 08 2019, 07:28 AM
Tue Oct 15 2019, 04:32 PM
Tue Oct 15 2019, 02:27 AM
Sat Oct 05 2019, 02:38 PM


Guests: 31, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38102
Newest member: DeepakBGattani
Forum Activity
Jeanbusatta Avatar
Posted By Jeanbusatta
Sun Nov 10 2019, 04:43 AM
ty, really needed it
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Oct 22 2019, 05:18 AM
wimac Avatar
Posted By wimac
Mon Oct 21 2019, 09:18 AM
I’ve been following this thread and looking at the...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:09 PM
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:02 PM
sir, when i on display ,sometime 3rd display is no...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 02:53 PM
sir, when i on display ,sometime 3rd display is no...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 20 2019, 12:21 AM
Your code seems okay on my simulationTry my code o...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:13 PM
please find video attachment. 3rd & 4th displa...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:05 PM
sir, 3rd and 4th dot matrix display flickering, ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Oct 18 2019, 09:18 PM
Hopefully you understand some of the program.Which...