UniStarUniStar
Published © GPL3+

Led Control with hc-05 Bluetooth module

Learn how to control an led with your hc-05 Bluetooth module.

BeginnerFull instructions provided644
Led Control with hc-05 Bluetooth module

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Development Kit Accessory, Jumper Wire Kit
Development Kit Accessory, Jumper Wire Kit
×1
LED (generic)
LED (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×2
Through Hole Resistor, 2 kohm
Through Hole Resistor, 2 kohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic -

Note :
The 2k ohm resistor connects between GND -> RX
The 1k ohm resistor connects between 11 -> RX

Code

Code -

Arduino
Change the RX and TX pins to fit
#include <SoftwareSerial.h>

SoftwareSerial bluetooth(10, 11); //RX, TX
char val;
int flag = A0;

void setup() 
{
  bluetooth.begin(9600);
  pinMode(flag, OUTPUT);
}

void loop() 
{
  if (bluetooth.available())
  {
    val = bluetooth.read();
    delay(10);
  }
  if (val == '1') analogWrite(flag, 255);
  else if (val == '0') analogWrite(flag, 0);
}

Credits

UniStar
0 projects • 1 follower
Contact
UniStar
0 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.