bms system

Upload: engabubakr

Post on 11-Oct-2015

78 views

Category:

Documents


8 download

DESCRIPTION

The buttons on the development kit represents the switches that the guest has in the room. The board has 8 lights. Each light represents a switch below: a) AC b) Water heater c) Water line d) Room light e) Bed side lamp f) Bathroom light g) T.V. h) Minibar

TRANSCRIPT

Internship Final Report, 2013 At Hilton Al Hamra Fort Hotel

Supervised by : Prof . Mousa S.Mohsen Dean of School of Engineering

Submitted by : Abubakr Fuad Elsayed ID: 0910091 Department: Electronics and Communication EngineeringTable of contents Page No:1. Abstract ..42.Acknowledgement...43.Internship Site Overview54.Informative teaching sessions.6 4.1 Data centre6 4.1.1 Uninterruptable Power Supply (UPS)...6 4.1.2 Private Branch Automatic Exchange ( BX).6 4.1.3 Intermediate Distributing frame (IDF)..6 4.1.4 Dial Tone Multiple Frequency (DTMF)6 4.1.5 Keyboard Video Monitoring (KVM).75. Internship tasks and assignments..76.BMS Project10 6.1 Problem encountered...10 6.2 Solution..11 6.3 Atmel development kit.11 6.4 Serial Communication.13 6.5 Serial communication in the ATMEGA2560...13 6.6 The Timers...13 6.7Application of the program.15 6.8 C-code used. 16 6.9 Result277.Reference ...............................................................................................................30List of Figures : Page No:Figure 1 STK600 & ATmega 2560 (University of Victoria)......12Figure 2 ATmega 2560 .. 12

1. Abstract:Our main object in the summer as an Electronics and communication engineer student is to apply what we have learned in the class which is the theoretical understanding into practical. One of the main goals also was to observe the field of engineering so as to help determining the right engineering career field. It was a grate idea to do practical tranning in the field. It puts you directly into the real world experience of work, with all kinds of professionals that are qualified in doing what they do best.2.Acknowledgement:The internship has been a very productive journey, filled with great experiences in the field of engineering, where I explored and practiced all the theory and science that we learnt in the major of Electronics and Communication Engineering. It is a great pleasure to express my thanks and gratitude to all those who have helped us during this internship. I would also like to take this opportunity to thank my internship supervisors Mr. Mohammed Morgan Chief engineer of Al Hamra Fort Hotel and Mr. Philemon Dubois ,Maintenance Engineer at Al Hamra Fort Hotel and for their guidance and support in fulfilling the internship succesfully . I would also like to deeply thank the staff members of the engineering department as well the staff's from other department of the Al Hamra Fort Hotel of who helped us in the completion.Finally, I would like to thank my faculty internship advisor Prof. Mousa S. Mohsen for being available whenever I needed assistance.

3. Internship Site Overview:The summer internship lasted for six weeks, starting from the 11thof June 2013 and ending at 20th of July 2013. The internship was held by the Hilton organization at the branch of Al Hamra Fort Hotel and Beach Resort . I vowed to make the best out of it, so I spent most of my time with the engineers of the engineering department team and accompanied them mainly with the internship site supervisor, as they went over to tackle problems in almost every department of the hotel . As known that the two areas fundamental to all engineering are problem solving and design, I spent the first part of the internship mainly on problem solving circumstances and the other was devoted mainly to designing .Not to forget to mention different informative sessions , assignments ,tasks and responsibilities were given to me during the internship too which gave me more room for technical development as well as personal development. Some of my tasks consisted of assisting the engineers in solving problems in the data centre , supervising and assisting engineers and t.v. technicians in installing new t.v. in above 20 rooms in the hotel ,and finally being a part of a project of designing a system that we called it as a BMS system. I've also delved into a different field of electrical and mechanical engineering by also assisting the engineers in repairing generators ,air conditioning system, dish washing machine and sewage machine, where they gave me some knowledge about it.

