Infrared boost?

Posted on
  • I'm trying to make a fairly simple button which will turn both my TV and AV receiver off. This will help both myself and my wife make the quick transition from watching some TV to heading up to bed when our baby daughter starts crying.

    I've posted the code below, and after some experimentation with waiting between IR signals, I've got something working, but I have to hold the Puck really close to the devices for it to work. Is there some way to boost the IR signal (brightness of the IR LED?) or is it really for 'close range' connections?

    Gordon's examples of IR usually show his cheap IR lamp, but a lamp would usually be placed some distance from any button you'd want to control with, so although it's a visual example, it may be a bit contrived if it can't actually reach across a reasonable size room. I'm only trying to go about 2m (one through a glass door and have only managed to get it working successfully from about 20cm.

    var pronto = require ('pronto');
    
    var tvOff = pronto.decode('0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689'); // Samsung discrete Power Off
    
    var avOff = pronto.decode('0000 006c 0022 0002 0156 00ac 0016 0016 0016 0040 0016 0016 0016 0016 0016 0040 0016 0016 0016 0040 0016 0040 0016 0016 0016 0016 0016 0040 0016 0040 0016 0016 0016 0040 0016 0040 0016 0016 0016 0040 0016 0040 0016 0040 0016 0016 0016 0016 0016 0016 0016 0040 0016 0016 0016 0016 0016 0016 0016 0016 0016 0040 0016 0040 0016 0040 0016 0016 0016 0040 0016 05cc 0156 0055 0016 0e5d'); // Onkyo discrete Power Off
    
    var waitBetweenSignals = 250;
    
    var sendIRSignals = function(signals) {
      console.log('Sending IR');
      Puck.IR(signals.shift());
      if (signals.length > 0) {
        setTimeout(sendIRSignals, waitBetweenSignals, signals);
      }
    };
    
    var turnOff = function() {
      console.log('Turning off');
      sendIRSignals([tvOff, avOff]);
    };
    
  • Wow, nice use of array.shift() and the setTimeout argument there!

    Yes, it's not great at long distances. It will be slightly better without the silicone top on, but perhaps only 50%.

    The idea is that because Puck.js is wireless and battery powered, you stick it near the thing you want to control with IR, and then you either control Puck.js with another Puck.js or via a phone.

    I have just found a potential software issue which means that Puck.js might not be driving the IR LED quite as hard as it could be, so I'll see what I can do to improve that now - however I can't promise much.

    Another option mentioned in the post @navas linked is to wire up an external IR LED. You could even wire up multiple LEDs in different locations if you really needed to send signals in different directions (eg, one inside a cupboard)

  • Nailed it :) There's a build for Puck.js in here (the zip file): http://www.espruino.com/binaries/travis/­db6c9ab777025acbc5a419b022023eab3ad7b9a1­

    If you try uploading that firmware you should find that range has increased by almost 3 times. I can get almost 90cm out of it now (or 70cm with the case on).

  • @Gordon you're right, that does increase the range significantly! Thanks.

    It's not far enough to have the button sitting on the arm of a chair to control both devices, but it'll do for pointing at each device in turn and clicking the button to turn it off.

  • Great! It sounds like if you were willing to use your phone to turn it on, or another Puck, it'd be perfect now?

    You could dismantle an old IR remote control and attach the IR LED from it onto Puck.js. Without a resistor to limit the current and with the way it's a lot more directional, that would probably work really well for you.

  • @Gordon does your fix also improve performance of external IR LED? Or had the bug only influence while using the internal LED?

  • Yes, it'll improve both

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Infrared boost?

Posted by Avatar for dsample @dsample

Actions