Universal Infrared Adapter For Air Conditioners

Transcription

IT 15 080Examensarbete 30 hpFebruari 2016Universal infrared adapter forair conditionersAdeline MercierInstitutionen för informationsteknologiDepartment of Information Technology

AbstractUniversal infrared adapter for air conditionersAdeline MercierTeknisk- naturvetenskaplig orietLägerhyddsvägen 1Hus 4, Plan 0Postadress:Box 536751 21 UppsalaTelefon:018 – 471 30 03Telefax:018 – 471 30 00Hemsida:http://www.teknat.uu.se/studentThis thesis explores how a phone app and an infrared remote control can be used atthe same time in order to control air conditioners. It introduces the concept of auniversal adapter able to recognize a command from an air conditioner's remotecontrol in order to update the phone app. This project extends prior work onuniversal devices focusing on infrared communication by examining the relationshipbetween the different infrared protocols used for air conditioners from differentmanufacturers.This thesis proposes a model of a universal infrared adapter. This adapter is able torecognize a command from an air conditioner's remote control if this one isregistered in the database. If not, the adapter can also learn the different commandsof the new remote control and save it in the database. A sample of 4 air conditionersfrom 4 different manufacturers has been tested for this thesis. With a comparativecase analysis, this research explored the role of the position and the size of a settingin the infrared message. The findings from the research illustrate how the differentmanufacturers are encoding infrared commands. It also show that the impact of thesize of the message and the amount of data on the analysis of the data is morecomplex than previously thought. As predicted, similarities has been found betweenprotocols, allowing the adapter to look for information in specific parts of an infraredmessage or learn the information from an unknown remote control.The findings provide support for the key arguments and support the prediction thatthere are similarities between the infrared protocols for air conditioners, allowing thecreation of a universal adapter.Handledare: Jens Peter SchroerÄmnesgranskare: Christian RohnerExaminator: Wang YiIT 15 080Tryckt av: Reprocentralen ITC

Contents1 Introduction1.1 Project Purpose and Goal1.2 Motivation . . . . . . . .1.3 Scope . . . . . . . . . . .1.4 Structure of the report . .444552 Background2.1 Infrared communication . . . . . . . . . . . . .2.1.1 Modulation . . . . . . . . . . . . . . . .2.1.2 Protocols . . . . . . . . . . . . . . . . .2.1.3 Encoding . . . . . . . . . . . . . . . . .2.1.4 Data frame format . . . . . . . . . . . .2.2 Related work . . . . . . . . . . . . . . . . . . .2.2.1 Ken Shirriff library . . . . . . . . . . . .2.2.2 Linux Infrared Remote Control (LIRC)2.2.3 AnalysIR . . . . . . . . . . . . . . . . .2.2.4 AirPatrol . . . . . . . . . . . . . . . . .2.2.5 Tado . . . . . . . . . . . . . . . . . . . .2.2.6 Universal remote controls . . . . . . . .6666789910101010113 Method3.1 Infrared protocols for multimedia devices3.2 Multimedia devices versus air conditioners3.2.1 Baud rate . . . . . . . . . . . . . .3.2.2 Checksum . . . . . . . . . . . . . .3.2.3 Settings . . . . . . . . . . . . . . .111212131314. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .extended database library151616161617181818222325.4 Implementation4.1 Hardware . . . . . . . . . . . . . . . .4.1.1 Arduino board . . . . . . . . .4.1.2 Testing board . . . . . . . . . .4.1.3 Infrared receiver . . . . . . . .4.1.4 Infrared emitter . . . . . . . .4.1.5 Range . . . . . . . . . . . . . .4.2 Software . . . . . . . . . . . . . . . . .4.2.1 Learning . . . . . . . . . . . . .4.2.2 Recognition . . . . . . . . . . .4.2.3 Combination . . . . . . . . . .4.2.4 Arduino’s Database library and.5 Tests and results265.1 Samsung TV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.2 LINDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.3 KCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281

5.45.5Coolman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Panasonic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Conclusion and future work2931322

List of Figures12345678910111213141516Logical states for the NEC protocol . . . . . . . .Interpretation of the signal by the sender/receiverManchester encoding . . . . . . . . . . . . . . . .SIRC data frame format . . . . . . . . . . . . . .normal Checksum (left) and “flipped” checksum .Relative Radiant Power vs. Wavelength . . . . . .NPN Darlington Output . . . . . . . . . . . . . .Raws comparison . . . . . . . . . . . . . . . . . .Final chart, learning . . . . . . . . . . . . . . . . .Recognition’s steps . . . . . . . . . . . . . . . . .Final chart, combination . . . . . . . . . . . . . .recognition of multimedia devices’ protocols . . .Linda’s data frame . . . . . . . . . . . . . . . . . .KCC’s data frame . . . . . . . . . . . . . . . . . .Coolman’s data frame . . . . . . . . . . . . . . . .Panasonic’s data frame . . . . . . . . . . . . . . .3.7789141718192123242728293032

