Fanatic Series
Published

Bluetooth Controlled Relays

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

EasyShowcase (no instructions)10 hours673
Bluetooth Controlled Relays

Things used in this project

Hardware components

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

Software apps and online services

LabVIEW Home Bundle
LabVIEW Home Bundle
mikroC PRO for PIC
MikroElektronika 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 • 9 followers
Electrical Engineer, who has worked on numerous HW/SW projects. He has worked as a Lead Researcher, Designer & Developer

Comments