Date Counter







Greetings everyone and welcome back, and here's something exciting.
The Date Counter is a Raspberry Pi Pico W-based matrix board that uses data from an NTP client to display the current date on an RGB matrix.
This date counter, similar to a clock, displays the current day of the month. It's a fun and eye-catching device to keep track of the date, with the extra bonus of the color changing from red to green as the days pass. It isn't as precise as a clock with hours, minutes, and seconds, but it does provide a clear daily indication of where you are in the month.
Our goal for this project was to develop a basic desk date clock that tells us what day it is; it begins with RED and turns to green as the day progresses, signaling the end of the month.
This project is basically version 1 of a future Matrix Clock project, which i will be preparing in the upcoming months.
This Instructables covers the whole build process of this project so let's get started with the build.
Supplies
These are the materials required in this project.
- Custom PCB (Provided by HQ NextPCB)
- Raspberry Pi PICO W
- WS2812B LEDs
- 100uF Capacitors
- Solder Paste
- Reflow Hotplate
Matrix Design



For this project, we are utilizing one of our previous matrix projects, which was a matrix with a dedicated microcontroller board (Raspberry Pi PICO) that could be utilized for future RGB matrix-based projects that include our date counter.
https://www.instructables.com/Raspberry-Pi-Pico-Matrix-Project/
The two main components of this project's circuit are the LED matrix itself, which is made up of 100 WS2812B LEDs connected in their standard format, connecting the first LED's dout to the second's din, the second LED's dout to the second's din, and so on until the hundredth LED. The VCC and GND of each LED are connected in parallel.
The second component of the circuit is a Raspberry Pi Pico W. The first LED Din is attached to the Raspberry Pi Pico's GPIO D0. We put a USB Type-C port alongside Pico's 5V IN and GND connectors to power the board using a type-C connector.
We put 100 decoupling capacitors to each WS2812B LED, but in the end, we only used 10x 100 nF capacitors, one for each row.
Once the design was finished, we saved it as a board file and put all 100 LEDs in a 10x10 row and column grid.
Please take note that the LEDs D1 through D10 are placed in a single row. D11 appears at the start of the new column and extends to D20, followed by D21, which appears at the start of the next column and extends to D100. This is also known as the serpentine matrix or snake matrix pattern.
After setting up the PCB and installing the Pico and all SMD components, we exported the Gerber data, which will be sent to a PCB manufacturer for samples.
HQ NextPCB Service


After completing the PCB design, we export the Gerber data and send it to HQ NextPCB for samples.
For the mid and top layer boards, two orders were placed. We ordered a black Solder mask with white screen for the mid- and top-layer boards.
After placing the order, the PCBs were received within a week, and the PCB quality was pretty great.
In addition, I have to bring in HQDFM to you, which helped me a lot through many projects. Huaqiu’s in-house engineers developed the free Design for Manufacturing software, HQDFM, revolutionizing how PCB designers visualize and verify their designs.
Take advantage of NextPCB's Accelerator campaign and get 2 free assembled RP2040-based PCBs for your innovative projects.
https://www.nextpcb.com/blog/rp2040-free-pcba-prototypes-nextpcb-accelerator
This offer covers all costs, including logistics, making it easier and more affordable to bring your ideas to life. SMT services can be expensive, but NextPCB is here to help you overcome that hurdle. Simply share your relevant project, and they'll take care of the rest. Don't miss out on this amazing opportunity to advance your tech creations!
HQDFM: Free Online Gerber Viewer and DFM Analysis Tool

Also, NextPCB has its own Gerber Viewer and DFM analysis software.
Your designs are improved by their HQDFM software (DFM) services. Since I find it annoying to have to wait around for DFM reports from manufacturers, HQDFM is the most efficient method for performing a pre-event self-check.
Here is what online Gerber Viewer shows me. Would not be more clear. However, for full function, like DFM analysis for PCBA, you need to download the software. The online version only provides a simple PCB DFM report.
With comprehensive Design for Manufacture (DFM) analysis features, HQDFM is a free, sophisticated online PCB Gerber file viewer.
It provides insights into advanced manufacturing by utilizing over 15 years of industry expertise. You guys can check out HQ NextPCB if you want great PCB service at an affordable rate.
PCB Assembly







- Using a solder paste dispenser needle, we apply solder paste to each component pad to begin the circuit assembly process. In this case, we are using 63/37 SnPB Solderpaste.
- After that, we pick each WS2812B LED and place it into their correct position.
- The PCB is then heated from below to the solder paste melting temperature by placing the circuit on the Reflow Hotplate, which causes all of the SMD LEDs to be connected to their pads.
- After reflow, we place the THT components, which consist of a female header pin connector for the Raspberry Pi Pico W and a USB-type C port.
- Using a soldering iron, we solder the leads of every through-hole component from the bottom side of the board.
- At last, we installed the Raspberry Pi PICO W on the header pins and our PCB assembly process is complete.
DEMO TEST CODE



For the Demo test sketch for this project, we created a number counter sketch that counts from 1 to 30 with a one-second interval. We added a feature to this test code that causes a color shift from red to green.
Here, we begin the month with a red color and as the days pass and we approach 30, the color changes from red to green.
Make sure you install the required libraries: Prior to using this sketch, install Adafruit NeoPixel, Adafruit GFX, and Adafruit NeoMatrix.
MAIN CODE
After testing the demo test code, let's have a look at the main code for this project and its a simple one.
Our code is intended to display the current day of the month on an LED matrix, with a color transition from red to green as the days progress. The script begins by importing the following libraries: WiFi, NTPClient, and WiFiUdp for managing WiFi connections and retrieving time from the NTP server; and Adafruit_NeoPixel, Adafruit_GFX, and Adafruit_NeoMatrix for controlling the LED matrix.
An NTP client is instantiated to retrieve the current time from the "pool.ntp.org" NTP server, with an offset for Indian Standard Time (UTC+5:30).
The LED matrix is configured with a pin defined for GPIO 12, dimensions of 10x10, and specified connection and color order.
In the setup() function, serial communication is initiated for debugging purposes. The LED matrix is initialized with specified settings, including brightness and text rotation. The script then attempts to connect to the WiFi network using the provided credentials, waiting until the connection is established. Once connected, the NTP client is started to begin retrieving the current time.
In the loop() function, the NTP client is updated to retrieve the most recent time from the NTP server. The current date and time are retrieved and stored as a struct tm object. The current day of the month is then extracted and transformed into a string. The color used to represent the day is determined by the day of the month, transitioning from red on the first to green on the 30th or 31st. The LED matrix is then cleared, and the current day is printed in the calculated color, centering on the matrix. The display is refreshed every second to ensure that it is up to date.
RESULT





The end result of this simple yet practical build is a date counter that shows the current day of the month and has a color transition that changes from red to green as the day progresses.
This project creates a dynamic and visually appealing date counter by combining WiFi connectivity, NTP server time retrieval, and an LED matrix display.
I wish to improve the matrix size in the next edition. We are now utilizing a 10x10 matrix, which is fine if we only want to display a single number, but we want to display the entire date, including the month and year; therefore, we will need to increase the matrix significantly.
Also, we will be adding onboard power so the whole device can just work without using external power from the USB port.
This is it for today, folks. All the documents related to this project are attached, which you can checkout in this article. If you need any additional information, feel free to leave a comment, and I will be happy to assist you.
Special thanks to HQ NextPCB for providing components that I've used in this project; check them out for getting all sorts of PCB or PCBA-related services for less cost.
Thanks for reaching this far, and I will be back with a new project soon.