Pi Digital Clock 7.84 Inch (PYTHON)
by Yakroo in Circuits > Raspberry Pi
28 Views, 0 Favorites, 0 Comments
Pi Digital Clock 7.84 Inch (PYTHON)
.png)
 #trending #raspberrypi)
Pi Digital Clock: A smart device with real-time clock and calendar, time-based greetings, and PM2.5 data, replacing paper calendars.
Description
Pi Digital Clock: Born from the frustration of flipping through paper desk calendars, Pi Digital Clock reimagines timekeeping with a smart, all-in-one solution. This sleek device combines a real-time digital clock and calendar on a single screen, eliminating the need for manual page-turning. It greets you with personalized morning, noon, afternoon, or evening messages based on the time of day, adding a touch of warmth to your workspace. Plus, stay informed with live PM2.5 and AQI updates pulled from the Weather API, helping you monitor air quality effortlessly. Pi Digital Clock is more than a timekeeper—it's a stylish, paper-free upgrade that blends functionality and innovation for modern desks
Inspiration
The inspiration for this project came from my habit of frequently
checking paper desk calendars. But every time I wanted to see the date or holidays, I had to manually flip through the pages. That got me thinking… why not combine a clock and a calendar into one screen?
A screen that can show the date and time automatically—no more flipping pages!
Then I thought, why not add some smart features too, like air quality info and a greeting system?
And that’s how Pi Digital Clock was born—a smarter, paper-free upgrade for your workspace!
Key Features of This Project
- Displays a real-time digital clock
-Includes a clear calendar showing day, month, year
-Greets with morning, noon, afternoon, evening messages based on time
-Shows real-time PM2.5 / AQI values, fetched from Weather API
-Photo Frame
Setting Up to Run Automatically on Boot


In this step, we will edit the ~/.bashrc file to add commands that automatically run Python scripts when the Raspberry Pi boots and enters the specified terminal (/dev/tty1). Using ~/.bashrc is suitable for executing commands in the user’s environment and can be configured to run only under specific conditions, such as when logging in through the first terminal.
nano ~/.bashrc
if [ "$(tty)" == "/dev/tty1" ]; then
DISPLAY=:0 python3 /home/pi/pidigi2.py &
fi
Press Ctrl+X to save and exit, then sudo reboot.
API AQI,PM2.5
Visit https://aqicn.org/data-platform/token/ to request a free API token by entering your email and confirming via the link sent.
Use the token in the URL: https://api.waqi.info/feed/{city}/?token={your_token}, e.g., https://api.waqi.info/feed/bangkok/?token=your_token.
The API returns AQI, PM2.5, temperature, humidity, etc., in JSON format, with a quota of 1,000 requests per second.
Folder 'pic'


Creating the pic folder allows you to store image files in an organized and easily accessible location. Python scripts that run automatically on boot may be configured to read from or save images to this folder. For example, if picaren2.py is a script that uses the Raspberry Pi camera to capture photos, the pic folder will serve as the storage location for those images.
How to Create the Folder
To create a folder named pic in the user's home directory (e.g., /home/pi/ on a Raspberry Pi), use the following command in the terminal:
mkdir pic
- mkdir: The command to create a new folder (make directory).
- ~/pic: Specifies the location and name of the pic folder in the home directory (e.g., /home/pi/pic)
Code

Case 3Dprint
You can contact
Please follow my YouTube channel. Still a newbie to make a YouTube channel.
by just clicking on SUBSCRIBE button. Thankyou