Skip to main content

how to connect arduino to android via bluetooth

you need-

arduino uno or other arduino board
HC-05/HC-06 bluetooth module
jumper wire
9v power or battery

Download mobile app ardudroid or any other app from paly store

send serial data 1  --glow led
send serial data 0  -- put off led

blutooth module HC-05 password 1234

connection

vcc to 5v
GND to GND
RX to TX
TX  to RX







arduino code--



char data = 0;                //Variable for storing received data
void setup() 
{
  Serial.begin(9600);         //Sets the data rate in bits per second (baud) for serial data transmission
  pinMode(13, OUTPUT);        //Sets digital pin 13 as output pin
}
void loop()
{
  if(Serial.available() > 0)  // Send data only when you receive data:
  {
    data = Serial.read();      //Read the incoming data and store it into variable data
    Serial.print(data);        //Print Value inside data in Serial monitor
    Serial.print("\n");        //New line 
    if(data == '1')            //Checks whether value of data is equal to 1 
      digitalWrite(13, HIGH);  //If value is 1 then LED turns ON
    else if(data == '0')       //Checks whether value of data is equal to 0
      digitalWrite(13, LOW);   //If value is 0 then LED turns OFF
  }                            

}


upload this code to arduino

Comments

Popular posts from this blog

how to make 4x4x4 led cube using arduino

To make 4x4x4 led cube using arduino you need arduino uno or arduino nano 3.0

parts list -


Arduino uno or nano
Resistor 100 ohom x4
wire
vero board ( doted or line )

header male   L shaped

cardboard

& LED 64 piece defuse led any colour


Total making process  described in this video




Connection to arduino-



Download Arduino code

How to Decode any IR remote ( TV,DVD,AC any other)

Decoding IR remote

Using this tutorial you can decode any Ir remote Hex code.and we can apply it our project also like home automation,robot control etc.

You need-

Arduino Uno or any other arduino board

TSOP 1738 or 1838

small bread board

jumper wire

& for test a LED


At first you have to add a library ( Download from here)


after download unzip it & paste folder to arduino library folder




connect IR sensor to arduino like above  Schematic


Now upload first code to arduino

First code--

#include <IRremote.h>

int IRpin = 8;
IRrecv irrecv(IRpin);
decode_results results;


void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}  
void loop() 

{   
  if (irrecv.decode(&results)) 
    {
     Serial.println(results.value); // Print the Serial 'results.value'
      delay(10);

     irrecv.resume();   // Receive the next value
    }
}    



After this press any key on remote ,Hex code will show on serial monitor

copy hex code of any key in your choice


Now upload sec…

How to control light or fan using any IR remote (IC 4017)

using  this easy circuit you can use any IR remote like TV,DVD player to turn on & off

Parts List -

IC - CD 4017
IC - 7805 ( 5v regulator)

transistor - BC 548 B
                  BC 558

capacitor - 1000 mfd /16 v
                   100 mfd /16v

                      0.1um

resistor - 330 ohom x2
               1k,33ohm,220k

IR sensor TSOP 1738 or TSOP 1838

Diode   -  1N4007

Realy 6v


vero board,wire,




Circuit Diagram --

Pin out of transistor ,IC, Relay & IR sensor




                                                     You tube video ---