4.Informative Teaching Sessions: 4.1 Data centre:In the data centre we learned about the data centre as a place where the servers and UPS are placed , in addition to that the cooling system was also placed. The floors in the data centre were raised to allow for the cooling purpose of the data centre. As temperature on the server was hotter at the bottom than at the top the cooling is done from bottom to top which was found to be more efficient. The device that does the cooling is called the Closed control unit or the CCU , which is used for accurate control of heat and humidity for critical applications like the servers that generates a lot of heat. 4.1.1 Uninterruptable Power Supply (UPS) :Uninterruptable power supply or the UPS , is used to maintain power in the server room. It is connected to the main power supply and the output is connected to the servers. When there is a shut down in the main power supply the UPS acts as a backup for almost a duration of one hour to allow between which the main power could be fixed. Usually during these time the engineers ask all the users to save their data so that no information is lost.4.1.2 Private Branch Automatic Exchange (PBX) :It is a device in which all the telephone lines are connected with one other4.1.3 Intermediate Distributing frame (IDF) : Intermediate Distributing frame or the IDF is a device that manages and interconnects the telecommunication cables between end user and the data centre. IDF is located under each floor of the building and connected to the data centre4.1.4 Dial Tone Multiple Frequency (DTMF): Dial Tone Multiple Frequency or DTMF, is a tone that is generated when dialing a number. Each number acts as a code which is received ,understood by the PBX which is later decoded and then allows the connection the branch that is asked for .4.1.5 Keyboard Video Monitoring (KVM):Keyboard video monitoring or the KVM ,is a device used to connect to any server by typing the code of the server. As seen by its name it consists of a keyboard , screen where the there is the display and the mouse for monitoring or controlling. 5. Internship tasks and assignments:* On the first day ,there was an emergency in which the generator of the sewage machine in the hotel stop working, so the internship supervisor had to find the solution to fix the problem immediately. He allowed me to join him in the emergency situation to help him fix the generator problem. There was a problem in several contactors and breakers in the generator. So he designed a circuit consisting of two breakers and three contactors which solved the issue. The contactor as my internship supervisor briefly explained was a switch .The breaker to also acted like a switch but when there is a problem , it switches off automatically .There was two breakers , one for the whole circuit and the other for a part of the circuit. The contactor was three in number when the power was supplied one of the contactor was always on and the third one started , and that was called the star effect , but when the third contactor was released the second contactor was connected after some time delay which could be controlled manually , this time it was called the delta effect in which the generator worked with maximum force. We tested the circuit and connect the wire of the circuit with a sample machine and it worked , so we then went to the site and fixed the generator. If the wiring of the circuit was connected in reverse order it would work reversely , so we had to check whether the circuit was reversed or not.

*Accompanied one of the engineer to fix several faulty air conditioners in around six rooms in the hotel. Some problem was there on the air conditional controller that was on the wall that we had to be replaced and some problem was at the compressor others were at the wiring of the generator circuit. *Went with my internship supervisor to one of the kitchens in the hotel as there was a problem in one of the washing machine .We later realized there was a problem in the main switch but not in the machine itself.

* With one of the administrator in the engineering department ,I did a task of collecting a permission form as a truck driver from one of the companies wanted to carry a golf car outside the hotel . The security had to be informed about the situation and then we finally went to get the signature from the chief engineer , which I finally gave to the truck driver that was then able to leave.

* Accompanied an engineer to deal with the complaints made by the hotel guests regarding a problem in some facilities of the hotel commonly in television., air conditioner and the drainage system. I have been asked also to join in dealing with the guests of the hotel to discuss with them the problem that they had.

* Had a teaching session with internship supervisor about the OSI layer model. And he taught me that software developer basically works with application layer, the IT knows how to control the link layer and finally the electronic engineer is the one that designs and creates and therefore needs to know about all the layers. * One of the compressor of an air conditioner was damaged and we had to fix the compressor the belonged to a company called trane and I assisted the intership supervisor to look for the datasheet. *Helped in repairing one of the television as there was a problem in digital channel viewing.* I had a task of supervising , the task was replacing and installing new television in each room along with some of the engineers and t.v. technicians after my internship supervisor showed me how did they do the process in around two rooms .Some room contained guests, others did not , so I had to be good in dealing with the guests if they were in the room. The list of the rooms where given to me, and I worked with some of the maintenance engineer and t.v. technicians together as a team. The task was done successfully.

