• Nice! Thanks for posting up the code!

    This is the kind of thing that'd be quite cool in https://www.espruino.com/apps I guess - then users could just post in the code they get from OpenHaystack (maybe OpenHaystack could even be modified to post up a URL that would automatically load up a Puck)

    But yes, those spikes may well be due to clock calibration. What do you think the average power draw from them is?

  • Indeed I am planning to submit you a pull request with the code on GitHub.
    (It may take me some time thought as I am not that familiar with the Espruino Store architecture and Javascript in general.)
    I would like to design a popup window where someone enters his/her OpenHaystack advertisement key (aka public key) before uploading the code.
    (I have seen some examples on the Store I could get inspired from.)


    To compute the extra average current consumption due to clock calibration, data is taken from the above measurements (@3V):

    • 386.58uA clock calibration average current during 18.64ms every 8s
    • 2.14uA deep sleep average current

    Thus, alternating calibration for 0.001864s and deep sleep for 8-0.001864 = 7.998136s every 8s, the average current required for such cycles can be computed as a weighted arithmetic mean:

    ( 386.58*0.001864 + 2.14*7.998136 ) / 8 = 2.23uA

    The additional average current consumption due to clock calibration (mandatory when using the internal RC oscillator) with respect to a board that deep sleeps only (thus equipped with an external low-frequency crystal) is:

    2.23 - 2.14 = 0.09uA

    This represents 0.09 / 2.14 = 0.042 = 4.2% more


    PS: Could you move this thread to Home / Projects in the Forum?
    I believe it rather belongs there than where it is currently at Home / Official Espruino Devices / Puck.js, Pixl.js and MDBT42.

About

Avatar for Gordon @Gordon started