Blu - LED's

by Arix_ank in Circuits > Arduino

289 Views, 1 Favorites, 0 Comments

Blu - LED's

BluLed.png
Bluetooth Controlled LED's - powered by arduino !

There are so many instructables on the web , but this is the most simplest and easiest to upgrade further !!

Supplies

  • Arduino UNO | Amazon
  • Bluetooth Module | Amazon
  • LED's | Amazon
  • Arduino IDE
  • A smart phone or your laptop

Setting Up Circuit Connections !!

CircuitRigs_bb.png
CircuitRigsBLE_bb.png
20191108_153625.jpg
  • Set up the led connection as shown in diagram !!
  • Skip to step 3 and come back again !
  • Connect Bluetooth after uploading the program !!

NOTE : Please connect the Bluetooth module as directed :

RX of Bluetooth module goes to TX of arduino board!

TX of Bluetooth module goes to RX of arduino board!

You are almost done !!

Download the app , to control your project !!

Connect to the app and bingo , you are done !!

Downloads

Copy the Program Here !!

Bluetooth Controlled LED's - powered by arduino !
/* ©Compiler Bro's  */


#define ledPin 8

//
Intially define the state to be zero!


int  state =  0;


void setup() {
  

  // put your setup code here, to run once:
  //Set up a communication between arduino and your system
  
  Serial.begin(9600);
  Serial.println("Connected!!");
  pinMode(ledPin , OUTPUT);
  digitalWrite(ledPin , LOW);
}

void loop() {
  // put your main code here, to run repeatedly:
  
  if (Serial.available() > 0)
  {

    state = Serial.read();
  }
  if (state == 'A')
  {
    digitalWrite(ledPin , LOW);
    Serial.println("LED : OFF");
    state = 0;
  }
  else if (state == 'B')
  {
    digitalWrite(ledPin , HIGH);
    Serial.println(" LED : ON");
    state = 0;
  }
}