Tip:
Highlight text to annotate it
X
Hello, my name is Felipe. My name is Matheus.
My name is Desirée. And my name is Lucas.
And we are students in the 12th grade at CEFET, a professional High School in Nova Iguaçu, Rio de Janeiro, Brazil.
We are here to show you a Smart House project that we developed for a technology expo here at our school in 2012.
Many people from our class got involved in it at the time. We are just going to represent everybody.
Hmm... But what's a Smart House?
A Smart House is a house that allows automated interaction, easy user control via wireless network,
provides people convenience in carrying out simple tasks such as turning on and off lights
and appliances, monitor temperature and has many other uses.
Best of all, this project provides great accessibility for handicapped people on their own houses,
making their day-to-day lives easier.
So, this is our Smart House.
Here we have the living room,
and the bedroom,
here's the kitchen,
and the bathroom.
In the bathroom, we have the bathtub, and we can turn on the bathtub if we
block the light (you can use your finger), and by blocking the light in this photo sensor (LDR), it turns on.
And if you block the light again, it turns off.
You can also control the Smart House by a Smartphone.
Here we have a Smartphone, and here we have the option of the living room
This is a website we created for this project using PHP.
and here we can select to turn on the fan in the living room, like this.
And we can turn it off.
We can also turn on LEDs, or the lights we've put in the Smart House.
Here in the kitchen,
when you select the kitchen option,
here's the option to turn on or off the lights.
So you can turn on the lights
or turn off these lights.
But how did you make it?
To prove that you can also turn on real electronic devices, we have here
a 127W lightbulb (annex), and we can also turn it on using the website here.
So we can turn it on
and we can turn the annex off. That's it.
So, in the living room we have a RGB light.
You can turn it on with this remote control.
Turn on red, green, blue,
and you can mix colors too.
There's also a speaker, and you can turn it on, or off.
So, we can also check the house's temperature by
selecting this option. And then it says: 26.04 ºC.
This is the house's temperature.
As shown in the image, a mobile phone that allows access to the wireless network
connects and enters the network where the server is hosted, which is a local network.
Once connected, when we type the DNS server, we have access to a website that is the
interface to control the house, and when we chose any option to turn a household item, it sends a data
to the port that is connected to the Arduino, and it passes this value, which is interpreted in some routine
and generates an action in the house.
When we control, we send direct to the infrared receiver and then to Arduino, that generates an action in the house.
In our project, we used the C language for programming Arduino.
The features that we've implemented in the source code are very simple.
We'll show hereafter how we used this to build up our Smart House system.
As you can see, at the beginning of the code we setup the libraries we'll use.
The first, 'math.h', serves to help the microprocessor to do a few mathemathical calculations,
and the second serves for the implementation of the infrared sensor.
The following is the initialization of variables that represent the Arduino pins and Smarthouse devices.
After that, we have the functions 'setup()' and 'loop()'.
Setup is the program initialization in Arduino, while the algorithm in the Loop function is the
routine that'll be repeated several times during processing.
In the setup function, we have the statements that declare the Arduino pins we'll use as OUTPUT
and the setup of the serial communication baud rate to 9600, which allows us to communicate
with the serial port of the Arduino via the Serial Monitor.
In the loop function, we read the analog port of the LDR and verify this reading for the system to identify
whether or not the bathtub was activated.
It's very simpĺe: if not, the tub turns on. Else, it turns off.
The following is a routine that compares the infrared value read by the receiver with a known value
and verifies if they match, activating a respective device (LED or RGB tape, for example).
Then we have the temperature reading from the serial port, if it is available.
A simple loop (for) calculates the average of the last 10 captured temperature values
and returns that result to the serial port as the estimated current temperature.
Finally, there's a check of the values written on the serial port.
If the value is the character 'a', for example, the fan is turned on in the living room,
whereas if the value is the character 'b', it will be switched off, and so on for the other devices.
Now we will see a bit of the source code from the website we developed for this project.
We'll show only snippets of the PHP implementation.
In this section of the page that represents the living room, we have the variable '$modo' that receives the value sent from the form page
by using the method 'POST'. This value represents one of the letters seen in the Arduino routine which,
when written on the serial port, will switch a device on or off.
The port being used by the Arduino is also included on the code, so that the values
can be well written in it through PHP itself. From there we open a communication with that
port (fopen) to initialize the writing process.
It's then verified if the values that will be written on this port are correct and the writing is performed,
which triggers certain device in the Smarthouse.
Now, for the temperature, unlike other devices, it is necessary to read the serial port, not to write in it.
We do this using the 'fgets()' function, and, after that, the value is displayed on screen.
This circuit sums up all of the Smart House's operations.
ATMEGA328, represents the brain of the Arduino Board. It contains the routines that the Arduino will run and it is
responsible for communicating with the server, and through this one, receives the information from the site that will reference
you as to what will be controlled at home.
The ports begginning with the letter 'A' represents analog ports, GND = Ground, VCC = 5V and the other ports are all digital.
ANNEX
That's the main part of this circuit and it's what really proves the possibility of this project being implemented in full scale.
As you can see, this part of the circuit is responsible for allowing Arduino to release a higher voltage than that which it works,
via a relay, and a TIP122 transistor. The Arduino releases a 5v voltage for the transistor, which polarizes
the low voltage, and releases its reference voltage to the relay, which also triggers the 12v and closes the switch on its other side,
where one of the phases of the light bulb is on, operating at 127V AC.
As the light bulb has only one of the phases, when the other is released, the light bulb turns on.
LEDs
In our Smarthouse project, the LEDs represents the light bulbs of the rooms.
They are turned on directly on the Arduino Board via a 470 oms resistor.
RGB LED TAPE
This tape produces the primary colors and are controlled by the remote control.
When you press one of the buttons on the control, it sends a value to the infrared receiver, and the Arduino reads these values and
associates according to the value corresponding to the color, and these LEDs work with 12v DC, therefore,
there's a transistor TIP122 between the Arduino Board and the LEDs.
SPEAKER
For the speaker, we used the same circuit of the Annex, using DC and TIP122, so that instead of AC power,
we've put the data flow into a cable with a P2 stereo connector connected to the smartphone and the relay, that when activated by remote control via the
infrared receiver (photodiode), closes the switch, allowing the data to flow to the speaker, and so, playing music.
BATH
This part is practically identical to the circuit of the Annex.
The difference is that it binds a water pump, operating the tub, and is triggered by a light sensor (LDR).
This light sensor, when subjected to blackout, sends information to the Arduino Board, telling that the
light was completely omitted, and the Arduino releases the relay, powering the pump.
THERMOSENSOR
This temperature sensor, LM35, expands under the increase in temperature.
When it expands it ends up increasing in size and the resistance begins to vary, providing information for the Arduino routine, based in such variation,
turning the values to Celsius degrees, so whenever a request is made on the site, these values are updated again.
Well, that's all.
We hope you like it.
Thaks very much for watching.
Goodbye!