#Temperature and Humidity Data Collection Using Arduino and Scratch
Project Title: Temperature and Humidity Data Collection Using Arduino and Scratch
1. Introduction:
● This project involves collecting temperature and humidity data using an Arduino and a DHT11/DHT22 sensor.
● The data will be displayed in Scratch and exported to an Excel file.
2. Components Required:
● Arduino Uno (or compatible board)
● DHT11/DHT22 temperature and humidity sensor
● Jumper wires
● USB cable for Arduino
● Computer with Scratch and Arduino extension installed
3. Circuit Diagram & Connection:
● Connect the VCC pin of the DHT sensor to 5V on Arduino.
● Connect the GND pin to GND on Arduino.
● Connect the Data pin to Digital Pin 2 on Arduino.
4. Software Setup:
● Install Scratch and the Arduino extension.
● Install the DHT sensor library in Arduino IDE.
● Upload the Arduino sketch to communicate with Scratch
5. Arduino Code:
● Open Arduino IDE and upload the following code:
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11 // Change to DHT22 if using that sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
float temp = dht.readTemperature();
float hum = dht.readHumidity();
Serial.print("Temperature: ");
Serial.print(temp);
Serial.print(" C ");
Serial.print("Humidity: ");
Serial.print(hum);
Serial.println(" %");
delay(2000);
}
6. Scratch Configuration:
● Open Scratch and add the Arduino extension.
● Use Serial Read blocks to receive data from Arduino.
● Use Scratch CSV Logger extension or manually copy data from Scratch to a CSV file.
● Open the CSV file in Excel for analysis.
8. Testing & Results:
● Ensure that Scratch is displaying live temperature and humidity values.
● Verify the exported data in Excel.
9. Conclusion:
● Successfully collected and logged temperature & humidity data using Arduino and Scratch.
● Data can be further analyzed for environmental monitoring applications.10. References & Additional Learning:
● Arduino Official Website
● Scratch Programming Guide
● DHT Sensor Datasheet
11. Additional Reference Videos:
● https://www.youtube.com/watch?v=b968xQr8Kwg(DHT11 Temperature Sensor Interfacing With Arduino).
● https://www.youtube.com/watch?v=zOa5o9Yq_ZU(Scratch Basics).
● https://www.youtube.com/watch?v=pCCJVt2251Y&list=PLk-9mEhYb2OVpfWfjU0F sV4vGKMvV84KN(Programming Arduino With Scratch).
Comments
Post a Comment