Shahariar
Published © GPL3+

DC Motors Controller Board

AVR ATmega32A MCU based, DC Motors speed/position/timing controller/testing board for Stepper, Servo, Gear motors and programmable too.

BeginnerShowcase (no instructions)3 hours4,815
DC Motors Controller Board

Things used in this project

Story

Read more

Schematics

Sch on Pic

Basic Sch, any MCU GPIO pin can drive these

Code

Mix of AVR and Arduino Style

Arduino
Programmed in Arduino IDE
#include <avr/io.h>
#include <util/delay.h>

// Step Sequence Generation for 4 Pole Stepper Motor !

int z =250;
int main()
{
DDRB |= 0x07;
PORTB &= ~(0x07);
while(1)
{
  for (int i=0;i<16;i++)
  {
    for(int j=0;j<3;j++)
    {
PORTB |= (1<<j);
_delay_ms(z);
PORTB &= ~(0x07);
    }
}
  
_delay_ms(500);
for (int i=0;i<12;i++)
  {
  for(int j=2;j>=0;j--)
    {
PORTB |= (1<<j);
_delay_ms(z);
PORTB &= ~(0x07);
    }

  }
}
 return (0); 
}

Credits

Shahariar
74 projects • 267 followers
"What Kills a 'Great life' is a 'Good Life', which is Living a Life Inside While Loop"

Comments