SandroMesquitaPixelsEscola
Published © GPL3+

Power extension comanded per Bluetooth®

An extension of power that can turn on / off any appliance connected to it through Bluetooth® communication. Using recyclable material.

BeginnerProtip521
Power extension comanded per Bluetooth®

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Elegoo Relay Module four Channel
×1
Samsung Phone Charger 5V
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×3
Jumper wires (generic)
Jumper wires (generic)
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1

Software apps and online services

MIT App Inventor
MIT App Inventor

Hand tools and fabrication machines

Plier, Long Nose
Plier, Long Nose
Plier, Needle Nose
Plier, Needle Nose
Soldering iron (generic)
Soldering iron (generic)
Solder Dispenser, Solder-Mate
Solder Dispenser, Solder-Mate
Tape, Electrical Insulation
Tape, Electrical Insulation

Story

Read more

Schematics

Schematic of the extension of energy

Wiring diagram

Wiring diagram of the project of extension of energy with bluetooth

Code

Code of the power extension

Arduino
#include <SoftwareSerial.h>
#define GERAL 9
#define T1 12 
#define T2 11
#define T3 10
#define LEDGERAL 8
#define LEDT1 7
#define LEDT2 6
#define LEDT3 5
SoftwareSerial bluetooth(4,3);

char comando;

void setup() {
    bluetooth.begin(9600);
    for(int i=5;i<=12;i++)
    {
      pinMode(i,OUTPUT); 
    }
     digitalWrite(GERAL,HIGH);
     digitalWrite(T1,HIGH);
     digitalWrite(T2,HIGH);
     digitalWrite(T3,HIGH);   

}

void loop() {
  if(bluetooth.available()>0){

    comando = bluetooth.read();
    // Rele Geral
    if(comando == 'A')
    {
     digitalWrite(GERAL,LOW);
     digitalWrite(LEDGERAL,HIGH);
    }
    if(comando == 'a')
    {
      digitalWrite(GERAL,HIGH);
      digitalWrite(LEDGERAL,LOW);
      digitalWrite(T1,HIGH);
      digitalWrite(LEDT1,LOW);
      digitalWrite(T2,HIGH);
      digitalWrite(LEDT2,LOW);
      digitalWrite(T3,HIGH);
      digitalWrite(LEDT3,LOW);
    }
    
    //Tomada 1
     if(comando == 'B')
    {
     digitalWrite(T1,LOW);
     digitalWrite(LEDT1,HIGH);
    }
    if(comando == 'b')
    {
      digitalWrite(T1,HIGH);
      digitalWrite(LEDT1,LOW);
    }

     //Tomada 2
     if(comando == 'C')
    {
     digitalWrite(T2,LOW);
     digitalWrite(LEDT2,HIGH);
    }
    if(comando == 'c')
    {
      digitalWrite(T2,HIGH);
      digitalWrite(LEDT2,LOW);
    }


    //Tomada 3
     if(comando == 'D')
    {
     digitalWrite(T3,LOW);
     digitalWrite(LEDT3,HIGH);
    }
    if(comando == 'd')
    {
      digitalWrite(T3,HIGH);
      digitalWrite(LEDT3,LOW);
    }
   
  }
}

Credits

SandroMesquita

SandroMesquita

14 projects • 92 followers
Professor de robótica com Arduino e Raspberry, estudando e aplicando conhecimentos de I.A. usando a Linguagem Python como base.
PixelsEscola

PixelsEscola

14 projects • 58 followers

Comments