Friday, November 18, 2016

Kendali Motor DC sederhana menggunakan ICL293D dengan ATMega8535 - ELECTROZE


  1. Assalamualaikum


Halo :D saya akan berbagi tentang bagaimana cara membuat Kendali Motor DC sederhana menggunakan ICL293D dengan ATMega8535. rangkaian ini berfungsi untuk mengontrol 2 buah motor dc. oke disimak ya,  berikut ini bahan - bahanya

Kendali Motor DC sederhana menggunakan ICL293D dengan ATMega8535

  1. ATMega 8535 satu buah
  2. Capacitor 22pF dua buah
  3. Capcitor 10uF dua buah
  4. Crystal
  5. Resistor 10k satu buah
  6. IC L293D Satu buah
  7. Motor DC 2 buah
Buat skema nya seperti gambar di bawah, PORTB digunakan sebagai input untuk IC L293D.

Kendali Motor DC sederhana menggunakan ICL293D dengan ATMega8535

dan ini list programnya, menggunakan bahasa C( Atmel Studio)

===================================================
#ifndef F_CPU
#define F_CPU 16000000UL // 16 MHz clock speed
#endif

#include <avr/io.h>
#include<util/delay.h>
/*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/

int main(void)
{


DDRB=0x0f;
/*PB0,PB1,PB2 and PB3 pins of PortB are declared output ( i/p1,i/p2,i/p3 and i/p4 pins of DC Motor Driver are connected)*/
/*Start of infinite loop*/
while(1)
{


PORTB=0x0A;
/*Motor will move in forward direction*/
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
/*Motor will move in forward direction for 2s*/
PORTB=0x02;
/*Motor will move in left direction*/
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
/*Motor will move in left direction for 2s*/
PORTB=0x08;
/*Motor will move in right direction*/
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
/*Motor will move in right direction for 2s*/
PORTB=0x05;
/*Motor will move in reverse direction*/
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
/*Motor will move in reverse direction for 2s*/
PORTB=0x0f;
/*Robot will stop*/
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
/*Motor will stop for 2s*/


}


}
===========================================================

rangkaian ini masih sangat sederhana hanya berfungsi untuk memutar motor dc secara clockwise / anticlockwise, selamat mencoba, semoga bermanfaat.

Wassalamualaikum

0 comments:

Post a Comment