AUTOMATION USING 8051 MICROCONTROLLER AND RC5 REMOTE

BHUVANESWARI R.M.E.1, NARAYANAN S.2*
1Dept. of. Electronics and Communication Engineering, V.S.V.N Polytechnic College, Virudhunagar-626001, Tamilnadu, India.
2Dept. of. Electronics and Communication Engineering, V.S.V.N Polytechnic College, Virudhunagar-626001, Tamilnadu, India.
* Corresponding Author : narayanan_sugumar@rediffmail.com

Received : 12-01-2012     Accepted : 15-02-2012     Published : 24-03-2012
Volume : 3     Issue : 1       Pages : 274 - 277
J Inform Syst Comm 3.1 (2012):274-277

Cite - MLA : BHUVANESWARI R.M.E. and NARAYANAN S. "AUTOMATION USING 8051 MICROCONTROLLER AND RC5 REMOTE ." Journal of Information Systems and Communication 3.1 (2012):274-277.

Cite - APA : BHUVANESWARI R.M.E., NARAYANAN S. (2012). AUTOMATION USING 8051 MICROCONTROLLER AND RC5 REMOTE . Journal of Information Systems and Communication, 3 (1), 274-277.

Cite - Chicago : BHUVANESWARI R.M.E. and NARAYANAN S. "AUTOMATION USING 8051 MICROCONTROLLER AND RC5 REMOTE ." Journal of Information Systems and Communication 3, no. 1 (2012):274-277.

Copyright : © 2012, BHUVANESWARI R.M.E. and NARAYANAN S., Published by Bioinfo Publications. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution and reproduction in any medium, provided the original author and source are credited.

Abstract

With advancement of technology, things are becoming simpler and easier for us. Automation is the use of control systems and information technologies to reduce the need for human work in the production of goods and services. In the scope of industrialization, automation is a step beyond mechanization. Whereas mechanization provided human operators with machinery to assist them with the muscular requirements of work, automation greatly decreases the need for human sensory and mental requirements as well. Automation plays an increasingly important role in the world economy and in daily experience.

Keywords

automation, microcontroller, RC5, Philips remote, automatic systems, IR signal, decoding, LCD display.

Introduction

Automatic systems are being preferred over manual system. Through this, I have tried to show automatic control of a house using a Philips remote control which uses the RC5 coding logic, with a receiver empowered with microcontroller and relay driver circuit, as a result of which power is saved to some extent.

Need of Automation

An automated device can replace good amount of human working force, moreover humans are more prone to errors and in intensive conditions the probability of error increases whereas, an automated device can work with diligence, versatility and with almost zero error. Replacing human operators in tasks that involve hard physical or monotonous work. Replacing humans in tasks done in dangerous environments (i.e. fire, space, volcanoes, nuclear facilities, underwater, etc) performing tasks that are beyond human capabilities of size, weight, speed, endurance, economy improvement etc.
Automation may improve in economy of enterprises, society or most of humankind. For example, when an enterprise that has invested in automation technology recovers its investment, or when a state or country increases its income due to automation like Germany or Japan in the 20th Century [2] .
That’s why it looks into construction and implementation of a system involving hardware to control a variety of electrical and electronics system.

A. Transmitter

Remote control

We can use the commercially available Philips remote control which uses RC5 coding logic. It transfers the data and control signals to the receiver through a IR led with this coding logic. The remote consists of the RC5 decoder IC called SAA3010.

System Architecture

[Fig-1] .

RC5 coding logic

First of all, Philips adopted or created the RC5 standard that uses fixed bit length and fixed quantity of bits. Each time when press a button at the Philips remote control, it sends a train of 14 bits, 1.728ms per bit, the whole train is repeated every 130ms if the button pressed, each bit is sliced in two halves. The left and right half has opposed levels. If the bit to be transmitted is one (1), its left side is zero while its right side is one. If the bit to be transmitted is zero (0), its left side is one while the right side is zero [3] .
It means that the second half of the bit is actually the same meaning of the bit to be transmitted, as we can see at the shaded blue right side of the bit as on, means bit transmitted = 1. If we want to measure the correct logic level directly from the Receiver Output, we should measure at the first half of the bit. The correct interpretation is that it changes level exactly at the middle of bit time. At the IR Receiver output a bit Zero changes level from Low to up, while a bit one changes level from Up to Low. There are a minimum quantity of incoming 27µs pulses to the demodulator understand it is at the right frequency and then drop its output. The quantity of pulses used at the Philips remotes is 32 pulses per each half of the bit, 64 pulses per bit. So, a bit "0" to be transmitted it means 32 square pulses of 27µs each, then 32 x 27µs of silence. The bit "1" is the opposite, 32x 27µs of silence followed by 32 square pulses of 27µs.The first two bits, #1 and #2, are called ACG calibration. They are "ON" level, and serve to calibrate the IR Receivers Auto Gain Control.
In the Philips remotes, the bit #3 is the CHECK bit, every time press a key at the remote, even pressing repeatedly the same key, this bit flips state. This feature is interesting. Suppose number "1" is pressed at the remote (trying to select channel 15 at TV) and holding it for 2 seconds, then our other hand just blocks the Infrared signal. The TV would receive two trains of pulses, generated by our hand breaking a long train in two. Other systems would understand transmission of two keys "1" selecting channel "11", but this do not happens in the Philips system. This bit flips state every time we press a key, so blocking the signal with our hand doesn't change this bit, so the TV will understand that still the same key pressed. To select channel "11" we should press key "1" really twice. The next 5 bits, #4 to #8, are used for SYSTEM ADDRESS, or to identify which kind of device should execute the COMMAND bits. For example, TV set uses ADDRESS ZERO. Bit #8 is the Less Significant Bit. The next 6 bits, #9 to #14, are used for COMMAND information to the device selected at the ADDRESS bits. Bit #14 is the LESS SIGNIFICANT BIT, and it is last transmitted.

