Read Surrounding Temperature and Humidity Using Grove Beginner Kit

Have you ever wondered about the temperature and humidity of your surroundings?

Introduction

When air temperature increases☀️, air can hold more water molecules💧, and its relative humidity decreases. When temperatures drop⛅️, relative humidity increases.

Let’s check our surrounding temperature and humidity using this Grove Beginner Kit without doing any wiring. It’s so easy!

Video

This video shows how to read surrounding temperature and humidity using Grove Beginner Kit.

Hardware Preparation

This is the list of items used in the video.

Sample Program

This is python3 sample program for sending a video to telegram. You can use it with Thonny Python IDE.

#include "DHT.h"
#include <Arduino.h>
#include <U8x8lib.h>
#define DHTPIN 3
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
#define LED 4
#define PIEZO 5
float temp, humi;
void getReading(){
temp = dht.readTemperature();
humi = dht.readHumidity();
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 33);
u8x8.print("Temp:");
u8x8.print(temp);
u8x8.print("C");
u8x8.setCursor(0, 50);
u8x8.print("Humidity:");
u8x8.print(humi);
u8x8.print("%");
u8x8.refreshDisplay();
delay(200);
}
void setup(void) {
Serial.begin(9600);
Serial.println("DHTxx test!");
dht.begin();
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFlipMode(1);
pinMode(LED, OUTPUT);
pinMode(PIEZO, OUTPUT);
}
void loop(void) {
getReading();
if (temp>32){
digitalWrite(LED,HIGH);
tone(PIEZO,1000,500);
delay(700);
}
else{
digitalWrite(LED,LOW);
noTone(PIEZO);
}
}

view raw
DHT_grove.ino
hosted with ❤ by GitHub

Thank You

References:

Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.

Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for better application.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Simple Alarm System Using Maker Nano
Program Cucumber ESP32-S2 Using CircuitPython
Face Recognition Using OpenCV on Raspberry Pi 400
Turned Your Tablet as a Display for the Raspberry Pi 400
OpenCV Template Matching on Raspberry Pi 400
Scroll to Top