* There was an emergency as the server room was locked we used a machine that programs the card to open a door using any type of connections using infrared and I was showed how to do the whole process.

*Volunteered in the activity of filling a snag list which making sure each and every item that is required in a room is present as per the policy of the organization. I did the task with the chief engineer and the internship supervisor along with my internship partner. After which me and my internship partner did it for the other rooms as well.* Did the assignment of calculating the power consumed in the room with the help of my internship partner to in the end submit it to the internship supervisor and used for knowing whether or not there is an overload.*One of the compressor of an air conditioner was damaged and we had to fix the compressor the belonged to a company called trane and I assisted the intership supervisor to look for the datasheet. *Helped in repairing one of the television as there was a problem in digital channel viewing.6.Building Management System (BMS) Project :6.1 Problem encountered :During our internship at Al Hamra Fort Hotel, we came to realize that at some hotels, the energy consumption rate by the guest were high. Which lead to lots of energy waste, and this was done by:1. Switching on all the lights in the room2. Opening all water valve and let the water flow out3. Leaving the T.V. switched on.4 . Leaving the electronic devices connected to electrical sockets.5. Moving out of the room, doing all of the above, closing the door and placing the 'do not disturb sign' (DND), on the room door, so that no staff is allowed to enter the room.At the end of the stay, the cost of waste was higher than what the guest payed to live in the room and out of that, the hotel had no control of the situation. 6.2 Solution:A solution to the problem was decided by implementing a system that will allow the hotel management to have a control over the situation, so thats why we with the help of the internship supervisor, came out with the system called Building Management System (BMS). This system has been implemented on an electronic development kit from Atmel and the objective of the system was to track what's happening in the room and give the management the power of control to save the energy in the room. I am going to present now the processor that we use to develop the system.The system implementation is around Atmel which has the following reference ATMEGA2560.6.3 Atmel development kit: STK600 is a reduced instruction set computer. It consists of a generic socket card, on which the AVR device could be inserted. It also consists of a device signal routing card, which routes the signals from the socket pins for providing different functions on the STK600 main based on the device inserted (Atmel). It also consists of RS-232 port, internal clock, CAN port using DE9 connectors. With the help of a programming language we are going to communicate with the board using RS-232 port a type of serial port that supports serial communication.

Figure 1: STK600 & ATMEGA 2560 (University of Victoria)

Figure 2 : ATMEGA 2560 microcontroller6.4. Serial Communication: Serial communication is often used to control or to receive data from an embedded microprocessor. Serial communication is forms of I/O in which the bits of a byte begin transferred appear one after the other in a timed sequence on a single wire. Serial communication is the standard for inter-computer communication. Serial communication, doesnt require a wire for each bit in order to transfer data. Only one single wire is required where the sender and receiver should agree to send and receive on the same frequency and phase using a created protocol. When both users is in level bit 1 then there the transmission turned off. If they at level bit 0, the system starts working. The process of the level falling from bit 1 to bit 0 is called Start Bit.The ATMEGA2560 is board supports microcontroller It is a reduced instruction set computer.Based on this I'm going to show the blog diagram out of which we have the timer , the PORT and The USART.6.5 Serial communication in the ATMEGA2560 :The serial communication or RS-232 port has a register named USART in ATMEGA2560 microcontroller must be activated. The USART has four registers but for this project we are going to use only USART 0 register. The USART is connected to PORT E of the microcontroller so this port must be connected to RS-232 in STK600 board to enable the serial communication.

6.6 The Timers :If software timer the processor is busy executing other commands, it is better to set up our hardware timer which is easier for processor to confirm the accuracy and precision of the timer. The Atmel microcontroller has two 8-bit timers, four 16-bit timers and real time counter. in our C program we did set up one of the 16-bit timer to work as a delay function.Below is the block diagram of the ATMEGA 2560 from the datasheet.

