Hoog-precieze LED-matrix klok met DS3231 RTC, BME280 weerdata, BH1750 lichtsensor & ESP01 NTP-synchronisatie
Onderdelen en benodigdheden
| Arduino Nano R3 | 1 |
| Maxim Integrated DS3231MPMB1 Peripheral Module (goedkope eBay-versie, verwijder de laadweerstand voor de batterij) | 1 |
| SparkFun BME280 Atmosferische Sensor Breakout (goedkope eBay-versie) | 1 |
| BH1750 Lichtsensor (eBay) | 1 |
| MAX7219 32x8 LED-matrix | 1 |
| Condensator 10 µF | 2 |
| Espressif ESP8266 ESP-01 (optioneel, voor NTP-tijd) | 1 |
| LM3940IT-3.3 (3.3V LDO regelaar voor ESP-01) | 1 |
| SparkFun Level Shifter Board (noodzakelijk voor ESP-01) | 1 |
Over dit project
Dit project is een uitgebreide versie van Nick's LED Word Clock ( origineel). Toevoegingen: extra sensoren (BME280 voor temperatuur/vochtigheid/luchtdruk, BH1750 voor automatisch dimmen en nachtmodus), knoppen voor instellingen, en een ESP-01 voor NTP-tijdsynchronisatie via pool.ntp.org.
De ESP-01 slaapt (WiFi uit) wanneer niet nodig, en wordt via serieel gewekt om de tijd in UNIX-formaat op te halen. SSID en wachtwoord worden vanuit de Arduino-code doorgegeven. Ondersteuning voor DST/UTC/BST berekeningen, instelbaar via menu. Instellingen worden in EEPROM bewaard.
Zes extra lettertypen zijn toegevoegd (gemaakt met dotmatrixtool.com). Veel data verplaatst naar PROGMEM om RAM te besparen.
Code op GitHub: https://github.com/Ratti3/miniclock
Voorbeeld seriële uitvoer bij NTP-aanroep:
Arduino : Sent NTP request to ESP01
ESP01 : NTP request received from Arduino [attempt 1 of 3]
Connecting to SSID: TheInternets....connected
SSID: TheInternets, IP Address: 192.168.0.135
Signal Strength (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
Pas de lichtsensor-code aan aan je omgevingslichtcondities (ontwikkeld in helder zonlicht). Meer foto's en instructies volgen.







































Aansluitschema
DS3231, BH1750 en BME280: SCL = A5, SDA = A4, VCC = 3.3V
LED Matrix: CLK = D11, CS = D10, DIN = D12, VCC = 5V
Schakelaars: D2 = Menu, D3 = Datum/+, D4 = Temp/-, D5 = Display-opties
ESP01 (optioneel): D7 = TX van ESP01, D6 = RX van ESP01
Belangrijke configureerbare variabelen (standaardwaarden, EEPROM-adressen tussen haakjes)
// Klokinstellingen
byte intensity = 2; // [200] Standaard helderheid (0-15), via menu instelbaar
byte clock_mode = 0; // [201] Standaard klokmodus (0 = basic_mode)
bool random_mode = 0; // [206] Willekeurige displaymodus elke paar uur (1=aan)
bool random_font_mode = 0; // [207] Willekeurig lettertype elke paar uur (1=aan)
bool ampm = 0; // [208] 12-uurs (1) of 24-uurs (0) formaat
// Lichteinstellingen
byte display_mode = 5; // [202] Display aan/uit modus via lichtsensor (0=normaal, 1=altijd aan, 2=altijd uit, 3-5=uur afhankelijk)
bool auto_intensity = 1; // [209] Automatische helderheid aan/uit
byte hour_off_1 = 21; // Uur waarop display uit kan gaan als het donker is
byte hour_off_2 = 22;
byte hour_off_3 = 23;
// Lettertype-instellingen (via menu)
byte font_style = 2; // [203] Standaard groot lettertype
byte font_offset = 1; // [204] Lettertype offset correctie
byte font_cols = 6; // [205] Lettertype kolommen correctie
// DST, NTP, UTC
bool dst_mode = 1; // [210] DST functie inschakelen (1=ja)
bool ntp_mode = 1; // [211] NTP synchronisatie inschakelen (1=ja)
byte ntp_adjust = 1; // Seconden correctie op NTP-tijd voor verwerkingstijd
int8_t utc_offset = 0; // [213] UTC offset in uren
byte ntp_dst_hour = 2; // Uur waarop dagelijkse NTP/DST sync plaatsvindt (2 uur nachts)
byte ntp_max_retry = 3; // Aantal herhalingen NTP-verzoek (1-9)
byte ntp_timeout = 45; // Timeout per poging in seconden (totaal timeout = ntp_max_retry * ntp_timeout)
// WiFi instellingen (worden via SoftwareSerial naar ESP01 gestuurd)
// Gecombineerde lengte SSID + wachtwoord mag niet > 72 tekens zijn
const byte ssid_len = 8; // Lengte van je SSID
const char ssid[] = "YourSSID"; // Jouw SSID
const byte pass_len = 12; // Lengte van je wachtwoord
const char pass[] = "YourPassword"; // Jouw wachtwoord
Code
De volledige broncode (Arduino .ino bestanden, ProgmemData.h, ESP-01 NTP code) vind je op GitHub:
https://github.com/Ratti3/miniclock
Schema

Productieproces
- Bouw een Arduino Real-Time Clock voor Islamitische Gebedstijden
- Een LED bedienen via Bluetooth met Arduino – Eenvoudige DIY Handleiding
- Analoge-stijl LED Persistence-of-Vision Klok – DIY Arduino Nano Project
- DIY Hot Glue LED Matrix Lamp – Bouw je eigen kleurrijke display
- Een Arduino LED besturen met Cortana via Bluetooth op Windows 10
- Arduino Flip Clock met 8×8 LED Matrix – DIY Real-Time Clock Project
- Een 8×8 LED-matrix beheersen met Arduino Uno: Stap-voor-stap handleiding
- Precieze GPS-gebaseerde Klok: Betaalbare Nauwkeurigheid & Betrouwbaarheid
- Bluetooth 8x8 LED-matrix met Scrollende Tekst – Arduino Project
- Klassiek Asteroids-spel met Arduino Mega en MAX72XX LED-matrix
- Bouw een betrouwbare wekker met DS1302 RTC en Arduino UNO