Embedded networking using microcontrollers in an hotel room control system

November '99 Access Control & Identity Management

Networked control systems are no stranger to industrial applications for remote control of machinery and status monitoring. Because of their low cost, embedded microcontrollers (MCUs) have found their way into almost every electronic device. Combined with a networking protocol, the role of the embedded MCU can be expanded to implement low-cost network systems in many arenas. One arena that could benefit from an embedded network would be the hotel room control.

Networked control systems are no stranger to industrial applications for remote control of machinery and status monitoring. Because of their low cost, embedded microcontrollers (MCUs) have found their way into almost every electronic device. Combined with a networking protocol, the role of the embedded MCU can be expanded to implement low-cost network systems in many arenas. One arena that could benefit from an embedded network would be the hotel room control.

A single MCU could provide control of door access, HVAC, smoke, motion and lighting for each room. Each room is linked to the host computer via an RS485 network. The desk clerk can then assign the key to the room, turn on the courtesy light and set the HVAC system temperature when a person checks in. In addition, the host computer can keep track of room access from maids to bell hops to maintenance personnel. This article will explain the caveats to creating a hotel embedded control based on highly integrated MCUs.

The main control node

The main control node is a host computer (PC or MAC) with an RS485 interface card inside. As shown in Figure 1, all room nodes attach to the host computer indirectly through repeater nodes. The type of network chosen is RS485 because of the excellent noise rejection and capability to transmit over long distances.

It was also chosen because the related hardware required to implement an RS485 interface is relatively low cost. RS485 requires only a single twisted pair of wires for the transmission medium which contributes to the overall low cost of the network and ease of installation.

Transmission protocol

The transmission protocol for RS485 contains two types of transmissions: control and data. Control bytes are differentiated from data bytes by the state of the ninth data bit. When set, the ninth data bit indicates that the byte of data is a control byte and all receivers must accept. When clear, the ninth data bit indicates that the data byte is data and a receiver may optionally accept it. Other than this standard, a designer is left to define the transmission protocol for the network.

In the case of the hotel room control network, the first control byte should be a sync byte indicating that a data packet would follow. This byte is arbitrary. The second control byte indicates the floor number 1 to 255 (which provides plenty of room for upward expansion). If this byte is a 0, then the data packet was sent to the host computer. The next two control bytes are the room number for the specified floor giving up to 64K rooms per floor. Again, there is plenty of room for future expansion.

At this point, each receiver would be able to determine if the packet of information was directed to itself or another receiver. If the packet does not match the floor/room numbers, then the following data bytes with the ninth bit cleared will be ignored by the receiver.

At this point, the designer needs to make a choice to ensure that transmitted data is received correctly. Two methods that make the network more robust are to provide a byte counter for the packet and a packet checksum. Using this method, the first byte with the ninth data bit clear will be the byte count for the packet. The next byte will be a command for the operation that needs to take place. Some of the operations that could be executed are:

p Assign a room key number.

p Turn on HVAC.

p Turn on courtesy lights.

p Control television/cable box operation.

p Room status, ie, temperature, motion etc.

Depending on the operation, there will be 0 to 252 bytes. The limitation on 252 bytes is due to the byte counter being only 8 bits (255 - <ByteCount> - <Command> - <Checksum>).

Clear advantages

One clear advantage of using a network in an hotel environment is to be able to monitor access to the room. Not only do the guests have room access keys but also maids, bellhops and maintenance personnel. These individuals need to have access to all rooms and therefore have individually coded room access keys.

Each time the room is opened, the time and access card number is reported to the host computer. This information can in turn be used by the desk clerk to check which rooms are available by seeing if a maid has accessed the room. The manager can check to see if scheduled maintenance has been performed by checking access numbers. Any unauthorised access to the room can also immediately set off an alarm by sensing a forced entrance or simply the presence of someone in the room when it was not expected. The room control node also reports the time every occurrence of the door is opening. In most cases the access card report and the opening report can establish who has entered the room and for how long.

When checking into an hotel, the desk clerk performs many operations. First, rooms are checked for availability. Once a room is found, keys are assigned and the guest is off to the room. Upon opening the door to the room, the guest usually finds the courtesy lights on and the HVAC turned on to provide a comfortable temperature.

These settings are most likely the same configuration that the maid left them in when finished cleaning the room. This is an opportunity for the hotel to save money. The room can be left dark until the guest checks in at which time the courtesy lights are turned on.

It was previously mentioned that all floors have repeater nodes. Sometimes the distance between the host computer and the room control nodes on each floor becomes too long. The repeater node is used to bridge this long distance. This device can be an analog module that simply amplifies the detected signal or a digital module that actually has two RS485 ports that transmit and receive messages from the room nodes and the host computer.

Night lights and fire alarm

Most floors have night lights and fire alarms placed along the hallways. These too can be connected to the hotel network. A considerable amount of money could be saved by just controlling when night lights are turned on and off.

If on a network, these lights could automatically be controlled by the host computer. Also the detection of a fire could immediately trigger the host computer to call 911 and trigger the rest of the fire alarms.

The operation of the main control node is very simple when the room control nodes have a minimal level of intelligence. Since most of the work is performed at the room node, the controller must be capable of processing many different input signals and controlling many different output devices. This device is the critical link in the processing chain of an hotel embedded network.

The hotel room control node

A block diagram showing a possible implementation of the room control node is shown in Figure 3. This example integrates many functions commonly found in security and automation systems. Some of these functions include:

p Door access control.

p Motion sensing.

p Panic button notification.

p Smoke/fire protection and alert.

p HVAC smart thermostat.

p Light control.

Microchip's versatile PIC18C452

The MCU in the room control node has two functions. First, the MCU has to continuously monitor the sensors and controls located in the hotel room. Any room status changes are sent to the host computer. Second, the MCU must monitor incoming control bytes on the RS485 network. If the floor and room data match, the MCU must process the following data bytes and execute the command or request for data. A Microchip Technology PIC18C452 8-bit MCU has been used in the design. This MCU has the bandwidth required to simultaneously handle communication on the RS485 network and perform the room functions.

Furthermore, the MCU has many peripherals that allow simple implementation of the room control node. For example, the USART on the PIC18C452 has an address detect feature that makes it well suited for RS485 applications. The A/D converter can be used for temperature and smoke sensor inputs. The two available PWM modules can be used to generate analog voltage outputs for light dimmers. The on-chip master synchronous serial port (MSSP) module provides an easy interface to a serial EEPROM device. Finally, the device has plenty of general-purpose I/O for connecting keypads, displays and logic-activated devices.

The presence of the MCU in the room control node allows it to make decisions based on sensor input without intervention from the host computer. For example, the MCU can use motion sensor, temperature sensor and door access information to provide automatic energy savings. One possible action is to automatically set the HVAC thermostat for lower energy consumption if the room has been unoccupied for an extended amount of time.

The heart of the system

The heart of the room control node is a control panel located near the entrance door of the hotel room. The primary components of this panel include the MCU, a status display and a keypad. The RS485 twisted-pair network is connected to the MCU through a low-cost transceiver IC. The other sensors and output devices are located throughout the hotel room and connected to the control panel. Most of the connections are simple logic inputs or outputs, so the system wiring is simple.

The status display and keypad on the control panel can be used as a generic interface in the hotel room that can access a variety of functions. Common functions in the room include setting the light levels and room temperature.

As mentioned earlier, the lighting and temperature settings can also be controlled and monitored by the host computer. The control panel also provides a 'terminal' that accesses the hotel's front desk. For example, the hotel guest could request a particular time for maid service or check billing information. Additionally, hotel employees can use the room control panel to indicate when certain tasks have been completed. For example, the maid can enter a code on the control panel to indicate that the room has been cleaned.

Electronic locking

Most hotels today already have electronic door lock systems installed with a magnetic card reader mounted on the door of each room. The function of the electronic door lock is enhanced when connected to the room control node.

