pcbway




stepper motor control, stepper motor pic, pic microcontroller stepper motor, stepper motor direction control, stepper motor speed control, interfacing of stepper motor with picHello everyone, today I am going to share Stepper Motor Control using PIC Microcontroller. We are all quite well aware of stepper motor but if you don’t have much of the idea about this motor then you should give it a google search. 😛 Stepper motor is used in such projects where precise movement is required. Projects where we need to move the object at some particular angle. Stepper Motor works on electromagnetic phenomena. Electromagnets are present in the stepper motor and when we supply voltage across them, these electromagnets got polarized and produce a magnetic field and in order to depolarize them, what we need to do is to simply depolarize these electromagnets. We all know that in motors, we have rotor and stater so in stepper motor these electromagnets act as stater and we need to polarize them one by one. When we polarize first electromagnet then it attracts the stater towards it and then we depolarize this first electromagnet and polarize the second electromagnet. And the rotor attracts towards second electromagnet. In this way we can move our stepper motor from first to last electromagnet and then start the process again.

So, that was a brief introduction about Stepper Motor and if you wanna read in detai about it then you should read the Wiki Page of Stepper Motor because they have explained each and every thing about stepper motor in detail. I would also recommend you to read Stepper motor Drive Circuit in Proteus ISIS because in this post I have given the basic movement of stepper motor in detail. Our today’s task is stepper motor control using PIC Microcontroller. I have used PIC16F877A for stepper motor control and I have designed the simulation for stepper motor control in Proteus ISIS software. Code written for PIC Microcontroller is designed in MikroC Pro for PIC Compiler. Simulation and Programming code is given below for download but I would recommend you to design it on your own so that you learn most of it. Anyways, let’s get started with Stepper Motor Control using PIC Microcontroller.

Stepper Motor Control using PIC Microcontroller

  • In this project, I am gonna control the speed angle and direction of stepper motor using PIC Microcontroller.
  • I will send commands via Serial Terminal and on the basis of these commands, our stepper motor will change its step size as well as direction.
  • You can download the stepper motor control simulation and code by clicking the below button:

Download Simulation and Code

  • Now lets design it in Proteus, first of all, design a circuit as shown in below figure:

stepper motor control, stepper motor pic, pic microcontroller stepper motor, stepper motor direction control, stepper motor speed control, interfacing of stepper motor with pic

  • Now you can see inthe above figure that I have used L297 and L298 as stepper motor drivers.
  • You can do stepper motor control without these drivers in Proteus software but when you design it in real hardware then these drivers will be required.
  • Moreover, I have used the COMPIM which is used for serial control. We will send commands via serial port and the motor will follow the instructions.
  • So, now upload the below code in your PIC compiler and get your hex file.

  • Now upload the hex file in your PIC Microcontroller and run your simulation, if everything goes fine then you will get results as shown in below figure:

stepper motor control, stepper motor pic, pic microcontroller stepper motor, stepper motor direction control, stepper motor speed control, interfacing of stepper motor with pic

  • Obviously, you can’t see the motor running in above picture but you can see it has moved to some angle.
  • In actual, it will start moving continuously and will stop when you send a command on Serial terminal.
  • The below video will explain the whole project in detail:

So, that’s all about stepper motor control. I hope you have liked it and it will help you in some way. In the coming post, I will share the stepper motor control with Arduino board. So stay tuned and have fun!!! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment