Thermohygrometer -Arduino UNO R3-
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
This is a simple temperature and humidity meter built using an Arduino and a 3D printer.
- Ocena
- 0 / 5
- Polubienia
- 1
- Pobrania
- 7
- Wydruki
- 0
- Wyświetlenia
- 46
- Oceny
- 0
Aktualizacja u źródła:
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Other Gadgets
- Licencja
- Open Community License v1.1
Thank you for your interest!
※Posted via Google Translate※
This is my first project post: a temperature and humidity meter built using an Arduino UNO R3 and a 3D printer. Since it uses the DHT11 sensor, high precision isn't to be expected, but the ability to display the date and time makes it a simple yet stylish gadget.
The printed part shown in the photo was made using eSUN Matte PETG (Almond Yellow).
You will need the following components for the build:
・Arduino UNO R3 ×1
・DHT11 ×1
・DS1307 (RTC) ×1
・LCD1602 ×1
・Breadboard ×1
・Round magnets (6mm diameter, 3mm thickness) ×4
・M3 heat-set inserts ×5
*For mounting the Arduino, DS1307, and DHT11
・M3 bolts ×7
・M3 nuts ×2
*Use the bolts and nuts to secure the LCD1602
Please refer to the third photo for wiring instructions.
Download the attached file for the code.
Search for and install the following three libraries via the Arduino IDE's "Library Manager":
① LiquidCrystal I2C (by Frank de Brabander)
② DHT sensor library (by Adafruit) *If prompted to install "Adafruit Unified Sensor" as well, select "Install all"
③ RTClib (by Adafruit)
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <RTClib.h>
#include <DHT.h>// Initialize modules
// Typical LCD I2C address is 0x27 or 0x3F. Change the address if nothing displays.
LiquidCrystal_I2C lcd(0x27, 16, 2);
RTC_DS1307 rtc;
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
// Start each module
lcd.init();
lcd.backlight();
dht.begin();
if (!rtc.begin()) {
lcd.print("RTC Error!");
while (1);
}
// Initialize time with PC clock if RTC is not running or time is off.
// Note: Once set, comment out this line and re-upload to keep time using the coin cell battery.
//if (!rtc.isrunning()) {
// rtc.adjust(DateTime(F(DATE), F(TIME)));
//}
// Uncomment the line below if you want to force-sync with current PC time
//rtc.adjust(DateTime(F(DATE), F(TIME)));
}
void loop() {
// Get current time
DateTime now = rtc.now();
// Get temperature and humidity
float temp = dht.readTemperature();
float hum = dht.readHumidity();
// Error check (if sensor reading fails)
if (isnan(temp) || isnan(hum)) {
lcd.setCursor(0, 1);
lcd.print("Sensor Error ");
delay(1000);
return;
}
// --- Line 1: Date and Time Display (e.g., 26/07/20 09:43) ---
lcd.setCursor(0, 0);
// Format as YY/MM/DD HH:MM
char dateBuffer[17];
sprintf(dateBuffer, "%02d/%02d/%02d %02d:%02d",
now.year() % 100, now.month(), now.day(), now.hour(), now.minute());
lcd.print(dateBuffer);
// --- Line 2: Temp and Humidity Display (e.g., T:25.3C H:60.0%) ---
lcd.setCursor(0, 1);
lcd.print("T:");
lcd.print(temp, 1); // Display up to 1 decimal place
lcd.print("C H:");
lcd.print(hum, 1);
lcd.print("% "); // Clear remaining characters with spaces
delay(1000); // Update every 1 second
}