Fanatic Series
Published

Bluetooth Controlled Relays

Remote controlled relays using Bluetooth HC-05, PIC microcontoller and LabVIEW.

BeginnerShowcase (no instructions)10 hours1,645
Bluetooth Controlled Relays

Things used in this project

Hardware components

Bluetooth Low Energy Module
Tessel Bluetooth Low Energy Module
×1
Relay (generic)
×1
Microchip PIC Microcontroller 18F2550
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×1

Software apps and online services

LabVIEW Community Edition
LabVIEW Community Edition
mikroC PRO for PIC
MIKROE mikroC PRO for PIC
Circuit Maker
CircuitMaker by Altium Circuit Maker

Hand tools and fabrication machines

Drill Taps
OpenBuilds Drill Taps
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Bluetooth Controlled Relay Board Schematic File

Code

Bluetooth Controllerd Relays

C/C++
MikroC Code for PIC 18F2550
char uart_rd;
char rrdd;
unsigned int temp=0;
unsigned int counter=0;

void main() {
 ADCON1=0x00;
 TRISB=0x00;
 PORTB=0x00;
  UART1_Init(38400);               // Initialize UART module at 9600 bps
  Delay_ms(100);                  // Wait for UART module to stabilize

  UART1_Write_Text("Start");

 //  temp=0;
  while (1) { 

  int num;
  if(counter==60000)
                   {
                     num=temp;
                     num=num+48;
                       rrdd=(char)num;
                         UART1_Write(rrdd);
                         // delay_ms(1000);
                         counter=0;
                    }
                    counter++;
                // Endless loop
    if (UART1_Data_Ready()) {     // If data is received,
      uart_rd = UART1_Read();     // read the received data,
      UART1_Write(uart_rd);       // and send data via UART
      temp=(int)uart_rd;
      temp=temp-48;
      temp=temp*16;
      PORTB=temp;

    }
    

  }
}

Credits

Fanatic Series

Fanatic Series

5 projects • 24 followers
Electrical Engineer, who has worked on numerous HW/SW projects. He has worked as a Lead Researcher, Designer & Developer

Comments