Smart Room







A Brief Description

Required Equipments

How it works?

Block Diagram

Algorithm

Detailed Pin Diagram

Problems Faced

Video

Group Members Information

Course Teacher






A Brief Description


In this Project we have designed an embedded system which automatically controls lights, fans, air conditioners, water heaters etc household appliances inside a room based on the presence of humans. The system also includes a GSM module, which enables the user to control the household appliances by sending a message, which overrides the automatic control.






Required Equipments







How it works?


In this project, two Arduino Mega microcontrollers are used. The first Arduino takes input data from various sensors - three sonar sensors, a light sensor, a temperature sensor, and is responsible for controlling the outputs, i.e, the light and fan demonstrations. The light sensor has to be placed just outside the window of the room, which will measure the amount of sunlight. The temperature sensor has to be placed inside the room and the three sonar sensors are placed consecutively just after the entrance of the room, which counts the number of humans. This Arduino is also connected to the second Arduino, which is responsible for receiving message via GSM module.

Initially, when the system is turned on, the system is controlled automatically. Initially, the system assumes that there are no humans in the room. So, the light and fan demonstrations will remain off. When a human walks in or out, the three sonar sensors take note, and by internal calculation, it is determined whether the person has walked in or out. Depending on that, human count is increased or decreased. If human count is more than one, the light and fan will work according to their respective sensor values. For example, if there is strong sunlight just outside the room, the light will be off, and if there is dark outside, the light will be on. Similarly, if the temperature inside the room is high, the fan demonstration (a light bulb in reality), will glow brighter (indicating the fast rotation of fan). If the temperature is moderate, the fan demonstration bulb will glow softly, and if the temperature is low, the fan demonstration bulb will be off.

However, if the user wants, he/she can instruct the system to ignore the automatic control, and keep the light or fan, or both, switched on or off. The user can do this by sending an sms to the GSM module, which is controlled by the second Arduino. After the user sends a message, he has to call the number to activate the sms system. The message will be processed only if the number matches a prerecorded number (that of the valid user). Then the message is processed, and the Arduino signals the first Arduino, which then executes the command. The commands for light are, L0 (light off), L1 (light on) and LX (transfer control of light to automatic system). Similarly, the commands for fan are, F0 (fan off), F1 (fan on) and FX (transfer control of fan to automatic system). If the user sends L0, then light will be off even if human count is more than one. Similarly, if he sends L1, the light will be off even if human count is zero. Once the user instructs the system to turn on/off the light/fan, the control will not be transferred to the automatic system unless he sends an sms with LX/FX.

In this project, we have demonstrated the use of sms to control a light and a fan. However, in a real-life scenario, this will be applicable in case of a room heater, or an air-conditioner. Since our demonstration was small-scale, we chose to show the control using two light bulbs.






Block Diagram




                                                                                                        pin diagram

                                                                                                                                       fig.1 Block Diagram






Algorithm



Algorithm1 for Arduino controlling Light Fan




       1.Start
              2.If any human enters or leaves the room, the sonar sensors respond and update the human count in the room.
              3.If any human is present in the room,
                     4.Turn on the fan regulator circuitry. Fan regulation is done automatically on the basis of temperature.
                     5.If there is not enough light in the room, light will be turned on automatically.
              6.If the human leaves the room
                     7.The light and fan will be automatically turned off.
              8.If this arduino receives control signal from the GSM controlling arduino, then fan and light is controlled based on the received signal's mode.
              9.The control signal based on users' selection has priority over sensors' data.
       10.End


Algorithm2 for Arduino controlling GSM




       1.Start
              2.GSM module's receiver turned on
              3.GPS receiver remains turned off
                     4.GSM waits for phone call
                             5.If receives a request
                                       6.If the request is valid
                                             7.Turn off the GSM receiver
                                             8.Turn on GPS receiver
                                             9.Set text mode to receive sms
                                             10.Read sms
                                             11.Turn off GPS receiver
                                             12.Turn on GSM receiver
                                             13.Parse data, get the sender's phone number and sms command
                                             14.If number from the intended sender then output necessary signal corresponding to the text command
                                       15.Else go to(4)
                             16.Else go to(4)
       17.End






Detailed Pin Diagram




                                                                       pin diagram

                                                                                                                                                   fig.2 Pin Diagram(GSM/GPS details omitted)





                                                                       pin diagram

                           ,                                                                                                                      fig.3 Circuit Diagram for AC voltage regulation circuit






Problems Faced


  1. The most diffiult problem we had to solve was to interface the Arduino with the GSM module. Since the GSM module was quite tricky to work with, we got it right after plenty of trial and errors.

  2. We had to observe the strings the GSM module gave in reply of different AT commands. We had to receive every reply carefully otherwise the device's behavior becomes unexpected.

  3. Another big problem was the AC voltage regulation circuitry. A while after the circuit started working, it heated up the light bulb and caused the bulb to burst, which could have been extremely harmful.

  4. Even though the temperature sensor worked correctly during the individual block testing, its behaviour became unpredictable after assembling the whole circuit, and it gave garbage output sometimes.

  5. We initially planned to work with a single Arduino. However, the call processing part of GSM took a long time inside the loop, and the sensors weren't getting the time required for them to work smoothly, and thus the whole system became slow. Therefore, we decided we work with two Arduinos, which managed to speed up the system.

  6. Since we had to deal with AC power, it was quite a challenging task for us.






Video







Group Members Information


Section A2: Group 6






Course Teachers


  1. Mohammad Saifur Rahman

  2. Md. Aashikur Rahman Azim

  3. Md. Iftekharul Islam Sakib





Back to top