1. Description

kidsbits blocks coding DHT12 temperature and humidity sensor is fully compatible with kidsbits control board and Lego building blocks.
You can easily connect it to kidsbits control board for communication using an RJ11 cable without worrying about wrong connection and damage.

The DHT12 sensor is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and provides a pre-calibrated digital signal output.

This DHT12 sensor adopts single bus communication way, which has ultra small volume and lower power consumption than DHT11 sensor.

2. Technical Parameters

  • Interface: EASY plug
  • Operating voltage: DC 5V
  • Control port: digital bidirectional single bus
  • Temperature range: -20℃ to +60℃
  • Temperature accuracy: ±4% RH (at 95% RH)
  • Humidity range: 20% RH-95%RH
  • Humidity accuracy: ±0.5℃ (at 25℃)

3. Wiring Diagram

4. Import kidsbits library

Begin with the Mixly blocks coding, you should first import the corresponding kidsbits library for those sensor modules.
Connect the control board to your computer using a USB cable.

Then open the Mixly blocks software 0.998, set the board to UNO R3, select your correct COM port. On the upper right corner you can switch the language.

After that, click Import, import the keyes-kidsbits library. Shown below.

If import custom library successfully, you should see the sensor module library shown below.

Click on the display screen block of keyes_kidsbits, you can directly use the corresponding module.

5. Test Code

Open the code folder we provided, or you are able to directly drag the code to Mixly window.

You can click the Code to check the C language.

6. Code Explanation

Write the Code:

Restart the Mixly software, follow the method mentioned above, find the module. Shown below.

  • DHT12: represents the model of temperature and humidity module (there are many types), this is DHT12.
  • 0: the control pinthat the module should connected. Here set to digital port 6.
  • Get Temperature:the temperature value measured by DHT12 module.
  • Get Humidity: the humidity value measured by DHT12 module.

7. Test Result

Hook it up and upload the code success, open the monitor and set the baud rate to 9600. It will display the current temperature and humidity value.

8. Resources Download

https://drive.google.com/open?id=1wO4vPo08kV8kJjAPywMGb3mtNEfwros3