Step counter for Unipolar stepper motor
In previous post.I told you that I was able to drive an old scavenged unipolar stepper motor from my old printer.As I couldn’t find any datasheet it was not possible to fine how many steps needed for a full turn.I plugged in my 16*2 LCD to the my board and coded a bit to get that measurement.
The circuit and configuration bits are exactly same as the unipolar stepper driver post. The only difference is plugged the LCD to the connector.
This is the completed circuit.
I marked a small point at the staring point the given time using a marker pen. Using it I can count how many turns it rotated.
Here is the code The bolded lines are used to calculate and show the number of steps
sbit LCD_RS at RB5_bit; sbit LCD_RS_Direction at TRISB5_bit; void main() { int count=0; Lcd_Cmd(_LCD_CLEAR); for(;;){ delay_ms(10); porta.f7=0; delay_ms(10); portd.f4=0; |
I found out that it takes 120 steps to rotate a 360 degree full turn. That is simply 3degrees for a step. Impressive isn’t it ?
Comments