Bluetooth Home Automation Device Control by Smartphone
Bluetooth Home Automation Device Control by Smartphone
http://www.jlcpcb.com
Hello Dear Friends!
Welcome to another project tutorials. In this blog tutorial, I am going to share with you how to make a four-channel home automation controller. This is a really easy process. At first, I design the PCB file from http://www.easyeda.com then I order from PCB files http://www.jlcpcb.com .
The JLCPCB is very professional & wonderful. Then I am making a program from RemoteXY.com. This site is amazing. You don't need to learn programming knowledge. Just drag & drop icons then this site automatically generates the program code for you. Then you easily use this code on your Arduino IDE.
📌JLCPCB $2 for 5 Pcs 2 Layer Prototype/ 4 Layer PCB Prototype: https://jlcpcb.com
Hello Dear, Welcome to the new blog. In this video tutorial, I will show you How to make a dual channel Bluetooth controller module. This really simple project. I am using dual-channel relay but you can use quad-channel or octal channel relay. I am a simulation circuit diagram from easyeda.com for simulate circuit & design PCB file. for the programming section, I am using the remotexy.com website which is a cool website for automatically generate code. Parts list below.
The Parts required for this Project
1. Atmega 328p IC
2. Relay 05Vx2
3. Transistor BC547
4. Resistor 1K x5
5. Resistor 10K x1
6. LED
7. HC05 Bluetooth Sensor
8. IC Base 28 Pin
9. AC Terminal Block 2pin x2
10. AC Terminal Block 3Pin
11. 22pf Capacitor
12. 10uf, 50V Capacitor
13. Female to Male IC Rail
14. 1N4007 Diode
15. 16Mhz Crystal
16. AC Lamp x2
Code:
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,37,0,10,13,0,
2,0,21,16,22,11,2,26,31,31,
79,78,0,79,70,70,0,2,0,52,
17,22,11,2,26,31,31,79,78,0,
79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t switch_1; // =1 if switch ON and =0 if OFF
uint8_t switch_2; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_SWITCH_1 13
#define PIN_SWITCH_2 12
void setup()
{
RemoteXY_Init ();
pinMode (PIN_SWITCH_1, OUTPUT);
pinMode (PIN_SWITCH_2, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_2, (RemoteXY.switch_2==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,37,0,10,13,0,
2,0,21,16,22,11,2,26,31,31,
79,78,0,79,70,70,0,2,0,52,
17,22,11,2,26,31,31,79,78,0,
79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t switch_1; // =1 if switch ON and =0 if OFF
uint8_t switch_2; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_SWITCH_1 13
#define PIN_SWITCH_2 12
void setup()
{
RemoteXY_Init ();
pinMode (PIN_SWITCH_1, OUTPUT);
pinMode (PIN_SWITCH_2, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_2, (RemoteXY.switch_2==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
You should download the library file from remotexy.com.
No comments