logo elektroda
logo elektroda
X
logo elektroda

Air conditioner driver for Raspberry Pi

ghost666 
The author of the following project, having no experience with Raspberry Pi, set about creating a simple air conditioning control system. As he did very well, he decided to create the following guide so that any other person could also build a similar device.

Step 1: What you'll need

To compile the system described below we need:

* Raspberry Pi;
* SD card;
* Infrared receiver and transmitter (RC5 code);
* Transistor, resistors and contact plate;
* Connection jumpers.

Step 2: Format the SD card and upload the system

After purchasing all parts, we can start our computer. The first step is to format the SD card and load the image on it with the system that we download from the network.

From the Raspberry Pi website, we can download a number of different versions of Raspberry - the Linux distribution for this minicomputer. If we are a novice user, it is good to download the NOOBS version.

We can obtain more information about this process here .

Step 3: Configuring Raspberry Pi

After the first start of our minicomputer, we can proceed to its configuration. We connect to it a keyboard, mouse and TV or monitor via the HDMI port. We can connect a network to the Ethernet socket, which will greatly simplify the use of the machine.

After logging in to the computer (default data is user: pi and password: raspberry) we can proceed to configuration. First, we should extend the file system on the partition on the card so that the partition takes up the whole card, regardless of its capacity.

To configure the system, we need to enable the appropriate tool. To do this, enter in the terminal:

Code: Bash
Log in, to see the code


In the program we need to find the "expand rootfs" option and enable it. Then turn off the configuration tool and restart the system:

Code: Bash
Log in, to see the code


The next step is to launch the Wi-Fi interface and connect to our home network. If we use a graphical interface, the photo on the left shows how to make a network selection. However, if we use only the terminal, then we use the published advice here .

Finally, we need to enable the SSH server, which will allow us to log into the system remotely. To this end, we again use raspi-config (see above) and there, in the menu with interfaces we choose to enable SSH.

Step 4: Installation and configuration of LIRC

LIRC (Linux Infrared Remote Control) is a software package that allows decoding and sending infrared signals supported by most (but not all) remote controls. This allows both remote control of many devices from the Raspberry Pi level, and control of the raspberry itself with the help of a remote control.

We will use this package to record the signals of an infrared remote control, which is used e.g. to control the air conditioning system. We will later use LIRC to send the same messages to the air conditioner.

You can learn more about the software itself here .

To install and run LIRC, we will use the terminal. First enter:

Code: Bash
Log in, to see the code


If we have any problem before installation, it is worth updating the package list in the repositories. Even if we have no problems installing LIRC, it's good to do it from time to time:

Code: Bash
Log in, to see the code


Then, after installation, we need to add LIRC to the list of modules installed in our system. To do this, we must use the following commands:

[syntax=bash]sudo cat >> /etc/modules

About Author
ghost666
ghost666 wrote 11960 posts with rating 10223 , helped 157 times. Live in city Warszawa. Been with us since 2003 year.

Comments

Janusz_kk 24 Jan 2019 18:15

And to think that for this you just need an ordinary arduino, for this we can buy a "top" with an ir receiver and a relay and more poster a few other things. [Read more]

pawel1148 24 Jan 2019 21:10

This project was created mainly to show how you can program Raspberry to support GPIO and use LIRC, I do not understand how Arduino would replace RPI here. The same could be done on Arduino, but for... [Read more]

dzidzio 25 Jan 2019 07:55

Hello. I am also thinking about such things, standing before making a new installation at home. I just wonder if the matter will be handled by a device called Broadlink. It gets us all the remote controls... [Read more]

Szyszkownik Kilkujadek 25 Jan 2019 09:02

e.t.c... I didn't know shutdown is such a universal command. ;-) [Read more]

ghost666 25 Jan 2019 09:31

I don't know where it comes from ... it looks different in the post :O [Read more]

Szyszkownik Kilkujadek 25 Jan 2019 10:43

https://obrazki.elektroda.pl/6823863900_1548409426_thumb.jpg [Read more]

ghost666 25 Jan 2019 11:18

Strange, it works for me: https://obrazki.elektroda.pl/2842938300_1548411422_thumb.jpg [Read more]

Janusz_kk 25 Jan 2019 11:46

But not with us, I see like a pineapple. Added after 2 [minutes]: Maybe you read from the cache, try a different browser or clear the cache. [Read more]

tronics 25 Jan 2019 11:50

And for me like a ghost ghost, hence how it is in computer science jokes "weird, it works for me" [Read more]

Janusz_kk 25 Jan 2019 11:59

I still have: [Read more]

piodmo 25 Jan 2019 12:18

I have a remark that relates to many project descriptions, namely what does this project actually do and how? Both the author of the original article and the translator did not write in the first paragraph... [Read more]

Szyszkownik Kilkujadek 25 Jan 2019 14:13

The problem occurs in the new look of the forum. In the old one is OK. [Read more]

ghost666 25 Jan 2019 15:56

A very good idea, I will start doing so, especially in DIY projects. [Read more]

Bojleros 26 Jan 2019 10:30

Do not damage the memory environment (RAM) and all packages associated with it (FLASH)? Isn't it better to use a more customized distribution and get into the machine after ssh? It's supposed to... [Read more]

Anonymous 26 Jan 2019 14:42

In that case ESP8266. I like the NodeMCU version. RPI to IR alone is a light form. [Read more]

error105 27 Jan 2019 13:18

ESP8266 and we have WiFi control from anywhere on earth, I gave a description on the electrode, and as you can see the code is trivial :) So even in pure Arduino we can in a few lines control any device... [Read more]

Anonymous 27 Jan 2019 13:35

I think that the presented project shows how trivial it is on RPI, but as if it is obvious that it should be part of a larger whole. [Read more]

Jufo 27 Jan 2019 14:28

Sure, I will replace Rm mini 3 additionally with tense domoticz, without the need to use Chinese software :) Greetings. robert [Read more]

Dakarth 02 Feb 2019 10:35

It is a pity that there was no such guide as I set up LIRC on raspberry and I had to look for puzzle pieces on various forums ... Very legible instruction, someone will definitely use, estimate. I also... [Read more]