กลับไปหน้ารวมไฟล์
all-in-one-clock-0523b7-en.md

In this project, we will make an Arduino clock alarm with a timer and a temperature sensor.

Wiring:

Button #1 Mode: connected to digital pin 2

Button #2 Select: connected to digital pin 4

Button #3 Plus: connected to digital Pin 3

Button #4 Minus: connected to digital pin 12

Button #5 Timer on/0ff: connected to digital pin 11

You can wire all of the components to a breadboard or wire them to an Arduino proto shield if you would like to use the case.

Libraries:

DHT - https://github.com/adafruit/DHT-sensor-library

LiquidCrystal I2C - https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c

Wire - https://github.com/arduino/ArduinoCore-avr/tree/master/libraries/Wire

virtuabotixRTC - https://github.com/chrisfryer78/ArduinoRTClibrary

RTCLib - https://github.com/adafruit/RTClib

Usage:

  1. Change between screens by pressing the mode button.
  2. Set time by holding the mode button on screen 1.
  3. Screen 1: Time, date, and temperature
  4. Screen 2: Set up the alarm.
  5. Screen 3: timer
  6. Screen 4: Alarm On/Off

To navigate between all of the screen we will use the mode button.

Each button has its own use the + and - buttons are most used to add to a number or decrse, The selecet button is sually to go between couple of options and the timer button is to start or stop the timer.

Expanded Technical Details

The All-in-One Clock 1.0 aggregates multiple sensors into a single, unified dashboard. By syncing a precise Real-Time Clock (RTC) with environmental sensors, the Arduino serves as a central data aggregator, formatting and displaying the information on an LCD.

Structuring the Sensor Ecosystem

Managing multiple sensors efficiently requires careful planning of the communication buses:

  1. I2C Bus Sharing: Modules like the DS3231 RTC and BMP280 barometric pressure sensor can share the same I2C bus (SDA/SCL pins). The Arduino communicates with each independently using their unique device addresses.
  2. Digital Pin for DHT: The DHT22 temperature and humidity sensor uses a single digital pin for its proprietary one-wire communication protocol.
  3. SPI for Display: A TFT display, as shown in the wiring diagram above, typically requires the high-speed Hardware SPI bus (MOSI, MISO, SCK pins) for efficient data transfer.

A core programming challenge is updating the display without causing a distracting flicker. The naive method of clearing the entire screen (tft.fillScreen(BLACK)) on every loop cycle causes a flash. The professional approach is dynamic redrawing:

  1. Draw all static text (like labels "TEMP:" or "TIME:") once during setup.
  2. In the main loop, before updating a changing value (like the temperature number), use tft.fillRect() to draw a black box only over the area where that number appears.
  3. Write the new value in that same spot. This method updates only the pixels that have changed, resulting in a smooth, flicker-free display.

Integrated Telemetry Hardware Base

A robust build for an expanded version of this project could include:

  • Arduino Mega 2560: Provides ample memory for handling graphics libraries and multiple sensors.
  • ILI9341 SPI TFT Color LCD Screen: For a high-definition graphical display.
  • DS3231 I2C RTC Module: For maintaining accurate time.
  • DHT22 Temperature & Humidity Sensor.
  • BMP280 I2C Barometric Pressure Sensor: To add atmospheric pressure and altitude data.

Version 2.0

For version 2.o follow this link: All In One Clock 2.0

GitHub:

https://github.com/dzh121/All-In-One-Clock-1.0

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Cura Slicer"
  - "1x Arduino IDE"
author: "dzh121"
category: "Screens & Displays"
components:
  - "1x Arduino Proto Shield"
  - "1x Real Time Clock (RTC)"
  - "1x Buzzer"
  - "1x Hot glue gun (generic)"
  - "1x I2C 16x2 Arduino LCD Display Module"
  - "1x Cutter"
  - "1x Breadboard (generic)"
  - "1x AM2302 DHT22"
  - "5x Tactile Switch, Top Actuated"
  - "1x SolderWire"
  - "1x 3D Printer (generic)"
  - "1x Hook Up Wire Kit, 22 AWG"
  - "1x Soldering iron (generic)"
  - "1x Arduino UNO"
description: "Assemble an ultimate temporal and atmospheric station integrating the DS3231 RTC, DHT22 humidity matrix, and BMP280 barometer flawlessly onto a unified TFT LCD display."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://github.com/dzh121/All-In-One-Clock-1.0/blob/main/clock_alarm.ino"
encryptedPayload: "U2FsdGVkX193nPoGFx9Y9991vZII6xl1fpSuwiky31btmV3/m0g+sgsptC7ditNbPWl7PNHSIWcWx3bkiCpyCnkwBSXEHdtc6Yd9KgjtaUljBFTypUVZ4Om6nWlrkP2g"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/all-in-one-clock-0523b7_cover.jpg"
lang: "en"
likes: 0
passwordHash: "4b0c1c210972cfa4a39ed791d7afca8426d9cd5fef1f2e656ce7dff040c61c06"
price: 2450
seoDescription: "Create an All in one clock 1.0 using Arduino Uno and RTC with alarm, temperature senser, and timer functions."
tags:
  - "Clocks"
  - "Entertainment System"
  - "Smart appliances"
title: "All in one clock 1.0"
tools: []
videoLinks: []
views: 3535