5HP Motor speed control by arduino.










By using Arduino we control 5HP Dc motor in easy way


CIRCUIT DIAGRAM :




ARDUINO CODE:


#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
 
const int currentPin = A0;
const int pot=A1;

int sensitivity = 66;
int adcValue= 0;
int adcValuee= 0;
int offsetVoltage = 2500;
double adcVoltage = 0;
double currentValue = 0;
double sensorValue=0;
int ledPin=13;
float ton=0;
float toff=0;
float duty=0;
 
void setup() 
{
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.print("DC speed control ");
  lcd.setCursor(0,1);
  lcd.print("  with Arduino  ");
  pinMode(ledPin,OUTPUT);
  delay(400);
   lcd.clear();
}
 
void loop()
{   
  adcValue = analogRead(currentPin);
  adcValuee = analogRead(pot);

  
     ton=1024-adcValuee;
     toff=adcValuee;
    float y=ton=+toff;
     float xx=ton/y;
     float duty=xx*100;
     
     

     
  adcVoltage = (adcValue / 1024.0) * 5000;
  currentValue = ((adcVoltage - offsetVoltage) / sensitivity);
  Serial.print("Raw Sensor Value = " );
  Serial.print(adcValue);

    
  lcd.clear();
  Serial.print("\t Current = ");
  Serial.println(currentValue,3);
    Serial.print("\tduty= ");
  Serial.println(duty);
  lcd.setCursor(0,0);
  lcd.print("Current =       ");
  lcd.setCursor(10,0);
  lcd.print(currentValue,2);

   
   
     lcd.setCursor(0,1);
  lcd.print("%D cycle=       ");
   lcd.setCursor(10,1);
    lcd.print(duty);
 
  delay(100);

  
    digitalWrite(ledPin, HIGH);

  delay(1024-adcValuee);
 
  digitalWrite(ledPin, LOW);

  delay(adcValuee);

}

Comments