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

    Grove Sensors

    Scheduled Pinned Locked Moved WiPy 2&3
    grovesensors
    9 Posts 3 Posters 2.2k 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.
    • F Offline
      francesco.gallo
      last edited by

      Dear All,
      Is There some way to use the grove sensors (i.e https://www.seeedstudio.com/category/Sensor-for-Grove-c-24.html) with WiPy?
      For example, RaspberryPi provides the GrovePi kit.

      Thanks in advance

      L robert-hhR 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @francesco.gallo
        last edited by

        @francesco-gallo
        Grove have many sensors - ask about some specific then someone can hep you

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • F Offline
          francesco.gallo
          last edited by

          Hi Livius,
          thanks a lot for your answer. In particular, I need support on Temperature sensors (http://wiki.seeed.cc/Grove-Temperature_Sensor_V1.2/), but in general my question regards all grove sensors.

          Thanks in advance

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @francesco.gallo
            last edited by

            @francesco-gallo
            I do not have this one but it look like simple analog sensor
            use ADC for it - but remember about voltage levels 3V3 not 5V!

            think about people first, then computers

            F 1 Reply Last reply Reply Quote 0
            • F Offline
              francesco.gallo @livius
              last edited by

              @livius Ok...I will try :D

              Thanks a lot

              BR

              L 1 Reply Last reply Reply Quote 0
              • L Offline
                livius @francesco.gallo
                last edited by livius

                @francesco-gallo

                i do not tested this but you can try

                from machine import ADC
                from math import log
                sensor_T = 4275 #T value          
                sensor_R = 100000 # resistance            
                
                adc = ADC(0)
                adc_c = adc.channel(pin='P13')
                
                while True:
                    value = adc_c();
                
                    R = 1023.0/value-1.0
                    R = sensor_R*R
                
                    temp = 1.0/(log(R/sensor_R)/sensor_T+1/298.15)-273.15; # convert to temperature
                
                    print('temp: ', str(temp))
                

                think about people first, then computers

                1 Reply Last reply Reply Quote 0
                • robert-hhR Offline
                  robert-hh @francesco.gallo
                  last edited by

                  @francesco-gallo In addition to the hints given by @livius some notes:
                  a) you can and should run the Grive sensor at Vcc of 3.3V
                  b) change the lines

                  adc = ADC(0)
                  adc_c = adc.channel(pin='P13')
                  

                  to

                  adc = ADC(0, bits=10)
                  adc_c = adc.channel(pin='P13', attn=adc.ATTN_11DB)"
                  ``'
                  to cope with the 3.3V range of the sensor and set it to 10 bit, which is assumed by the code.
                  L F 2 Replies Last reply Reply Quote 0
                  • L Offline
                    livius @robert-hh
                    last edited by

                    @robert-hh
                    good point

                    think about people first, then computers

                    1 Reply Last reply Reply Quote 0
                    • F Offline
                      francesco.gallo @robert-hh
                      last edited by

                      @robert-hh Thanks a lot...I will try soon

                      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