Puck.IR() definition clarification needed

Posted on
  • Wed 2017.08.02

    I wish to send a slow pulse train via the onboard IR diode, say [500ms on, 500ms off] repeat three times.

    From page: http://www.espruino.com/Puck.js#ir-infra­red

    "IR / Infrared

    To transmit an IR signal, you just need to call Puck.IR([...]) with an array of times in milliseconds. They alternate between the time the signal should be on and off - eg. [on, off, on, off, on, etc].
    For example the command to turn on a cheap IR lightbulb is:"


    From page: http://www.espruino.com/Reference#l_Puck­_IR

    Parameters: 'data - An array of pulse lengths, in milliseconds'



    The declaration is missing some detail.

    Q1: What is the range (width) in msec that each pulse may be? For instance min 0.5msec max 500msec

    Q2: Does the array have to specify an exact count 'n' (on, off) cycles? For instance 'n' must equal 20

    Q3: Does the tutorial at '(a tutorial on this will be added soon)' exist?


    Sidebar:
    The link at 'For example the command to turn on a cheap IR lightbulb is:' produces a 404 error

    Thank you for your input,
    Robin

  • I wish to send a slow pulse train via the onboard IR diode, say [500ms on, 500ms off] repeat three times.

    Just Puck.IR([500,500,500,500,500])...

    What is the range (width) in msec that each pulse may be? For instance min 0.5msec max 500msec

    It's large and small enough that you shouldn't have to worry. The minimum is going to be around 1/20000 (because the pulses are 40kHz) and the max is possibly even hours.

    Q2: Does the array have to specify an exact count 'n' (on, off) cycles? For instance 'n' must equal 20

    No, but ideally it'd be an odd number because of 'on...off...on' - a 'off' on the end wouldn't make sense

    Q3: Does the tutorial at '(a tutorial on this will be added soon)' exist?

    I don't understand the question - do you have a link to where it says that? The reference page mentions http://www.espruino.com/Puck.js+Infrared­ - which works.

    However for some reason it's not turning URLs in to links properly - I'll see if I can fix that.

  • Thr 2017.08.03

    Thank you @Gordon for the clarification. That was the snippet I was using.

    Puck.IR([500,500,500,500,500])

    Now for the tough part. How to troubleshoot IR detection, when one is unable to see infrared output. Sorry, only born with super human strength and X-Ray vision.

    Have an IR pair circuit with three inches separating the detector and emitter, as in a beam break circuit. When the beam is broken, a colored LED illuminates. This works as expected.

    However, when I substitute the Puck for the emitter, [Puck visible LED side facing detector] there isn't any apparent detection.



    ahhh ha!! . . . Forgot the old cell phone video mode trick. That device does make the IR LED transmission visible.

    Wondering what the Puck IR emitter range is? In my circuit, I seem to need to be quite close. e.g. One inch. Are you able to point me to a spec sheet? Any experience with an expected transmission distance?




    re: "I don't understand the question - do you have a link to where it says that?"

    From page: http://www.espruino.com/Puck.js#ir-infra­red

    Fifth line below the heading "IR / Infrared"

    "You can sometimes work this information . . . (a tutorial on this will be added soon)."


    Re:

    "The reference page mentions http://www.espruino.com/Puck.js+Infrared­ - which works."

    Should your click event 'turn on a cheap IR lightbulb is' be different, than when clicked I get:

    http://www.espruino.com/www.ebay.com/sch­/i.html?_nkw=ir+rgb+light+bulb&_sacat=0

    This is the link that is returned in the browser, which indicates 404

    Should your link be working, I wonder if browser caching is partly a cause. I'm using Chrome Version 59.0.3071.115

    or, . . . as we suspect here in the States that all web traffic is intercepted and stored in the massive Zettabyte storage site in Utah USA, https://en.wikipedia.org/wiki/Utah_Data_­Center
    and the returned link became corrupt from their tampering somehow.

    https://www.forensicmag.com/article/2013­/09/data-storage-issues
    "1 Zettabyte (ZB) – is equal to 1 billion Terabytes and represents approximately 36 million years of stored HD video. Recently it was reported that the National Security Agency facility located in Utah will be able to store 5 Zettabytes of information."


    'The truth is out there' . . . [fade to familiar sound byte] . . . . and . . . . . cut

  • Wondering what the Puck IR emitter range is?

    With up to date firmware, I've had about 1.5 meters. However, Puck.IR output an IR remote control style signal (which is pulsed at 40kHz). You would probably have more success using one of these types of detectors for it: http://www.espruino.com/IRReceiver

    It's possible the TX/RX pair you have are even using a different wavelength of light as well.

    a tutorial on this will be added soon

    Aha, thanks! I was looking on the reference page. I'll get that fixed.

    http://www.espruino.com/www.ebay.com

    It's much less exciting I'm afraid. It's the fault of the webpage (not putting http on the front of the link). That's fixed now, I just have to upload the changed page.

  • Thr 2017.08.03

    Thank you @Gordon. Also had wondered if that might have been an issue. Ref wavelength:

    It's possible the TX/RX pair you have are even using a different wavelength of light as well.

    It does appear my detector is very directional. Will have to play some more.

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

Puck.IR() definition clarification needed

Posted by Avatar for Robin @Robin

Actions