Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    FiPy Temperature Sensor

    Scheduled Pinned Locked Moved FiPy
    6 Posts 3 Posters 100 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      lloureiro
      last edited by

      It have, temperature sensor?

      J 1 Reply Last reply Reply Quote 0
      • rcolisteteR Offline
        rcolistete
        last edited by rcolistete

        Yes, it has the MCU temperature, use machine.temperature(), but it is not yet documented... (even the Pycom development documentation) :

        import machine
        machine.     # type <Tab> keyboard to see the all objects of the machine context
            __class__       __name__        main            ADC
            BROWN_OUT_RESET                 CAN             DAC
            DEEPSLEEP_RESET                 HARD_RESET      I2C
            PIN_WAKE        PWM             PWRON_RESET     PWRON_WAKE
            Pin             RMT             RTC             RTC_WAKE
            SD              SOFT_RESET      SPI             Timer
            Touch           UART            ULP_WAKE        WAKEUP_ALL_LOW
            WAKEUP_ANY_HIGH                 WDT             WDT_RESET
            deepsleep       disable_irq     enable_irq      flash_encrypt
            freq            idle            info            mem16
            mem32           mem8            pin_sleep_wakeup
            remaining_sleep_time            reset           reset_cause
            rng             secure_boot     sleep           temperature
            unique_id       wake_reason
        machine.temperature()   # in F
            116
        (_ - 32)/1.8            # in C
            46.66667
        

        My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

        L J 2 Replies Last reply Reply Quote 1
        • L Offline
          lloureiro @rcolistete
          last edited by

          @rcolistete Thank you for booth answers :)

          1 Reply Last reply Reply Quote 0
          • J Offline
            jcaron @rcolistete
            last edited by

            @rcolistete that’s probably the CPU’s temperature, which is most certainly quite different from ambient temperature, isn’t it?

            rcolisteteR 1 Reply Last reply Reply Quote 0
            • rcolisteteR Offline
              rcolistete @jcaron
              last edited by

              @jcaron Yes, it is the ESP32 internal temperature sensor, always reading above the environment temperature (15-25 C more).

              My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

              1 Reply Last reply Reply Quote 0
              • J Offline
                jcaron @lloureiro
                last edited by

                @lloureiro so the answer depends on what temperature you want to measure: the CPU temperature or the ambient temperature.

                For the former you can use machine.temperature as suggested by @rcolistete

                For the latter you’ll need an external sensor. The Pysense board has one (though at least on the first version it wasn’t perfect due to not being isolated enough from sources of heat such as the CPU, IIRC). Or you could connect any external temperature sensor using SPI or I2C or any number of other interfaces. I would not recommend a sensor with an analog output as the ESP32 ADCs are not very precise.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom