Elektroda.com
Elektroda.com
X

Air conditioner driver for Raspberry Pi

ghost666 5772 19
This content has been translated » The original version can be found here
  • Air conditioner driver for Raspberry Pi
    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 .

    Air conditioner driver for Raspberry Pi
    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

    Cool! Ranking DIY
    Can you write similar article? Send message to me and you will get SD card 64GB.
    About Author
    ghost666
    Translator. Editor
    Offline 
    ghost666 wrote 9439 posts with rating 7378, helped 157 times. Live in city Warszawa. Been with us since 2003 year.
  • #2
    Janusz_kk
    Level 25  
    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.
  • #3
    pawel1148
    Level 21  
    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 what? Since we have a convenient remote control for air conditioning, or we buy a universal one for PLN 20 ?? On Raspberry, it would make sense if you add network control, which is a rather easy task. In the case of Arduino it is not necessary.

    In addition, when we do not intend to use analog signals, I personally do not see the point of writing this "and it could be done on arduino", because why would I do it on arduino ?? Cheaper ??
    Button right. Raspberry Pi Zero can be bought in Poland for PLN 26 (PLN 52 for versions with WIFI + BT) + some small microSD card + micro USB adapter. You will probably be able to find a set with arduino PLN 10 cheaper, but I see no sense to write under every post about Raspberry that it could be done on Arduino, because it could as well be done on 8051 or PLC.

    It's all about how someone feels better. Because the Working Hour in this case is more expensive than the equipment.
  • #4
    dzidzio
    Level 10  
    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 in the room, you can control the smartphone and in the era of assistant goggles also by voice, the price is very affordable.
  • #5
    Szyszkownik Kilkujadek
    Level 35  
    ghost666 wrote:
    Of course, it's a good idea to back up your current lircd.conf file before saving:
    Code: sudo shutdown -r now

    ghost666 wrote:
    Copy the new configuration file we generate to the old one:
    Code: sudo shutdown -r now

    ghost666 wrote:
    Copy the new configuration file we generate to the old one:
    Code: sudo shutdown -r now

    Restart LIRC:
    Code: sudo shutdown -r now

    e.t.c...
    I didn't know shutdown is such a universal command. ;-)
  • #6
    ghost666
    Translator. Editor
    Szyszkownik Kilkujadek wrote:
    ghost666 wrote:
    Of course, it's a good idea to back up your current lircd.conf file before saving:
    Code: sudo shutdown -r now

    ghost666 wrote:
    Copy the new configuration file we generate to the old one:
    Code: sudo shutdown -r now

    ghost666 wrote:
    Copy the new configuration file we generate to the old one:
    Code: sudo shutdown -r now

    Restart LIRC:
    Code: sudo shutdown -r now

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


    I don't know where it comes from ... it looks different in the post :O
  • #8
    ghost666
    Translator. Editor
    Strange, it works for me:

    Air conditioner driver for Raspberry Pi
  • #9
    Janusz_kk
    Level 25  
    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.
  • #10
    tronics
    Level 37  
    And for me like a ghost ghost, hence how it is in computer science jokes "weird, it works for me"
  • #11
    Janusz_kk
    Level 25  
    I still have:

    ghost666 wrote:
    Code: bash Expand Select all

    sudo shutdown -r now

    6
  • #12
    piodmo
    Level 10  
    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 how this invention works. You have to break through the whole to make a hypothesis (because it is not explicitly stated by the authors).
    Is it impossible to write an introduction like: the controller allows you to download the IR code from the air conditioning remote control, which can then be sent to the IR diode and thus control the air conditioner. Because I was expecting some controller with temperature measurement, compressor switching on etc. and this is just a flashing LED.
    Please introduce such good practice: instead of explaining what the R15 resistor is in the second sentence, make a general introduction to the type design what it is, what it does and why, some general scheme of operation etc.
  • #13
    Szyszkownik Kilkujadek
    Level 35  
    ghost666 wrote:
    Strange, it works for me:

    Air conditioner driver for Raspberry Pi

    The problem occurs in the new look of the forum. In the old one is OK.
  • #14
    ghost666
    Translator. Editor
    piodmo wrote:
    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 how this invention works. You have to break through the whole to make a hypothesis (because it is not explicitly stated by the authors).
    Is it impossible to write an introduction like: the controller allows you to download the IR code from the air conditioning remote control, which can then be sent to the IR diode and thus control the air conditioner. Because I was expecting some controller with temperature measurement, compressor switching on etc. and this is just a flashing diode.
    Please introduce such good practice: instead of explaining what the R15 resistor is in the second sentence, make a general introduction to the type design, what it is, what it does and why, some general scheme of operation etc.


    A very good idea, I will start doing so, especially in DIY projects.
  • #15
    Bojleros
    Level 16  
    ghost666 wrote:
    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.

    You can get 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:


    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 have an infrared transmitter so you will probably have to put it in the right place. If you do not need to connect the hdmi keyboard and monitor for testing (and only power supply) we have a few lows less to embrace.

    ghost666 wrote:
    sudo cat >> / etc / modules
  • #16
    Erbit
    Level 35  
    pawel1148 wrote:
    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 what? Since we have a convenient remote control for air conditioning, or we buy a universal one for PLN 20 ?? On Raspberry, it would make sense if you add network control, which is a rather easy task. In the case of Arduino it is not necessarily ....


    In that case ESP8266. I like the NodeMCU version.

    RPI to IR alone is a light form.
  • #17
    error105
    Level 11  
    pawel1148 wrote:
    add control over the network, which is a rather easy task. In the case of Arduino it is not necessary.

    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 via HC-05, or WiFi (ESP) or LAN or whatever we want.
  • #18
    Erbit
    Level 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.
  • #19
    Jufo
    Level 14  
    dzidzio wrote:
    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 in the room, you can control the smartphone and in the era of assistant goggles also by voice, the price is very affordable.


    Sure, I will replace Rm mini 3 additionally with tense domoticz, without the need to use Chinese software :)

    Greetings.
    robert
  • #20
    Dakarth
    Level 2  
    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 connected it to Openhab so that I could turn on the air conditioning before I came home from work :)

    However, the problem occurred elsewhere: Recording and broadcasting codes, e.g. a TV remote control, is very easy - one information regarding e.g. the channel number and that's it. With the remote control for air conditioning (at least with the model I have) when we press the button to increase the airflow power, we send the entire frame with complete information, i.e. temperature, airflow, blade pitch, heating / cooling etc. So if we record the airflow increase button at that time temp set to 18 degrees, then we increase the temperature to 23 degrees, then by sending a signal of increasing the airflow through RPI we also send information about a lower temperature.

    Does anyone have a better solution for this than recording all possible combinations of the remote control (it will be sooooo much)? You can try to decipher a signal to extract specific values from it, but if you've already played it, you know that a single signal is dozens (if not hundreds) of numbers ...