AC Motor Speed control with Smart Phone(Bluetooth Serial Application)









Download and Install Serial Bluetooth Application from the link below

https://drive.google.com/file/d/1fQAQ95veCc0LZDGkwJy_OXcFzulMHFOx/view?usp=sharing

//Arduino Sketch

#include <RBDdimmer.h>

#include <SoftwareSerial.h>

//#define mySerial  Serial

SoftwareSerial mySerial(11,10);

//connect RXD of Bluetooth module to D10 pin of Arduino and TXD of Bluetooth module to D11 of Arduino



dimmerLamp dimmer(5); //Connect PWM pin of Robodyne dimmer to D5 pin of Arduino and Z0 pin to D2 pin of Arduino

String msg; 

void setup()

  {

    mySerial.begin(9600); 

    //USE_SERIAL.begin(19200);

    dimmer.begin(NORMAL_MODE, OFF); //dimmer initialisation: name.begin(MODE, STATE)

    delay(50);

    dimmer.setPower(90);

    delay(50);

    dimmer.setState(ON);

  }


void loop()

{    

  

  if (mySerial.available())

  {    

      msg = mySerial.readString();

      int buf = msg.toInt();


      if (buf >9 && buf<=90)

      {        

                

        if (dimmer.getState()==0)

        {

          dimmer.setPower(buf);

          delay(50);

          dimmer.begin(NORMAL_MODE, ON);

        }else

        {

          dimmer.setPower(buf);         

        }

       

      }else if (buf <10 && buf>=0)

      { 

        if (dimmer.getState()==1)

        {

          dimmer.setState(OFF);

        }

     }

  }

}

Comments

Popular posts from this blog

Proteus simulation 4x4 Matrix Keypad with Arduino and LCD screen

Digital Clock with Arduino and RTC Module and P10 LEDmatrix

Interfacing KY038 sound sensor with Raspberry pi Pico