B. Receiver

Sensor

In this, we use TSOP-1230, as the IR receiver and it is interfaced with the micro controller8051. This is the miniaturized receiver commonly employed for receiving the IR signals from the transmitters. It has three pins namely 1- GND, 2-Supply, 3-Out. Its supply voltage is of range -0.3 to +6 v and current of 3 mA [4] .
The bit pattern of the RC5 logic is shown below where the RED bits are level "ON", while Blue are "OFF".

Micro controller

AT89C2051 is an ATMEL controller with the core of Intel MCS-51. It is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable read-only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.
The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset [5] .

Display Unit

Liquid crystal displays (LCD) is an alphanumeric display and widely used in recent years as compared to LEDs. This is due to the declining prices of LCD, the ability to display numbers, characters and graphics, incorporation of a refreshing controller into the LCD by relieving the CPU of the task of refreshing the LCD and also the ease of programming for characters and graphics. We have used JHD162A advanced version of HD44780 based LCDs [6] .

Buffer

It is nothing but a current driver to drive the high current devices through the low current (10 mA from micro controller) which was from the pins of microcontroller. The IC called ULN2803 is used as the driver for the controller. It output is directly drives the relay for switching the devices ON/OFF.
It consist of eight NPN Darlington connected transistors in this family of arrays are ideally suited for interfacing between low logic level digital circuitry (such as TTL, CMOS or PMOS/NMOS) and the higher current/voltage requirements of lamps, relays, printer hammers or other similar loads for a broad range of computer, industrial, and consumer applications. All devices feature open–collector outputs and freewheeling clamp diodes for transient suppression [6] .

Programming The Controller

To receive this signal using a microcontroller follows the figure below. Note that the Infrared Receiver invert the bit signal, low level means bit ON.
During inactivity (no Infrared present) the output of the Infrared receiver is UP (bit zero). We can connect the IR receiver output to any input port pin or interrupt pin of the microcontroller, and keep polling it or prepare the interrupt routine to trigger the reading after the first low level sensed.
When we press a key at the remote, it transmits the train of pulses, and the microcontroller will receive bit #1 first. It will be sensed right after the middle of the bit when it changes from high to low level to means bit "1". This is the first time that microcontroller will "see" the incoming IR signal.
We don't need to decode those first two bits, not even the CHK, so we can skip those 3 bits and start to receive the ADDRESS bits. To do that, we need to skip 2.75 bits time, and will be exactly at the middle of the right level of the first ADDRESS bit to be read (non inverted level).
So, upon sensing the first low level, software should wait 4.752 milliseconds and then start to read the next 11 bits spaced 1.728ms each. The first 5 bits are Address and the next 6 bits are Command, logic correct level, LOW = 0, HIGH = 1.
The software will need to have two timing delays, the first to wait 4.752ms and the second to wait 1.728ms. Adjust the timing loop from the 4.752ms until the first fast pulse happens exactly as indicated above. Then adjust the 1.728 ms timing delay in such way that the last fast pulse (#11) bit reading happens exactly at the middle of the low part of the last bit (#14).
Reading the 11 bits is easy. Just shift them left into a 8 bit register and ignore the high order 2 bits #7 and #6 (AND 03Fh instruction), [7] keep only the COMMAND last 6 bits. We need not want to decode the ADDRESS bits; the TV remote control will always send Address Zero.
Here few examples of the complete waveform (14 bits) at the Receiver Output. Values at the right are the command in hexadecimal. Red: AGC pulses (ON) Blue: Check bit (flipping) White: Address (00) Green: Command.

Algorithm

[Algorithm-1] , [Algorithm-2] .

Conclusion

An automated home can be a very simple grouping of controls, or it can be heavily automated where any appliance that is plugged into electrical power is remotely controlled. Costs mainly include equipment, components, furniture, and custom installation.
Ongoing costs include electricity to run the control systems, maintenance costs for the control and networking systems, including troubleshooting, and eventual cost of upgrading as standards change. Increased complexity may also increase maintenance costs for networked devices.
Learning to use a complex system effectively may take significant time and training. Control system security may be difficult and costly to maintain, especially if the control system extends beyond the home, for instance by wireless or by connection to the internet or other networks.

References

[1] Basics of home automation, http://oscarferrer.com.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[2] James gerhart Home automation and wiring, 28-67.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[3] The RC5 encryption algorithm, http://citeseerx.ist.psu.edu.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[4] IR sensor datasheet, http://pdf1.alldatasheet.com.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[5] Microcontroller AT89C2051 datasheet, http://www.atmel.com.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[6] LCD JHD162A datasheet, http://www.electrokit.se.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[7] Buffer ULN2803 datasheet, http://www.datasheetcatalog.org.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[8] Jivan S. Parab, Vinod G. Shelake Exploring C for microcontrollers. A hands on approach.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

Images
Fig. 1- System Architecture
Fig. 2- Rc5 Logic
Fig. 3- Rc5 Logic Bit Pattern
Fig. 4- At89c2051 Microcontroller.
Fig. 5- Circuit Diagram
Fig. 6- Sequence For Sensing
Fig. 7- Examples For The Received Signals
Algorithm. 1-
Algorithm. 2-