Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Building an IR Blaster

Building an IR Blaster

Scheduled Pinned Locked Moved My Project
60 Posts 10 Posters 36.7k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steets250
    wrote on last edited by steets250
    #1

    IMPORTANT: After forum data loss deleting half of this topic I recreated a newer and updated topic intro. If you haven't read this topic before, I recommend starting here: http://forum.mysensors.org/topic/146/building-an-ir-blaster/50

    After discovering that I could create an IR device using MySensors, I wondered if I would use this as a substitute to SQ Blaster, iTACH, or USB-UIRT.

    I tossed together an Arduino Nano, the NRF24L01, and an IR LED. I then created a simple program based to see what I could do with the IR device, and if I could get the Vera to use the Arduino as an IR transmitter.

    Here is the program: I got rid of the # because it made the text a weird size in the forum.

    include <Sensor.h>
    include <SPI.h>
    include <EEPROM.h>
    include <RF24.h>

    define ID 1
    Sensor gw;

    void setup()
    {
    gw.begin();
    gw.sendSensorPresentation(ID, S_IR);
    }

    void loop()
    {
    delay(10000); // Wait 10 seconds
    }

    After adding the Arduino to the gateway, I encountered a problem. As soon as I add the IR device to Vera, the whole MySensors plugin glitches out, preventing all of my sensors from working. The first picture shows what the IR device looks like right after I add it, and then 20 seconds later, the second picture shows what happens until I delete the IR device from Vera.

    Screen Shot 2014-05-31 at 6.05.25 PM.png

    Screen Shot 2014-05-31 at 6.05.41 PM.png

    Does anybody know what I am doing wrong? Thanks for your help!!

    Steven

    DvbitD 1 Reply Last reply
    1
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      No device files exist for the IR device on vera. This needs to be developed by someone. You could use some other device type for controlling your arduino blaster, like a normal light switch.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        steets250
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • S Offline
          S Offline
          steets250
          wrote on last edited by
          #4

          @hek I was looking through Vera's Luup files and I saw D_IrDevice1.xml, D_IrTransmitter1.xml, S_IrDevice1.xml, and S_IrTransmitter1.xml. Would I be able to use these?

          I am also checking out the SQ Blaster plugin to see if I can change it.

          Thanks for the response!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            steets250
            wrote on last edited by
            #5

            Quick update: I was unable to get the SQ Blaster plugin to work. Still looking for some more options.

            Quick question: Why does my sensors have a S_IR option for device presentation if it doesn't work with vera??

            I really don't want to pay $90 for a wired IR blaster when I have a cheap, wireless one all built...

            1 Reply Last reply
            0
            • hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #6

              The plan a few months ago was to offer some sort of IR-device in Vera. But I never came around building it (because I couldn't find a way to create a dynamic "remote"-like UI). Maybe someone else has an idea on how to do this and could create it?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                steets250
                wrote on last edited by steets250
                #7

                @hek It doesn't look like you have to create a remote ui, as Vera is able to do that for you. If you look at the SQ-Blaster and iTach plugins, they only connect the blaster to the Vera, and don't have a ui. All they have to do is show up as an IR blaster on Vera, and then the remote UI is created by individual TV devices, created on Vera. (Devices, Add Device, IR Device)

                I gave the SQ Blaster plugin a test run to see what it did.

                Plugin uses urn:schemas-micasaverde-com:device:IrTransmitter:1 as the device_type.

                Here are a few images demonstrating that:
                Plugin itself does not require remote UI. (Shows no info because I did not connect an SQ Blaster.) The plugin has nothing to be setup besides the IP address of the SQ Blaster.

                Screen Shot 2014-06-03 at 4.13.59 PM.png

                Remotes are created on Vera using built-in setup menu.

                Screen Shot 2014-06-03 at 4.16.58 PM.png

                Screen Shot 2014-06-03 at 4.17.03 PM.png

                Vera contains hundreds of remote codes to create remotes for different IR devices. I created an example Sony TV. (Different button menus located on the left).

                Screen Shot 2014-06-03 at 4.18.21 PM.png

                Button layouts and codes can also be changed based on individual needs. (I was not able to test this because of not having an actual IR blaster to use.)

                Screen Shot 2014-06-03 at 4.27.09 PM.png

                I hope this clarifies what is needed to create an IR blaster device in Vera.

                I wish I could create this code myself and post it, but I have absolutely no Luup knowledge (hopefully that will change soon)

                Thanks for replying!
                Steven

                BulldogLowellB 1 Reply Last reply
                1
                • S steets250

                  @hek It doesn't look like you have to create a remote ui, as Vera is able to do that for you. If you look at the SQ-Blaster and iTach plugins, they only connect the blaster to the Vera, and don't have a ui. All they have to do is show up as an IR blaster on Vera, and then the remote UI is created by individual TV devices, created on Vera. (Devices, Add Device, IR Device)

                  I gave the SQ Blaster plugin a test run to see what it did.

                  Plugin uses urn:schemas-micasaverde-com:device:IrTransmitter:1 as the device_type.

                  Here are a few images demonstrating that:
                  Plugin itself does not require remote UI. (Shows no info because I did not connect an SQ Blaster.) The plugin has nothing to be setup besides the IP address of the SQ Blaster.

                  Screen Shot 2014-06-03 at 4.13.59 PM.png

                  Remotes are created on Vera using built-in setup menu.

                  Screen Shot 2014-06-03 at 4.16.58 PM.png

                  Screen Shot 2014-06-03 at 4.17.03 PM.png

                  Vera contains hundreds of remote codes to create remotes for different IR devices. I created an example Sony TV. (Different button menus located on the left).

                  Screen Shot 2014-06-03 at 4.18.21 PM.png

                  Button layouts and codes can also be changed based on individual needs. (I was not able to test this because of not having an actual IR blaster to use.)

                  Screen Shot 2014-06-03 at 4.27.09 PM.png

                  I hope this clarifies what is needed to create an IR blaster device in Vera.

                  I wish I could create this code myself and post it, but I have absolutely no Luup knowledge (hopefully that will change soon)

                  Thanks for replying!
                  Steven

                  BulldogLowellB Offline
                  BulldogLowellB Offline
                  BulldogLowell
                  Contest Winner
                  wrote on last edited by
                  #8

                  @steets250

                  This will be a good one! One need only consider the cost of the alternatives.

                  great job of working this through!

                  1 Reply Last reply
                  0
                  • greglG Offline
                    greglG Offline
                    gregl
                    Hero Member
                    wrote on last edited by
                    #9

                    Hi Steven ,

                    Standing by to see how you get on... i do have one use case for this type of IR send device, so pls keep us updated/ask for help as you need!

                    Greg (mgf909)

                    1 Reply Last reply
                    0
                    • greglG Offline
                      greglG Offline
                      gregl
                      Hero Member
                      wrote on last edited by
                      #10

                      Hey Steven,
                      I was searching on mcv forum, and found this..Click Here!!! - thought it may contain some good info for you!

                      1 Reply Last reply
                      0
                      • hekH Offline
                        hekH Offline
                        hek
                        Admin
                        wrote on last edited by
                        #11

                        Problems I found when investigating this earlier.

                        1. The IR codes (from the xml-files) is too large to fit in one message. They need to be splitted into 2-3 parts. The Pronto-codes also needs to be converted into something usable by the Arduino library. If a checksum is calculated they could perhaps be stored on the Arduino-side in EEPROM after transmission and be "executed" by just sending checksum to trigger IR-transmission.
                        2. Blaster is only one-way. We might want to receive remote commands back to vera also right? Learn-mode?

                        SQBlaster plugin code http://code.mios.com/trac/mios_sqblaster/browser/trunk

                        I would be really happy if someone could pursue this and provide a PR.

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          naveen
                          wrote on last edited by
                          #12

                          This would be really cool and a great alternative to the 200$ SQBlaster, good luck!

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            steets250
                            wrote on last edited by steets250
                            #13

                            @gregl Thanks for the link! It helps to be able to create custom IR codes, should help with Hek's problem.

                            @hek Would it be possible to store the IR codes on the Arduino and have them transmitted locally? Using GREGL's custom device creation, the xml could transmit a two or three-digit code that is then matched to a larger code in the Arduino.

                            If the received message = 001, then transmit the code. Each number represents a different remote button.

                            Problem or learning codes can be solved using an IR reciever, like http://www.radioshack.com/product/index.jsp?productId=2049727. Codes can be printed to the Serial and then copied into the Arduino's code.

                            Thank you!

                            BulldogLowellB 1 Reply Last reply
                            0
                            • S steets250

                              @gregl Thanks for the link! It helps to be able to create custom IR codes, should help with Hek's problem.

                              @hek Would it be possible to store the IR codes on the Arduino and have them transmitted locally? Using GREGL's custom device creation, the xml could transmit a two or three-digit code that is then matched to a larger code in the Arduino.

                              If the received message = 001, then transmit the code. Each number represents a different remote button.

                              Problem or learning codes can be solved using an IR reciever, like http://www.radioshack.com/product/index.jsp?productId=2049727. Codes can be printed to the Serial and then copied into the Arduino's code.

                              Thank you!

                              BulldogLowellB Offline
                              BulldogLowellB Offline
                              BulldogLowell
                              Contest Winner
                              wrote on last edited by
                              #14

                              @steets250 said:

                              @hek Would it be possible to store the IR codes on the Arduino and have them transmitted locally? Using GREGL's custom device creation, the xml could transmit a two or three-digit code that is then matched to a larger code in the Arduino.

                              If the received message = 001, then transmit the code. Each number represents a different remote button.

                              That's it!

                              If there are a lot of long codes, you may have a problem with memory. Look into PROGMEM if you are not already familiar with it, and store all the codes in flash.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                steets250
                                wrote on last edited by
                                #15

                                A quick code that I made that should be able to work with MySensors, I just need S_IR to be set up. Any news, @hek ??

                                #include <IRremote.h>
                                #include <Sensor.h>
                                #include <SPI.h>
                                #include <EEPROM.h>
                                #include <RF24.h>
                                #define ID 1

                                Sensor gw;

                                int recvLED = 13;
                                int numberBtns = 34; //The number of entries in irRECIEVE.
                                IRsend irsend;

                                const unsigned long irTRANSMIT[] = {
                                0xA3C8EDDB, //Power
                                0xA3C8EDDB, //Volume Up
                                //Insert other codes.
                                };

                                void setup()
                                {
                                pinMode(recvLED, OUTPUT);
                                digitalWrite(recvLED, LOW);

                                gw.begin();
                                gw.sendSketchInfo("IR Sender and Reciever", "1.0");
                                gw.sendSensorPresentation(ID, S_IR);
                                }

                                void loop() {

                                unsigned long recv_value;

                                if (gw.messageAvailable()) {
                                message_s message = gw.getMessage();

                                if (message.header.type==V_IR_SEND) {
                                recv_value = atoi(message.data);
                                irsend.sendSony(irTRANSMIT[recv_value], 1);
                                Serial.println(recv_value);
                                }
                                }
                                }

                                1 Reply Last reply
                                0
                                • hekH Offline
                                  hekH Offline
                                  hek
                                  Admin
                                  wrote on last edited by
                                  #16

                                  @steets250 said:

                                  A quick code that I made that should be able to work with MySensors, I just need S_IR to be set up. Any news, @hek ??

                                  News? Me? :) Sorry..
                                  Someone need to create/design a new "urn:schemas-arduino-cc:device:ArduinoIr:1"- device on the Vera side. As I said earlier I would be glad if someone else looked into this as I'm working on other parts right now.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    steets250
                                    wrote on last edited by steets250
                                    #17

                                    @hek I think I may have just found a solution!! (Or I might have done something useless).

                                    I the L_Arduino.lua, you have IR = {20, "urn:schemas-arduino-cc:device:ArduinoIr:1", "D_ArduinoIr1.xml", "IR "},

                                    I simply changed it to IR = {20, "urn:schemas-arduino-cc:device:ArduinoIr:1", "D_IrTransmitter1.xml", "IR "},

                                    and I updated the plugin. Now see what happens when I present S_IR:

                                    Screen Shot 2014-06-05 at 6.13.42 PM.png

                                    And, when I create an IR device:

                                    Screen Shot 2014-06-05 at 6.13.56 PM.png .

                                    MySensors doesn't crash like before, and all I had to do was change D_ArduinoIr1.xml to D_IrTransmitter.xml.

                                    My next problem is that I can't get the Arduino to serial printout the IR message that it is receiving. I have this program set up (simplified version that I posted before):

                                    #include <Sensor.h>
                                    #include <SPI.h>
                                    #include <EEPROM.h>
                                    #include <RF24.h>
                                    #define ID 2

                                    Sensor gw;

                                    void setup()
                                    {
                                    gw.begin();
                                    gw.sendSketchInfo("IR Transmitter", "1.0");
                                    gw.sendSensorPresentation(ID, S_IR);
                                    }

                                    void loop() {

                                    if (gw.messageAvailable()) {
                                    message_s message = gw.getMessage();
                                    Serial.print(message.data);
                                    }
                                    }

                                    Seeing that I am not familiar as to how messages are sent from Vera to Arduino, I am not sure if there is something that I am missing.

                                    Thanks for your help!

                                    P.S. If you do not have time to further look into this, is there anyone else that would be able to help me with this? I saw that you mentioned that you are working on other things currently.

                                    BulldogLowellB 1 Reply Last reply
                                    0
                                    • greglG Offline
                                      greglG Offline
                                      gregl
                                      Hero Member
                                      wrote on last edited by
                                      #18

                                      @steets250 said:

                                      recv_value = atoi(message.data);

                                      atoi means asci to int

                                      so i presume if you are getting something back its just a number?

                                      I had same issue, again in heater sketch.
                                      http://forum.micasaverde.com/index.php/topic,24588.msg170887.html#msg170887

                                      try:
                                      Serial.print(message.data);

                                      And see why you get... if its the data you expected then you should be able to use it directly???

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        steets250
                                        wrote on last edited by
                                        #19

                                        @gregl Thanks for the correction, but still no serial data. I changed the code in my previous comment to reflect your suggestion. I will have to see what Hek says. I have a feeling that the Vera is not sending a message back to the Arduino.

                                        1 Reply Last reply
                                        0
                                        • S steets250

                                          @hek I think I may have just found a solution!! (Or I might have done something useless).

                                          I the L_Arduino.lua, you have IR = {20, "urn:schemas-arduino-cc:device:ArduinoIr:1", "D_ArduinoIr1.xml", "IR "},

                                          I simply changed it to IR = {20, "urn:schemas-arduino-cc:device:ArduinoIr:1", "D_IrTransmitter1.xml", "IR "},

                                          and I updated the plugin. Now see what happens when I present S_IR:

                                          Screen Shot 2014-06-05 at 6.13.42 PM.png

                                          And, when I create an IR device:

                                          Screen Shot 2014-06-05 at 6.13.56 PM.png .

                                          MySensors doesn't crash like before, and all I had to do was change D_ArduinoIr1.xml to D_IrTransmitter.xml.

                                          My next problem is that I can't get the Arduino to serial printout the IR message that it is receiving. I have this program set up (simplified version that I posted before):

                                          #include <Sensor.h>
                                          #include <SPI.h>
                                          #include <EEPROM.h>
                                          #include <RF24.h>
                                          #define ID 2

                                          Sensor gw;

                                          void setup()
                                          {
                                          gw.begin();
                                          gw.sendSketchInfo("IR Transmitter", "1.0");
                                          gw.sendSensorPresentation(ID, S_IR);
                                          }

                                          void loop() {

                                          if (gw.messageAvailable()) {
                                          message_s message = gw.getMessage();
                                          Serial.print(message.data);
                                          }
                                          }

                                          Seeing that I am not familiar as to how messages are sent from Vera to Arduino, I am not sure if there is something that I am missing.

                                          Thanks for your help!

                                          P.S. If you do not have time to further look into this, is there anyone else that would be able to help me with this? I saw that you mentioned that you are working on other things currently.

                                          BulldogLowellB Offline
                                          BulldogLowellB Offline
                                          BulldogLowell
                                          Contest Winner
                                          wrote on last edited by
                                          #20

                                          @steets250 said:

                                          P.S. If you do not have time to further look into this, is there anyone else that would be able to help me with this? I saw that you mentioned that you are working on other things currently.

                                          try to use a simple binary switch first

                                          try to use a change of state:

                                           if (gw.messageAvailable())
                                          

                                          to then trigger a get:

                                          gw.getStatus(CHILD_ID, V_VAR1);
                                          

                                          vera side, send a new variable to V_VAR1 (variable 1) and then toggle the switch

                                          once you grab the number in the arduino,, toggle the switch off and you are ready for the next command

                                          S 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          24

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular