Get Started with bluetooth module and arduino

on Sunday, May 31, 2015





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

15 comments:

Wandile Magagula said...

thanks

peace said...

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

Dexter fresh said...

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?

DELTAWIDE INFOMEDIA said...

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

Shreyash Gupta said...

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

Unknown said...

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

Dariusz said...

Super project!!

Dariusz said...

Super project!!

vinay kumar said...

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 :)

kevin said...

great arduino videos, you should join at computer aided automation

Ankit shah said...

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"

Unknown said...

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

George Bashar said...

thank u....

George Bashar said...

can i input both code in arduino same time?

dinesh kumar said...

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

Post a Comment