Industrielle Fertigung
Industrielles Internet der Dinge | Industrielle Materialien | Gerätewartung und Reparatur | Industrielle Programmierung |
home  MfgRobots >> Industrielle Fertigung >  >> Manufacturing Technology >> Herstellungsprozess

High-Precision LED-Matrix-Uhr: DS3231 RTC, BME280 Wetter, BH1750 Licht, ESP-01 NTP

Komponenten und Zubehör

Arduino Nano R3×1
DS3231 RTC Modul (Billigversion: Ladewiderstand für Backup-Batterie entfernen!)×1
BME280 Umweltsensor (Temperatur, Feuchte, Druck)×1
BH1750 Lichtsensor (Auto-Dimmung & Nachtabschaltung)×1
MAX7219 32x8 LED-Matrix (4× 8x8 Module)×1
10 µF Kondensator×2
ESP8266 ESP-01 (Optional: NTP-Zeitsync)×1
LM3940IT 3,3V LDO (für ESP-01)×1
Level-Shifter Board (für ESP-01 3,3V ↔ 5V)×1

Über dieses Projekt

Basiert auf Nick's LED Word Clock. Erweitert um: BME280 (Wetter), BH1750 (adaptive Helligkeit, Nachtmodus), ESP-01 (NTP-Zeitsync via pool.ntp.org), 6 zusätzliche Fonts (erstellt mit dotmatrixtool.com), Menü-Steuerung per 4 Tastern, EEPROM-Speicherung aller Einstellungen, DST/UTC/BST-Berechnung.

Funktionen

Serial-Output bei NTP-Abgleich


Arduino: Sent NTP request to ESP01
ESP01  : NTP request received from Arduino [attempt 1 of 3]
Connecting to SSID: MeinWLAN....connected
SSID: MeinWLAN, IP: 192.168.0.135, RSSI: -42 dBm
Sending NTP packet to: 195.195.221.100 [attempt 1]
Sending NTP packet to: 195.195.221.100 [attempt 2]
UNIX1562848457
Disabling WiFi....ok

Wichtige globale Variablen (Defaults, per Menü/EEPROM änderbar)


// Uhr-Einstellungen
byte intensity = 2;        // [200] Standard-Helligkeit 0-15
byte clock_mode = 0;       // [201] Anzeigemodus
bool random_mode = 0;      // [206] Zufälliger Moduswechsel
bool random_font_mode = 0; // [207] Zufälliger Fontwechsel
bool ampm = 0;             // [208] 0=24h, 1=12h

// Licht-Einstellungen
byte display_mode = 5;     // [202] 0=normal,1=immer an,2=immer aus,3-5=Auto per hour_off
bool auto_intensity = 1;   // [209] Auto-Helligkeit
byte hour_off_1 = 21;      // [210] Auto-Off Zeiten (24h)
byte hour_off_2 = 22;
byte hour_off_3 = 23;

// Font-Einstellungen
byte font_style = 2;       // [203] Großer Font Stil
byte font_offset = 1;      // [204] Font Offset
byte font_cols = 6;        // [205] Font Spalten

// DST/NTP/UTC
bool dst_mode = 1;         // [210] DST aktiv
bool ntp_mode = 1;         // [211] NTP aktiv
byte ntp_adjust = 1;       // [212] Sekunden Korrektur für ESP-Laufzeit
int8_t utc_offset = 0;     // [213] UTC Offset Stunden
byte ntp_dst_hour = 2;     // Sync-Stunde (2 Uhr bei DST)
byte ntp_max_retry = 3;    // NTP Versuche (1-9)
byte ntp_timeout = 45;     // Timeout Basis (Sekunden) * ntp_max_retry

// WiFi Credentials (max 72 Zeichen gesamt)
const byte ssid_len = 8;   const char ssid[] = "YourSSID";
const byte pass_len = 12;  const char pass[] = "YourPassword";

Pin-Belegung


DS3231, BH1750, BME280:  SCL=A5, SDA=A4, VCC=3,3V
LED Matrix (MAX7219):    CLK=D11, CS=D10, DIN=D12, VCC=5V
Taster:                  D2=Menü, D3=Datum/+, D4=Temp/-, D5=Display-Optionen
ESP-01 (optional):       D7=ESP_TX, D6=ESP_RX (via Level-Shifter)

Code

GitHub Repository: https://github.com/Ratti3/miniclock

Dateien:

Schaltplan

(Bild im Original: BME280/BH1750 teilen I²C-Bus; ESP-01 über Level-Shifter an D6/D7; Matrix an SPI-Pins; Taster an D2-D5 mit Pull-Ups)

Hinweis: BH1750 wird wie BME280 an I²C (A4/A5) angeschlossen.

Herstellungsprozess

  1. Arduino Echtzeituhr für islamische Gebetszeiten bauen
  2. LED per Bluetooth mit Arduino steuern – Einfache DIY-Anleitung
  3. Analog-Style LED Persistence-of-Vision Uhr – DIY Arduino Nano Projekt
  4. DIY Heißkleber-LED-Matrix-Lampe – Baue dein eigenes farbiges Display
  5. Arduino-LED per Cortana und Bluetooth unter Windows 10 steuern
  6. Arduino Flip Clock mit 8×8 LED-Matrix – DIY Echtzeituhr-Projekt
  7. 8×8 LED-Matrix mit Arduino Uno meistern: Schritt-für-Schritt-Anleitung
  8. Präzise GPS-Uhr: Günstige Genauigkeit & Zuverlässigkeit
  9. Bluetooth-fähige 8x8 LED-Matrix mit Scrolltext – Arduino-Projekt
  10. Zuverlässigen Wecker mit DS1302 RTC und Arduino UNO bauen