We are already at the beginning of the 21st century, and the future that was announced some years ago as "Blade Runner", with amazing flying cars or intelligent robots, beautiful and sensitive (however, make no mistake, some also had a lot of bad blood) exists, but, as we will see below, the housing of our days, yes it could resemble quite augur the future futurist cinema. The ideal house, that in which we can fully enjoy our leisure time without having to worry about cleaning, putting washing machines or knowing if you have to make the purchase, is already a reality thanks to the new information and communication technologies.
What Is Domotica?Science and the elements developed by it that provide some level of automation or automation within the home; being able to be from a simple timer to turn on and off a light or device at a specific time, to the most complex systems capable of interacting with any electrical element in the house. Home automation is, therefore, one that integrates a series of automations in the fields of electricity, electronics, robotics, information technology and telecommunications; with the aim of ensuring the user an increase in comfort, safety, energy savings, communication facilities, etc.
Home automation systems can be introduced both in the existing housing, as in the new construction housing, being in the latter case the introduction obviously cheaper. The current offer of home automation products and services is attractive and adapts to any home or building topology (private homes, offices, hotels, hospitals, schools, universities, etc.), either existing or newly built.
This time we will see how to implement it in a very simple way!First Step: Model
We make a structural model in which we want to apply the home automation system.
Second Step: ConnectionsBLUETOOTH HC-05
VCC - to Arduino VCC.
GND - to Arduino GND.
RX - to digital pin 0 (pin TX) of Arduino.
TX - to digital pin 1 (pin RX) of Arduino. (connect pin RX and TX after loading the code)
LED
Positive terminal - pin 8 of Arduino.
Negative terminal - GND of Arduino.
NOTE: YOU MAKE THE SAME CONNECTION FOR THE LEDS THAT YOU WANT IN AN ARDUINO DIGITAL PIN.
Open Arduino IDE and load the following code:
void setup() {
Serial.begin(9600);
pinMode(8, OUTPUT); // put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()>0)
{
char data= Serial.read(); // reading the data received from the bluetooth module
switch(data)
{
case 'a': digitalWrite(8, HIGH);break; // when a is pressed on the app on your smart phone
case 'd': digitalWrite(8, LOW);break; // when d is pressed on the app on your smart phone
default : break;
}
Serial.println(data);
}
delay(50);
}
NOTE: FOR EACH LED THAT YOU WANT TO ADD, ADD THIS TO YOUR CODE:
if(Serial.available()>0)
{
char data= Serial.read(); // reading the data received from the bluetooth module
switch(data)
{
case '?': digitalWrite(#, HIGH);break; // when a is pressed on the app on your smart phone
case '?': digitalWrite(#, LOW);break; // when d is pressed on the app on your smart phone
default : break;
}
Serial.println(data);
}
delay(50);
You change the questions (?) By letters and the numerals (#) by the digital port to which you are connecting the led.
AFTER CHECKING AND COPYING THE CODE, WE CONNECT ARDUINO:
- Download the app called BlueControl (It’s free). Play Store!
- Open the app Blue control (It will automatically turn on the device’s Bluetooth). Go to options. Click on “Connect to Robot”. Choose the device – HC 05.
- When you are connecting to the Bluetooth module for the first time, it will ask you the password. Enter 0000 OR 1234.
- When the device gets successfully paired with the sensor, the LED lights on sensor will start blinking at a slower rate than usual.
Home automation is understood as the set of systems capable of automating a home or building, providing energy management, security, comfort and communication services. These systems are usually integrated by means of communication networks (indoor and outdoor, wired or wireless) that allow control from inside and outside the home. Home automation makes use of technologies such as information technology, electronics and ICT (computer technologies). information and communications). The subject Domotics and Inmotics is an optional subject of mostly practical nature and aims to give the student a global perspective of the technologies used in this field and acquire the necessary skills to carry out real projects of home automation installations. The development of generic skills and competences such as teamwork, autonomous learning and the ability to apply knowledge to practice is also encouraged.
Comments