6.7Application of the program : The buttons on the development kit represents the switches that the guest has in the room. The board has 8 lights. Each light represents a switch below: a) AC b) Water heater c) Water line d) Room light e) Bed side lamp f) Bathroom light g) T.V. h) Minibar

We assume the system includes motion sensor, which we don't have on the board .This sensor tells you if there is anyone is in the room. If the sensor senses no one in the room then it is suitable to use BMS to switch off anything in the room and save up energy. The system is made in such a way that when you type Status, the board will check the status of the room. The board can detect whether any part of the room is on or off as we assigned a code corresponding to each button in the room. The board can not only check but can also switch on and off the switches in the room thereby giving the management the power of control over the room. Furthermore, a security feature was also implemented in the system and that is when we write a command that is not relevant to the system we created, the system responds back with We don't understand this comment". 6.8 C code used:/*********************************************************************************** Project : RS232 Serial Communication Using The USART0 on AVR Micro controller Version : 1.0 Date : 29-Jun-2013 Author : MALIK, ABUBAKAR , IMANE Instructor : Philemon Dubois Company : Al-Hamra Fort Hotel and AURAK. ********************** PROJECT INFORMATIONS ************************************* Chip type : ATmega2560 Program type : Application AVR Core Clock frequency : 15.360000 MHz Memory model : Small Program Memory Size : 256,000 Bytes Internal RAM Size : 8192 Bytes External RAM size : 0 Data Stack size : 2048 Bytes ***********************************************************************************/ #define F_CPU 15360000UL // Oscillator Frequency f0 #define PE_RX 0 // PE_RX IS THE BIT 0 OF THE PORTE #define PE_TX 1 // PE_TX IS THE TRANSMIT BIT OF THE USART0 #define Com_Port PORTE #define Framing_Error 4 #define Data_Over_Run 3 #define Parity_Error 2 #define UDR_Empty 5 #define True 0xFF #define False 0x00 #include #include void Port_Init(void); void Com_Init(void); void Clear_String(char *Temp); void Str_Copy(char *Source,char *Destination); void Timer_Init(void) ; void Light_String(char Direction); void Send_About_Me(void); void Send_String(char *My_String); void Pin_Change_Interutp_Init(void); void Blink_Port(char Key); void Port_Status(void); void Control_Port(char number,char value); void Init_me(void); char Str_Compare(char *Str1, char *Str2,int Length); int String_Length(char My_String[]); char RX_String[128], Rx_Buffer[128] ; // The # symbol will be taken as the end of message char Rx_Error = False ; int Rx_Char_Count = 0 ; char Mode = 0 ; char aware_of = False ; int T[20]; // Virtual Timers T9 = Serial Port Timeout ,

//************************* MAIN PROGRAM ENTRY POINT ***************************** int main(void) { cli(); Timer_Init(); Com_Init(); Port_Init(); Pin_Change_Interutp_Init(); Clear_String(Rx_Buffer); Clear_String(RX_String); T[5] = -1 ; PORTC = 0xFF; sei(); while(1) { if(T[5]== 0) { //**************************************** ABOUT US ***************************** if((Str_Compare(Rx_Buffer,"About us",8))&&(aware_of == False)) { Send_About_Me(); Rx_Char_Count = 0 ; Clear_String(Rx_Buffer); T[5] = -1 ; aware_of = True; } //**************************************** BLINK 1****************************** if((Str_Compare(Rx_Buffer,"Blink1",6))&&(aware_of == False) ) { Mode = 1 ; Rx_Char_Count = 0 ; Clear_String(Rx_Buffer); Send_String("Execution of Blink1 is in process\n"); T[5] = -1 ; aware_of = True; } //****************************************** BLINK 2*************************** if((Str_Compare(Rx_Buffer,"Blink2",6))&&(aware_of == False) ) { Mode = 2 ; Rx_Char_Count = 0 ; Clear_String(Rx_Buffer); Send_String("Execution of Blink2 is in process\n"); T[5] = -1 ; aware_of = True; } //********************************************* BLINK 3 ********************** if((Str_Compare(Rx_Buffer,"Blink3",6))&&(aware_of == False) ) { Mode = 3 ; Rx_Char_Count = 0 ; Clear_String(Rx_Buffer); Send_String("Execution of Blink3 is in process\n"); T[5] = -1 ; aware_of = True; } //******************************************* BLINK 4*********************** if((Str_Compare(Rx_Buffer,"Blink4",6))&&(aware_of == False) ) { Mode = 4 ; Rx_Char_Count = 0 ;

