• Hello, I'm interested in the infrared capabilities of puckJS. I noticed that the board includes an infrared LED, but I can't tell from the pictures if the case covers up this LED? Does the case need to be off in order to use infrared?

  • The case does cover the Infrared, but it doesn't stop it completely - it just diffuses it.

    You'll need to be within 0.5m of the device you want to control, but then it's wireless - so usually it's not too difficult to put it within range. You can take the case off (or cut a hole) to increase range, but then the Infrared is very directional so you'll need to have the flat face of the Puck facing the device you want to control, which can be more difficult,

  • Great description! Thanks Gordon!

  • Hi @Gordon,

    I am looking for the spec for the IR transmitter on the PuckJS. I have been able to use your demo code to transmit and receive IR signals using a pair of PuckJS and 940nm transmitter and https://www.vishay.com/docs/82491/tsop38­2.pdf receiver using the following code to test:

    setWatch(() => {
    	Puck.IR(cmds.mainSelect);  // line 1
    	Puck.IR(cmds.mainSelect, D31, D30); // line 2
    	LED2.toggle();
    }, BTN1, true);
    

    Line 2 works as advertised.

    When I use line 1 only, I cannot get any reading. I doubt the onboard transmitter is busted so it could be an incompatibility issue somewhere else?

  • The IR LED on Puck.js v1 is http://www.kingbrightusa.com/images/cata­log/SPEC/APT1608F3C.pdf - but on the v2 we're moving to 2x no-brand IR LEDs.

    That is surprising about the lack of output though - what firmware version are you using? Older firmwares didn't push the IR transmitter as hard as they could so that may cause issues.

  • Thanks - I am using v2.05 firmware (Sep 2019 vintage PuckJS). The onboard IR LED transmits in the ~940nm (same as mine) so it's odd that the same receiver does not see it.

    I have now inverted the roles of the two PuckJS. Again the same phenomenon (second Puck sees the IR signal from my own LED but not Puck's). It is unlikely that the transmitter on both Pucks are faulty. But I don't have anything else to test them with. Any idea?

  • Please can you try Puck.IR(cmds.mainSelect, D25, D26); and Puck.IR(cmds.mainSelect, D26, D26);?

    I did update the 2v05 firmware to handle Puck.js v2 and it's possible I broke something unintentionally?

  • Your first line (D25,D26) produces result but not (D26,D26)!

    
    var cmds = {
    
    	// main menu top left - select
    	mainSelect: [
    9.0, 4.4, 0.6, 0.5, 0.6, 1.6, 0.6, 1.6, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 1.6, 0.6, 1.6, 0.6, 0.5, 0.6, 1.6, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 0.5, 0.6, 1.6, 0.6, 0.5, 0.6, 1.6, 0.6, 0.5, 0.6, 1.6, 0.6, 1.6, 0.6, 1.6, 0.6, 1.6, 0.6, 0.5, 0.6, 1.6, 0.6, 0.5, 0.6, 1.6, 0.6, 42.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6, 95.9, 9.0, 2.2, 0.6
    ]};
    
    /* received on the other end (D25,D26):
    4.4,0.5,0.6,0.5,1.6,0.5,1.6,0.6,0.5,0.5,­0.5,0.5,0.5,0.5,0.5,0.6,1.6,0.6,1.6,0.6,­0.5,0.6,1.6,0.6,0.5,0.6,0.5,0.6,0.5,0.6,­0.5,0.6,0.5,0.6,0.5,0.6,0.5,0.6,0.5,0.6,­0.5,0.5,1.6,0.6,0.5,0.6,1.6,0.6,0.5,0.6,­1.6,0.5,1.6,0.6,1.6,0.6,1.6,0.5,0.5,0.6,­1.6,0.6,0.5,0.6,1.6,0.6,42.9,8.9,2.3,0.5­,95.9,8.9,2.3,0.5,95.9,8.9,2.2,0.7,95.9,­8.9,2.2,0.7,95.9,8.9,2.2,0.6,95.9,9.0,2.­2,0.6,95.9,9.0,2.2,0.6,95.9,8.9,2.2
    0.2
    */
    

    I guess I will use D25,26 for transmission.

    A query: not sure why the first value is consistently missing (i.e. 9.0).

    Am I in fact transmitting the inverse pattern or am I just not understanding the IR protocol? (The definition file was captured (transmitted from a physical remote) using the same Receiver code, i.e. (from you!)

    function onInit() {
    
    	digitalWrite(D2, 0);
    	pinMode(D1, "input_pullup");
    	var d = [];
    	setWatch(function (e) {
    		d.push(1000 * (e.time - e.lastTime));
    	}, D1, {
    		edge: "both",
    		repeat: true
    	});
    
    
    	var lastLen = 0;
    	setInterval(function () {
    		if (d.length && d.length == lastLen) {
    			d.shift(); // remove first element
    			console.log(d.map(a => a.toFixed(1)).toString());
    			d = [];
    		}
    		lastLen = d.length;
    	}, 200);
    
    	setInterval(() => LED3.toggle(), 500);
    
    }
    
  • Sorry - that was a typo - I actually meant Puck.IR(cmds.mainSelect, D26, D25); (so swapping D25/D26 around).

    I'm pretty sure that'll invert the signal and give you the 1st argument back.

    Sorry about this - looks like I did mess up the IR transmission for Puck.js v1 on 2v05. I'll get a fix in for it now.

  • Ok, if you install a 'cutting edge' firmware build, this should now be fixed :)

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

PuckJS Infrared - Does the case get in the way?

Posted by Avatar for lukewis @lukewis

Actions