Wednesday, September 28, 2016

Speed Control of DC motor using Microcontroller and motor driver L293

Using Microcontroller we can easily control or interface a DC motor with direction control. but if we wants to control the speed of a DC motor. in DC we are use PWM technique to control average power delivered to load. so also here we use PWM technique to control speed o a DC motor. in motor driver L293 first & ninth pin are enable pin.
L293D pin diagram

       the first pin EN1 is use to enable IN1 & IN2 pin to get input and same as EN2 is use to enable IN3 & IN4 pin. if we simple drive a DC motor we connect these both pin to +5V applied at 16th pin
of L293.but to control speed of DC motor we are connect these both pin to PWM pins of Microcontroller.then we can simple control the speed of DC motor by control the Duty cycle.

Saturday, September 10, 2016

IR Module

IR Module is a module which is use to detect obstacle.An IR module uses a comprator. which is use to compare the output of photodiode with output of preset. when output of photo diode is greater than the voltage applied at non-inverting pin of comparator, the output of comparator is goes to high. but if output of photo diode is not exceed the output of preset then the output of comparator is zero volt.




Circuit of IR Module
The output of photo diode is changes with change in intensity of incoming ir Light coming from IR LED. ir light is reached at photo diode after reflection by object placed in front of ir module.
so we can change range of ir module by change in voltage applied at non-inverting pin.

Saturday, September 3, 2016

Speed Control of Stepper Motor using PIC microcontroller

To control the speed of unipolar stepper motor we use a Microcontroller to control the activation and also control activation time. ULN2003 is used as current amplifier. Preset use to control speed of motor


Circuit to speed control of stepper motor


connection of stepper motor
connection of stepper motor to control circuit



1 - coil 1
2 - coil 2
3 - coil 3
4 - coil 4
&
5 - CMN

CODE:-

unsigned short i,k;                            // Globle variable initialisation

void delay(unsigned short j)                                   // Delay function
{
 for(i=0;i<=j;i++)                        // For loop to generate multiple delay
 {
  delay_ms(1);                                                      // delay 1ms
 }
}

void main()                                                     // Main function
{
 ANSEL = 0x00;                                      // Analog selection register
 TRISA = 0x07;                                // Input/output selection register
 TRISC = 0x00;                                // Input/output selection register
 PORTC = 0x00;                                  // Default PORTC all output zero

 a = 0;                                                        // bit a is clear

 ADC_Init();                                                   // initialise ADC

 while(1)                                                            // Inf loop
 {
  k = 20 - ADC_Read(0)/60;   // Formula to generat delay by read ADC at analog 0

  PORTC=0x01;                       //
  delay(k);                         //
  PORTC=0x04;                       //
  Delay(k);                         // 
  PORTC=0x02;                       //
  Delay(k);                         //
  PORTC=0x08;                       //
  Delay(k);                         //
 }
}