1IntroductionNowadays, most of the devices can be remotely controlled thanks to infraredcommunication. But now it becomes inconvenient having a remote control foreach device e.g. TV, DVD player, air conditioning etc. So that is why youcan now find universal remotes to replace most of them. Thanks to Internetof things, another solution is to control devices from your phone. That is howScypho AB proposes to control your heat pump or air conditioner.Scypho AB is Swedish start up based in Stockholm [19]. Myscypho is an appwhich allows controlling and planning the temperature of your home. But theapp does not completely replace the initial remote control, it is only an additional option to control your heat pump or air conditioner. The issue is thatusing the initial remote control, the app is not aware of the changes. This thesisis treating about this issue.1.1Project Purpose and GoalMyScypho allows the user to change the temperature of the house from hisphone and reduce his costs. But the issue with this app is that it is not awareif the user uses the initial remote control to change a setting. So the universaladapter’s goals are to receive the data from an air conditioner’s remote controland analyse it in order to update the app when settings are changed with theremote control.So this universal infrared adapter has to:- be able to receive a command from any air conditioner- analyse and understand the command in order to update the app (thanks toa comparison between the command received and the database)- learn commands from a remote control which is unknown1.2MotivationUsers can now control their air conditioner from their phone, but the applicationis not aware when settings are changed using the existing remote for the system.Using the application Myscypho, the customer is only able to use his phone.The goal of this project is to build an adapter using infrared communication,which analyzes the command in order to be able to recognize what kind ofcommand is sent and update the app. This adapter has to be able to recognizeany remote control since it can be installed on any air conditioner’s remotecontrol. All remotes are using infrared communication but manufacturers arenot using the same infrared protocol to communicate. Databases have alreadybeen created for universal remotes in order to work with any system. Thanksto these databases, they recognize the protocol used and then you just has toselect the specific model that you are using. A new option has been addedto the new universal remotes, it is called the “learning” mode. Indeed, if theremote control used is unknown, it is possible to add this remote to the database.Most of the codes for remotes can be found on databases on Internet and offer4

the possibility to update universal remotes. Knowing that the databases forthe infrared protocols (for multimedia devices) are pretty complete since somebrands are using the same protocol, this is not the case for air conditioners. Evenif multimedia devices and air conditioners are using infrared communication, theway of sending data differs. The first step will be to analyze the communicationbetween a multimedia device and its remote since commands for this type ofdevice are less complex than the commands for air conditioners.Then the next step is to analyze if these protocols for multimedia equipments,are also used for your air conditioner.1.3ScopeThe scypho sensors already have Bluetooth Low Energy communication set sothis project is going to focus on the communication between the adapter andthe controlled system. Then many other ways of communication can be usede.g Wifi, Bluetooth for sending the data from the adapter to the system butsince all the systems are controlled by a remote using infrared communication,the focus will be on this one. This project will also include the management ofa database to store the recorded brands.1.4Structure of the reportThis report is divided in 5 main sections. First, the background is introducinginfrared communication and the different works related to universal devicesusing infrared communication but also “universal” systems able to use severalinfrared protocols. The second part concerns the methodology. It explains thedifferent steps to understand the different protocols used first for multimediadevices and then for air conditioners. The third section concerns the realisationof the universal adapter. It is divided in 2 subsections: the hardware and thesoftware. It explains how the board is designed and the different functionscontained in the program. And the fourth section shows the tests done duringthis project. Each tested device is introduced and the several experiments showthe similarities and differences that will help for the creation of the universaladapter. The last section concludes the different tests and results got from theprevious part and includes some potential future work that can be done in orderto improve this new device.5

2BackgroundBefore working on the creation of the adapter, it is first important to understand how the communication between the infrared remote control and the airconditioner works. So this first section describes how the infrared communication is set and how a signal is sent and modulated but also a description of theprotocols and how they are encoded.The second part of this section is dedicated to the related work. Some projectsand devices have already been realised using infrared communication. Theone used and described in this section show similarities that will support thisproject.2.1Infrared communicationInfrared communication has many advantages. It requires low power and it hashigh noise immunity. But also a portable infrared system is cheap and simpleto build.Despite this, the main problem remaining is the line of sight: although theemitter has an angle of tolerance, the remote and the controlled device have tobe almost aligned. The transmission can drastically be affected by the presenceof objects, persons but even dust or sunlight [8]. It is shown in this part how aninfrared command is built and sent but also how the infrared receiver analyzesthe signal.2.1.1ModulationThe infrared communication is very efficient since it does not suffer electromagnetic interferences. Its optical wavelength is between 870nm and 950nm. However, the infrared signal is sensitive to other kind of interferences e.g. lights,temperature and even bodies which can affect the signal. Here, the modulationof the signal is the key to avoid these disturbances generating errors in the message [1]. In order to recognize the signal, it is necessary to make the emitterblink at a particular frequency. Concerning remote controls, the frequency usedis between 35kHz and 40kHz (mostly 38kHz). If the receiver is set to theseparticular frequencies, it is able to ignore all the others, and ignore all the otherpotential noise.2.1.2ProtocolsIn order to be recognized by the receiver, specific protocols are used. These protocols are referred by Commercial Infrared protocols (CIR). Most of the protocols have the same base: first a start bit, then the data. The difference betweenthem is the encoding, or the different position of the information composing thedata. There are two main protocols used by most of the manufacturers. RC5 orRC6 . They have been created by Philips and became a standard for infraredtransmissions The other protocols commonly used for infrared communication6

is the NEC protocol. Then some other protocols are often used due to theiromnipresence on the market e.g. Samsung or Sony.2.1.3EncodingFor serial communications, encoding a 1 or a 0 depends on the protocol used.For each logical state, “mark” (low state) and “spaces” (high state) are used, asshown on figure 1. Pulses are sent every mark’s event and the IR light is turnedoff while we are in the space state. Most of the time, the mark for a logical oneand a logical zero have the same length, so only the spaces are compared.Figure 1: Logical states for the NEC protocolHowever, from the receiver side, a mark will be represented by a low level of thereceiver’s output, and vice versa for the space. This phenomenon is representedon

each device e.g. TV, DVD player, air conditioning etc. So that is why you can now find universal remotes to replace most of them. Thanks to Internet of things, another solution is to control devices from your phone. That is how Scypho AB proposes to control your heat pump or air conditioner. Scypho AB is Swedish start up based in Stockholm [19]. Myscypho is an app which allows controlling and .