• Hello im trying to send a signal from my puckjs with an external ir led to a remote controlled fan. I tried the tutorial with capturing data from the remote control and got some values to my ir receiver . I tried the ordinary built in IR but it did not work i tried to capture the signal with another puck but it sends no signal. I have attached my code. What pins should i use for the ir led? i have used d30 and d31.

    Any ideas?


    2 Attachments

  • I have planned to have it connected to homebridge and controll my fans, automatically turn on the fans when the room gets to hot. But also able to command it by Siri

  • Hi! What firmware is on your Puck.js, and which version Puck is it?

    This seems like something you should be able to do pretty easily and your code looks fine. Do you see anything appear on the second Puck if you paste in Puck.IR([1.3,0.4,1.3,0.4,0.4,1.2,1.3,0.4­,1.3,0.4,0.5,1.2,0.4,1.2,0.4,1.2,0.5,1.2­,1.3,0.4,0.5,1.2,0.5,7.9,1.3,0.4,1.3,0.4­,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2­,0.5,1.2,0.5,1.2,1.3,0.4,0.4,1.2,0.5,7.9­,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4­,0.4,1.2,0.5,1.2,0.5,1.2,0.4,1.2,1.3,0.4­,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2­,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2­,0.4,1.2,1.3,0.4,0.4,1.2,0.5,7.8,1.3,0.4­,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.5,1.2­,0.5,1.2,0.4,1.2,0.5,1.2,1.3,0.4,0.4,1.2­,0.5,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4­,1.3,0.4,0.5,1.2,0.4,1.3,0.4,1.2,0.4,1.3­,1.2,0.4,0.4,1.3,0.4,7.9,1.3,0.4,1.3,0.4­,0.4,1.3,1.3,0.4,1.3,0.4,0.4,1.2,0.4,1.3­,0.4,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.4,7.9­,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4­,0.5,1.2,0.4,1.3,0.4,1.2,0.4,1.3,1.3,0.4­,0.5,1.2,0.4]) in the IDE?

    Using an external IR LED should be fine though... You'll just have to specify the pins with Puck.IR(data, D30,D31) (and maybe swap D30/D31 if it doesn't work first time).

    Or, the code that's in your HTML:

            // Start the 38kHz square wave
            analogWrite(A5,0.9,{freq:38000});
            // Send the pulses
            digitalPulse(A6, 1, times);
            // Wait until pulsing is finished
            digitalPulse(A6, 1, 0);
    

    Should work fine too - you just have to change A5/A6 for D30/D31.

  • Hi, thank you @Gordon, I’m using 2.05 firmware and My puck was bought several years ago so I guess it’s the first version? didn’t know there was a new one

  • Ahh, right. Sorry, I think you fell foul of a bug I introduced while trying to support Puck.js v2 with the same firmware: https://github.com/espruino/Espruino/blo­b/master/ChangeLog#L11

    Puck.js v1: Fix regression that stopped Puck.IR(data) working - Puck.IR(data,D26,D25) required

    So I think if you add D26,D25 to the end of the call it'll start working - or if you install a 'cutting edge' build it'll be fine.

    I'm planning to release a version 2v06 very soon which should have that (and a few other) fixes in though.

  • Thanks @Gordon, that is what I like to call good customer service!

  • @Gordon Hmm it kind of works, but I need to be 10cm from it. The d30/d31 does not work. I have the short one in the d31. Do I need a resistor? Any ideas?

  • @Gordon got it to work. With the externa led My leads didn’t touch the metal.

  • Glad it's going ok! With 2v05 and later you might have some success increasing range of the external LED by just specifying a single IO pin and connecting the other pin of the LED to GND.

    The on-puck LED should do better than 10cm though - it is reasonably directional without the cover though, so it helps if it's pointing towards the thing you're interested in controlling.

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

Sending a signal with Adafruit super-bright 5mm ir led 940nm

Posted by Avatar for furuskog @furuskog

Actions