Get Started with bluetooth module and arduino






Hi everyone,

I am vigneshraja. here i present the code for interfacing arduino with bluetooth module like shown in above video.


Code for command mode control of arduino from phone:


int led = 13;
void setup()
{
  Serial.begin(9600);
 
  pinMode(led,OUTPUT);
  digitalWrite(led,LOW);
}
void loop()
{
 if(Serial.available())
 {
   String value = Serial.readStringUntil('\n');
   Serial.println(value);
   if(value == "on")
   {
     digitalWrite(led,HIGH);
   }
   else if(value == "off")
   {
     digitalWrite(led,LOW);
   }
 
 }
}



code for control arduino by voice from your phone:


int led = 13;
void setup()
{
  Serial.begin(9600);
 
  pinMode(led,OUTPUT);
  digitalWrite(led,LOW);
}
void loop()
{
 if(Serial.available())
 {
   String value = Serial.readStringUntil('\n');
   Serial.println(value);
   if(value == "*hello#")
   {
     digitalWrite(led,HIGH);
   }
   else if(value == "*1#")
   {
     digitalWrite(led,LOW);
   }
 
 }
}



                                                      Thank you for reading

Comments

  1. Great .I am from ANDHRA PRADESH.kadapa.nice we Indian doing and developing.what are your future projects

    ReplyDelete
  2. thanks dude! it works. do you have a cod to make more than one individually pin on? and is there a app that work with buttons?

    ReplyDelete
  3. Hi, Dinesh I am from West Bengal, I need some help regarding arduino. Please Help me. I am telling my full project description below.


    I have seen some of your videos and i think you can
    help me. What i want is that there is two channels right and left . In the right channel I will be playing a song, which song will be heard in both the stereo speaker. In the Left channel I will be playing a high frequency Beep sound which will not be heard in the speaker but when I will regulate the left channel sound .i.e when the level of the sound in the left channel will increase the light will increase ( It will send more voltage to the connected Led) and when it will decrease the light will decrease( It will reduce the voltage sent to the connected Led) It will function like a Dimmer. The Led which we are using 10 Watt 12 Volt Led and sound editing software is Abode premiere Pro. I hope that you can help me in this endeavor. I would be grateful if you could send a tutorial along with the code.

    Mriganka
    debnathmriganka2010@gmail.com
    09933144910

    ReplyDelete
  4. It doesn t worked . It showed void error
    WHat should i do
    please tell me

    ReplyDelete
  5. Hi, i'm new of arduino topic, I following your but i don't why it is not working, do you a diagram for the arduino conections, that you can show me? I will be aprecciate so much this help

    ReplyDelete
  6. hi Vignesh.
    I am planning to do the same using wifi esp8266.
    Could you please tell, what apps in Andriod are available for sending inputs to arduino using Android app.

    You can send me a mail to
    vinaystarkumar@gmail.com

    Adance Thanks :)

    ReplyDelete
  7. hello,
    i liked your concept very much.
    But can i know if you can help me in sending data from arduino through serial monitor to the mobile app?
    like if i press 1 in serial monitor the android app will show "on" and press 2 then "off"

    ReplyDelete
  8. Hi Vignesh,
    I am new to IOT.If you have any idea can you please tell me how can I Flash/Program Arduino with wakaama lwm2m client.

    Thanks in advance

    ReplyDelete
  9. hi...It doesn t worked in hardware
    WHat should i do
    please tell me

    ReplyDelete
  10. nice intro u gave about bluetooth module.. it took me a while to make a better use android and bluetooth module.

    ReplyDelete
  11. Can you write code for weighing machine

    ReplyDelete
  12. Can you write code for weighing machine

    ReplyDelete
  13. very good work but why did you write down the voice orders between '*' and '#' like "*hello#" or "*1#" ?
    Is it a standers Formula for the Android application it self ?

    ReplyDelete
  14. Thanks for this post, I really appriciate. I have read posts, all are in working condition. and I really like your writing style. Keep it up like.
    Buy Inverter Battery Online

    ReplyDelete

Post a Comment