Could be the Puck.js IR emiter too weak?

Posted on
  • Hi,

    I'd like to control my IR cheap bulb with Puck.js, the bulb works fine, it can be controlled with the remote.

    The problem is the Puck.js, I can see some IR light when I trigger the code. I tryed different codes some recorded by myself some from internet (quite similar), I tried different buttons, red, blue, on, off... I tried to put the puck quite close.

    Is perhaps Puck.jsjust weak? I'm doing something wrong?

    Thanks


    1 Attachment

    • infrared.png
  • I did try to imitate the TV remote and it doesnt work. Perhaps I should build an arduino IR receptor to debug what is Puk.js sending?

  • Is your firmware up to date on the Puck? I know some earlier Puck.js v2 firmwares had some issues where I think they had the drive polarity wrong

  • Hi Gordon, I have 2.10, when conected says: Found PUCKJS, 2v10

    Should I upgrade it? Could it be my PUCKJS?

    Thanks

  • Hi Gordon,

    Do you think my Puck.js could be somehow wrong? I have a plan to make a morning alarm that wakes you up with light, and PUCK.JS is perfect!

    Thanks

  • Ok, if you're on 2v10 that's probably not the issue then. I guess having some kind of Arduino debug would be good. If you had an oscilloscope/digital signal analyser (or a way to bodge one up using an Arduino/similar) that'd be super helpful.

    Looking at the array you're sending, the [9.6,4.9,... start looks really good (although it is quite long).

    However right at the end you've got [43.1. .... - and it looks to me like that could almost be a second IR command that's got tacked on the end that is confusing things?

  • Hi all! Happy new year to all of you! My new years resolution is to make the most of the Bangle watch 2, so I can't let my current projects down.

    I've been debugging with arduino, and I turned my lamp on from the arduino with the code I got from your tutorial.

    So I tried this same code in Puck JS an it didn't work . Then I calculated the difference between the code on your page and the signal from puckJS and this was the result:

    Original on code from puck's page (71 elements)
    const original = [9600, 4900, 500, 700, 500, 700, 600, 700, 500, 700, 500, 700, 600, 700, 500, 700, 500, 700, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 600, 700, 500, 600, 600, 700, 500, 700, 500, 700, 600, 600, 600, 700, 500, 700, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 500, 43100, 9600, 2500, 500];//71

    code received in my arduino after puck sends the original code (68 elements).
    const fromPuck= [9410, 5026, 354, 842, 378, 786, 458, 838, 326, 810, 378, 810, 434, 858, 378, 1378, 302, 890, 438, 2062, 354, 2058, 298, 2098, 434, 2070, 302, 2070, 354, 2046, 410, 2098, 302, 2058, 326, 2118, 382, 2114, 306, 2090, 410, 882, 330, 810, 406, 910, 306, 886, 330, 782, 510, 794, 410, 870, 330, 866, 434, 2086, 302, 2082, 354, 2046, 438, 2102, 306, 2110, 306, 1000];//68

    const diff= [];

    for (let i = 0; i < 68; i++) {
    diff[i]=original[i]-fromPuck[i];
    }
    console.log(diff);

    Difference of the 2 arrays, puck seems to send always just 68 elements
    [190, -126, 146, -142, 122, -86, 142, -138, 174, -110, 122, -110, 166, -158, 122, -678, 198, -190, 162, -162, 146, -158, 202, -198, 166, -170, 198, -170, 146, -146, 190, -198, 198, -158, 174, -218, 218, -214, 194, -190, 190, -182, 170, -210, 194, -210, 194, -186, 170, -82, 90, -194, 190, -170, 170, -166, 166, -186, 198, -182, 146, -146, 162, -202, 194, -210, 194, 42100]//68

    Do you see anything odd? My puck JS is sending signals, I can read them in arduino but they aren't good enough to turn my lamp on, and I'm able to turn my lamp on from my arduino.

    Thanks

  • Thanks - that's interesting, they do seem some way off. I know I'd made some changes in 2v09 that should have made timing more accurate, but it definitely looks like the timings are off. I've filed an issue for it at https://github.com/espruino/Espruino/iss­ues/2125 and when I get a chance I will try and investigate.

    Having said that, it looks a lot like alternate parts of the signal are different - when the IR should be ON the signal is ~150ms SHORTER than it's supposed to be, and when it's OFF it's ~150ms LONGER (although there do seem to be some big glitches there for some reason).

    So I don't know whether those differences come because the Puck's transmission is wrong, or because the IR receiver is taking a long time to receive the signal.

    It might be that just modifying the original signal will fix it?

    var original = [9600, 4900, 500, 700, 500, 700, 600, 700, 500, 700, 500, 700, 600, 700, 500, 700, 500, 700, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 600, 700, 500, 600, 600, 700, 500, 700, 500, 700, 600, 600, 600, 700, 500, 700, 600, 1900, 500, 1900, 500, 1900, 600, 1900, 500, 1900, 500, 43100, 9600, 2500, 500];
    for (var i=0;i<original.length;i++) original[i] += (i&1)?-150:150;
    // now send...
    
  • Well spoted! I'll try this weekend.

    Thanks

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

Could be the Puck.js IR emiter too weak?

Posted by Avatar for Alberto @Alberto

Actions