Clear_String(Rx_Buffer); Send_String("Execution of Blink4 is in process\n"); T[5] = -1 ; aware_of = True; } //*********************************STATUS*************************************** if((Str_Compare(Rx_Buffer,"Status",6))&&(aware_of == False) ) { Port_Status(); Rx_Char_Count = 0 ; Clear_String(Rx_Buffer); T[5] = -1 ; aware_of = True; } //******************************* PORT CONTROL ********************************* if((Str_Compare(Rx_Buffer,"P0=0",4))&&(aware_of == False) ){Control_Port(0,0);Init_me();} if((Str_Compare(Rx_Buffer,"P0=1",4))&&(aware_of == False) ){Control_Port(0,1);Init_me();} if((Str_Compare(Rx_Buffer,"P1=0",4))&&(aware_of == False) ){Control_Port(1,0);Init_me();} if((Str_Compare(Rx_Buffer,"P1=1",4))&&(aware_of == False) ){Control_Port(1,1);Init_me();} if((Str_Compare(Rx_Buffer,"P2=0",4))&&(aware_of == False) ){Control_Port(2,0);Init_me();} if((Str_Compare(Rx_Buffer,"P2=1",4))&&(aware_of == False) ){Control_Port(2,1);Init_me();} if((Str_Compare(Rx_Buffer,"P3=0",4))&&(aware_of == False) ){Control_Port(3,0);Init_me();} if((Str_Compare(Rx_Buffer,"P3=1",4))&&(aware_of == False) ){Control_Port(3,1);Init_me();} if((Str_Compare(Rx_Buffer,"P4=0",4))&&(aware_of == False) ){Control_Port(4,0);Init_me();} if((Str_Compare(Rx_Buffer,"P4=1",4))&&(aware_of == False) ){Control_Port(4,1);Init_me();} if((Str_Compare(Rx_Buffer,"P5=0",4))&&(aware_of == False) ){Control_Port(5,0);Init_me();} if((Str_Compare(Rx_Buffer,"P5=1",4))&&(aware_of == False) ){Control_Port(5,1);Init_me();} if((Str_Compare(Rx_Buffer,"P6=0",4))&&(aware_of == False) ){Control_Port(6,0);Init_me();} if((Str_Compare(Rx_Buffer,"P6=1",4))&&(aware_of == False) ){Control_Port(6,1);Init_me();} if((Str_Compare(Rx_Buffer,"P7=0",4))&&(aware_of == False) ){Control_Port(7,0);Init_me();} if((Str_Compare(Rx_Buffer,"P7=1",4))&&(aware_of == False) ){Control_Port(7,1);Init_me();} //*********************************** REJECT MESSAGE **************************** if(aware_of == False) { Send_String("I Don't understand the Command! => "); Send_String(Rx_Buffer); Send_String("\n"); Rx_Char_Count = 0 ; Clear_String(Rx_Buffer); T[5] = -1 ; PORTC = 0xFF; Mode = 0; aware_of = True; } } Blink_Port(Mode); }

} //******************************** DEVICE DRIVERS**************************** void Port_Init(void) { DDRC = 0XFF ; } void Com_Init(void) { UBRR0 = 0 ; UCSR0A = 0x00; UCSR0B = 0x00 ; UCSR0C = 0X00; UCSR0C = (1