The interface is simple to implement since most card readers output a serial data stream that is easily interpreted by a MCU. As discussed earlier, the room control node forwards any access codes received by the card reader to the host computer. In a similar fashion, the MCU can store valid access code data received from the host computer in nonvolatile EEPROM memory. This increases security benefits because access privileges to the hotel room can be changed instantly from the host computer.

Fire alarms and smoke detection

The smoke sensor and alarm siren connected to the room control node allow local smoke detection and also allow node response to emergencies that may occur elsewhere in the hotel building. As a further safety feature, panic buttons can be connected to the control panel which notify the front desk that immediate assistance is required. The panic buttons are particularly useful for elderly guests or persons with disabilities.

For the convenience of the hotel guest, the handheld remote control for the television set can be configured to access other room functions through the room control node. The room control node has an infrared (IR) receiver connected to it for this purpose. For example, it would be convenient for the handheld remote to control the light levels in the room.

Conclusion

Using highly integrated 8-bit MCUs can provide the necessary processing power and cost structure to build an efficient embedded network. These same networks that are often found in the industrial environment (such as machinery or process monitoring) can be applied to simpler applications such as the one presented here.

A hotel can control costs and provide better service to guests by using such a network that does not add a significant amount of infrastructure that is usually associated with Ethernet or other types of local area networks.

Remember the KISS principle.

For details contact Rodger Richey, Applications Project Manager, Microchip Technology on tel: (091) 480 786 7200 or fax: (091) 480 899 9210.





Share this article:
Share via emailShare via LinkedInPrint this page



Further reading:

Defending against SIM swap fraud
Access Control & Identity Management
Mobile networks must not be complacent about SIM swap fraud, and they need to prioritise the protection of customers, according to Gur Geva, Founder and CEO of iiDENTIFii.

Read more...
Access Selection Guide 2024
Access Control & Identity Management
The Access Selection Guide 2024 includes a range of devices geared specifically for the access control and identity management market.

Read more...
Biometrics Selection Guide 2024
Access Control & Identity Management
The Biometrics Selection Guide 2024 incorporates a number of hardware and software biometric identification systems aimed at the access and identity management market of today.

Read more...
Smart intercoms for Sky House Projects
Nology Access Control & Identity Management Residential Estate (Industry)
DNAKE’s easy and smart intercom solution has everything in place for modern residential buildings. Hence, the developer selected DNAKE video intercoms to round out upmarket apartment complexes, supported by the mobile app.

Read more...
Authentic identity
HID Global Access Control & Identity Management
As the world has become global and digital, traditional means for confirming authentic identity, and understanding what is real and what is fake have become impractical.

Read more...
Research labs secured with STid Mobile ID
Access Control & Identity Management
When NTT opened its research centre in Silicon Valley, it was looking for a high-security expert capable of protecting the company’s sensitive data. STid readers and mobile ID solutions formed part of the solution.

Read more...
Is voice biometrics in banking secure enough?
Access Control & Identity Management AI & Data Analytics
As incidents of banking fraud grow exponentially and become increasingly sophisticated, it is time to question whether voice banking is a safe option for consumers.

Read more...
Unlocking efficiency and convenience
OPTEX Access Control & Identity Management Transport (Industry)
The OVS-02GT vehicle detection sensor is the newest member of Optex’s vehicle sensor range, also known as ‘virtual loop’, and offers reliable motion detection of cars, trucks, vans, and other motorised vehicles using microwave technology.

Read more...
Protecting our most vulnerable
NEC XON Access Control & Identity Management Products & Solutions
In a nation grappling with the distressing rise in child kidnappings, the need for innovative solutions to protect our infants has never been more critical. South Africa finds itself in the throes of a child abduction pandemic.

Read more...
Understanding the power of digital identity
Access Control & Identity Management Security Services & Risk Management Financial (Industry)
The way we perceive business flourishing is undergoing a paradigm shift, as digital identity and consumer consent redefine the dynamics of transactions, says Shanaaz Trethewey.

Read more...