Clock & Event Visualizer (ESP32 and Google Calendar)
by tootarU in Circuits > Clocks
33 Views, 0 Favorites, 0 Comments
Clock & Event Visualizer (ESP32 and Google Calendar)
I wanted a way to visualize my day and upcoming month at a glance without looking at a screen. I built this "Linear Clock" and Calendar bar using an ESP32, some LED strips, and 3D printed parts.
It features three rows:
- Hours (0-23): Shows the current time in 24-hour format.
- Minutes: Shows the progress of the current hour.
- Calendar: Shows the next 24 days.
It connects to Google Calendar. If I have an event, the corresponding LED on the clock lights up in the color of that event. It attaches to my magnetic whiteboard, making it a perfect functional addition to my workspace.
Supplies
Electronics:
- ESP32-C3 SuperMini (or any standard ESP32).
- 12V LED Strip (WS2811): Important: I used the type where 3 LEDs act as 1 pixel (controlled by one address). This gives it a larger light footprint per "dot."
- 12V Power Supply
- DC-DC Buck Converter: To step down 12V to 5V for the ESP32.
- Wires, Solder, Heat shrink.
Housing:
- 3D Printed Housing and Electronics Box.
- Baking Paper: For diffusion.
- Magnets: Glued to the back for mounting.
- Superglue.
Tools:
- Soldering Iron.
- 3D Printer.
- Wire strippers.
- Computer with Arduino IDE.
The Logic and Design
The display consists of three strips, each with 24 addressable "pixels" (groups of 3 LEDs).
- Top Row: The 24-hour clock. Blue indicates the time passed. If there is a calendar event at 14:00, the 14th LED will light up in the event's color.
- Middle Row: The minutes. Shows how far into the hour we are.
- Bottom Row: The next 24 days. Any events in the coming weeks show up here.
3D Printing and Diffusion
I designed a 3 channel holder for the LEDs.
The Diffuser Evolution:
Originally, I printed a thin white PLA cover to diffuse the light. However, I didn't like how it looked.
The Solution: I added a sheet of ordinary baking paper held in place by a 3D printed frame/bracket. This scatters the light better.
Wiring the Electronics
Since the LED strip is 12V but the ESP32 requires 5V, we need a split power setup.
- Power Supply: The main 12V PSU connects directly to the LED strips.
- Buck Converter: The 12V also goes into the input of the buck converter. Tune the output to 5V.
- ESP32: Connect the 5V output of the buck converter to the 5V pin on the ESP32.
- Data Lines:
- Hour Strip Data -> ESP32 GPIO 4
- Minute Strip Data -> ESP32 GPIO 6
- Calendar Strip Data -> ESP32 GPIO 7
- Ground: Crucial: Ensure the Ground (GND) from the 12V PSU and the ESP32 are connected together.
I designed a separate box to house the Power Supply and the Buck Converter/ESP32 combo to keep the main display slim.
Google Apps Script (The Backend)
Step 5: Google Apps Script
To get data from Google Calendar to the ESP32 without a screen, we use a Google Apps Script. This script checks your calendar and creates a "JSON" file that the ESP32 can read.
- Go to script.google.com and create a New Project.
- Paste the following code into the editor (delete any existing code).
- Important: Change YOUR_EMAIL_HERE@gmail.com to your actual Google Calendar email address.
- Click Deploy -> New Deployment.
- Select Type: Web App.
- Description: "ESP32 Calendar".
- Who has access: Set this to Anyone (This is required so the ESP32 can access it without a login prompt).
- Click Deploy.
- Copy the Web App URL. You will need this for the next step.
The ESP32 Code
- Open Arduino IDE.
- Install the following libraries via the Library Manager:
- Adafruit_NeoPixel
- ArduinoJson
- Copy the code below.
Configuration:
You must change the following lines in the code below to match your setup:
- ssid: Your WiFi Name.
- password: Your WiFi Password.
- scriptUrl: Paste the Google Web App URL you copied in the previous step.
- tz_string: This sets your Timezone. The default is set for Central Europe (CET). If you are elsewhere, look up your "POSIX Timezone String" online.
Changing Colors:
If you want to change the default background colors of the clock, look for these lines:
- #define TIME_COLOR (Currently Blue)
- #define SECONDARY_COLOR (The markers for every 6th pixel)
Code:
Finishing Touches
I glued strong magnets to the back of the case so I could stick it directly to my magnetic board.
I also programmed in some alternative colors. If you prefer green or purple, you can simply change the RGB values in the code (TIME_COLOR) to match your aesthetic!
How Do I Read This?