element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Azure Sphere Starter Kit
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Azure Sphere Starter Kit
  • More
  • Cancel
Azure Sphere Starter Kit
Forum Using  a DHT11 temperature sensor on Starter Kit MT3620
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Azure Sphere Starter Kit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 11 replies
  • Subscribers 49 subscribers
  • Views 1683 views
  • Users 0 members are here
  • azure sphere mt3620 starter kit
  • dht11
  • grove
Related

Using  a DHT11 temperature sensor on Starter Kit MT3620

ale4684
ale4684 over 5 years ago

Hi all,

 

do you know if it is possible connect a Grove Temperature and Humidity sensor (DHT11) to AVNET Starter Kit MT3620 and read values ?

Sensor is this one : Grove - Temperature&Humidity Sensor - Seeed Wiki  

I can only find tutorial about Grove SHT31 Temperature and Humidity sensor and not DHT11 (that is pretty popular).

I am wondering if the already existing Arduino library for Grove DHT11 sensor can be suitable on MT3620 ... here the link https://github.com/Seeed-Studio/Grove_Temperature_And_Humidity_Sensor

Thanks

  • Sign in to reply
  • Cancel

Top Replies

  • Workshopshed
    Workshopshed over 5 years ago +3
    It should be possible to do this without the need for any additional hardware. It looks like the Grove connector is configured for i2C and shared with the LSM6DSO sensor (just spotted your comment that…
  • wizio
    wizio over 5 years ago +2
    https://sadiajabeen92.wordpress.com/2016/05/02/tutorial-for-dht11-and-spi-interface-for-pi/
  • peterfenn
    peterfenn over 5 years ago in reply to ale4684 +2
    Click board Demo Repo Recommended starting point for adding an I2C sensor to your project, is the driver code for Click boards already ported to Azure Sphere For temperature and humidity measurement, code…
  • wizio
    wizio over 5 years ago

    https://sadiajabeen92.wordpress.com/2016/05/02/tutorial-for-dht11-and-spi-interface-for-pi/

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • ale4684
    ale4684 over 5 years ago in reply to wizio

    This one ?

     

     

    /*

    * Simultaneously transmit and receive a byte on the SPI.

    *

    * Polarity and phase are assumed to be both 0, i.e.:

    * - input data is captured on rising edge of SCLK.

    * - output data is propagated on falling edge of SCLK.

    *

    * Returns the received byte.

    */

    uint8_t SPI_transfer_byte(uint8_t byte_out)

    {

      uint8_t byte_in = 0;

      uint8_t bit;

     

      for (bit = 0x80; bit; bit >>= 1) {

      /* Shift-out a bit to the MOSI line */

      write_MOSI((byte_out & bit) ? HIGH : LOW);

     

      /* Delay for at least the peer's setup time */

      delay(SPI_SCLK_LOW_TIME);

     

      /* Pull the clock line high */

      write_SCLK(HIGH);

     

      /* Shift-in a bit from the MISO line */

      if (read_MISO() == HIGH)

      byte_in |= bit;

     

      /* Delay for at least the peer's hold time */

      delay(SPI_SCLK_HIGH_TIME);

     

      /* Pull the clock line low */

      write_SCLK(LOW);

      }

     

      return byte_in;

    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wizio
    wizio over 5 years ago in reply to ale4684

    For example...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • danzima
    danzima over 5 years ago

    peterfenn
    bwilless

    Hi folks, any insights on the above question?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • ale4684
    ale4684 over 5 years ago in reply to wizio

    Some more details and explanation are welcome :-)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • ale4684
    ale4684 over 5 years ago

    How to deal with this ?

     

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wizio
    wizio over 5 years ago in reply to ale4684

    You can use and M0 core for fast pooling DHT GPIO pin and send data to A7 core

    PlatformIO have Arduino (named Wring) for M0 core ...

    just install any DHT library for DHT and put data to uart (for debug) ... if all is OK - send this data to A7 core via mailbox

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • peterfenn
    peterfenn over 5 years ago in reply to ale4684

    Click board Demo Repo

    Recommended starting point for adding an I2C sensor to your project, is the driver code for Click boards already ported to Azure Sphere

    For temperature and humidity measurement, code for the Temp&Hum Click board (based on HTS221 device from ST Micro) is provided

    • Temperature accuracy is ±0.5°C for the 15 to 40°C range (±1°C across the wider the 0 to 60°C range)
    • Relative Humidity accuracy is ±3.5% for the 20 to 80% range (±6% for the full 0 to 100% range)
    • This sensor provides interfaces for both I2C and SPI access

     

    To utilize this click-board library, include the https://github.com/Avnet/clickmodules repo in your project.

    More detail on this topic is available in the following blog article Using MikroE Click Boards with Microsoft Sphere

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • ale4684
    ale4684 over 5 years ago in reply to peterfenn

    Thanks Peter.

     

    Is there an available driver for the sensor in picture (Grove, Temperature and Humidity v1.2) ?

    MikroE Click Boards are quite difficult to find compared to grove sensors, some suggestions about how to use this sensor (Grove sensors are officially supported by the AVNET MT3620) are really appreciated.
    Waiting for your answer

     

    Alessandro

     

    image

     

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • Workshopshed
    Workshopshed over 5 years ago

    It should be possible to do this without the need for any additional hardware.

     

    It looks like the Grove connector is configured for i2C and shared with the LSM6DSO sensor (just spotted your comment that you got that already)

    image

    So you might be better connecting the DHT11 to one of spare I/O pins via the headers meant for the click sockets such as "PWM" on Click1 which is GPIO0_PWM0

    https://www.avnet.com/opasdata/d120001/medias/docus/196/Azure%20Sphere%20Starter%20Kit%20User%20Guide%20(v1.3).pdf

     

    I find these kind of cables are good for that.

    image

    Many of the arduino libraries for the DHT11/DHT22 seem to support multiple version of the sensor / boards which makes them harder to port to a different platform

     

    Here's a basic one which might be easier to port.

    https://playground.arduino.cc/Main/DHT11Lib/

     

    Looking at the DHT11 data sheet, the one wire protocol used by the DHT11 is open drain with a pull up resistor. The seeed grove module appears to have that 5K resistor already in place (with an additional capacitor between the power rails, which we can ignore).

    imageimage

    So when opening the pins you can set the output mode as follows:

     

    GPIO_OpenAsOutput(mypin,GPIO_OutputMode_OpenDrain, GPIO_Value_High)

     

    That means you can avoid the need to keep toggling the pin between input and output.

     

    You'll need to swap the various API calls:

     

    digitalWrite becomes GPIO_SetValue

    digitaRead becomes GPIO_GetValue

    delayMicroseconds becomes nanosleep (found in time.h) and scale the value by 1000

     

    Use a scope to check the timing, the defaults might need tweeking.

     

    Let me know how you get on.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube