এসডি কার্ডে তাপমাত্রার ডেটালগার — প্রতি সেকেন্ডে এক লাইনTemperature Data Logger to an SD Card
প্রতি সেকেন্ডে DHT22 পড়া হয় আর প্রতিটা পাঠ SD কার্ডে CSV লাইন হয়ে জমা হয় — ক্লাউড বা কম্পিউটার ছাড়াই। প্রতি লেখায় সবুজ বাতি একবার জ্বলে।
The DHT22 is read once a second and each reading lands as a CSV row on the SD card — no cloud, no PC needed. A green lamp blips on every write so you can see it working across the room.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno R3 Arduino Uno
- 1 × DHT22 temperature & humidity DHT22 তাপমাত্রা ও আর্দ্রতা সেন্সর
- 1 × Micro SD card module মাইক্রো SD কার্ড মডিউল
- 1 × Resistor 330Ω Resistor
- 1 × LED (green) LED বাতি
- 12 × Jumper wires জাম্পার তার
তার লাগানো · Wiring
| DHT22 temperature & humidity VCC | → | Arduino Uno R3 5V |
| DHT22 temperature & humidity GND | → | Arduino Uno R3 GND |
| DHT22 temperature & humidity DATA | → | Arduino Uno R3 D2 |
| Micro SD card module VCC | → | Arduino Uno R3 5V |
| Micro SD card module GND | → | Arduino Uno R3 GND |
| Micro SD card module MISO | → | Arduino Uno R3 D12 |
| Micro SD card module MOSI | → | Arduino Uno R3 D11 |
| Micro SD card module SCK | → | Arduino Uno R3 D13 |
| Micro SD card module CS | → | Arduino Uno R3 D10 |
| Arduino Uno R3 D9 | → | Resistor a |
| Resistor b | → | LED A |
| LED K | → | Arduino Uno R3 GND.3 |
Code (Arduino C++)
#include <SPI.h>
#include <SD.h>
#include <DHT.h>
// Temperature datalogger: reads the DHT22 once a second and appends a row to
// log.csv on the SD card — timestampless CSV you can open straight in Excel.
// The green lamp blips on every write so you can see it working across the
// room. This is the same pattern a cold-chain logger uses on a medicine van.
DHT dht(2, DHT22);
long lastLog = 0;
int rows = 0;
void setup() {
Serial.begin(9600);
pinMode(9, OUTPUT);
dht.begin();
if (!SD.begin(10)) { Serial.println("SD card failed"); while (1) delay(10); }
File f = SD.open("log.csv", FILE_WRITE);
if (f) { f.println("row,temperature_c,humidity_pct"); f.close(); }
}
void loop() {
if (millis() - lastLog >= 1000) {
lastLog = millis();
float t = dht.readTemperature();
float h = dht.readHumidity();
rows++;
File f = SD.open("log.csv", FILE_WRITE);
if (f) {
f.print(rows); f.print(','); f.print(t, 1); f.print(','); f.println(h, 0);
f.close();
digitalWrite(9, HIGH); delay(40); digitalWrite(9, LOW);
Serial.print("Logged row "); Serial.print(rows);
Serial.print(": "); Serial.print(t, 1); Serial.print(" C, "); Serial.print(h, 0); Serial.println("%");
}
}
}
আরো project · More projects
- গ্যাস চুলার ফ্লেম গার্ড — আগুন নিভলে গ্যাস কেটে দেয়Gas-stove flame guard (cuts the gas if the flame dies)
- সিঁড়ির বাতি নিজে নিজে বন্ধ হয় — PIR সেন্সর দিয়েStair light that switches itself off (PIR + lamp)
- ESP32 মোশন অ্যালার্ট — PIR দেখলে ক্লাউডে খবর, বাসায় বাজারESP32 motion alert (PIR pings the cloud, buzzer at home)
- লঞ্চ নিরাপত্তা মনিটর — ওজন, কাত আর পানির অ্যালার্মLaunchGuard: boat safety monitor (load, tilt, flood)