Matrix Clock
My gadget called Matrix is a smart clock with a LED matrix display (MAX7219). Practically, it has the same functionality as the Dimmer, with slightly different hardware elements. During its development, I also expanded the functions of the Dimmer. I created a unique synchronization capability between the two devices, so that, for example, when I press the button on the Dimmer, both devices respond.
Why did i make it?
Before the Matrix we had a large digital display clock in our living room. It was also true for this clock that it forgot the time when the power went out and I had to reset it by repeatadly pressing its tiny, buttons which eventually got contact failures. This really annoyed me, and since I created an automatic time setting function for the Dimmer, I wanted to make this clock smarter as well. I also wanted an outdoor thermometer with an indoor display.
However, modifying the existing clock seemed more difficult than building a completely new one from the ground up, so I decided on the latter.
By building the Matrix, I managed to acquire the necessary knowledge to estabilish communication between my IOT devices, and communication between them and a cloud application called ThingSpeak. I also got to experiment with transparent pla, which I used to print the housing.
Hardware differences compared to the Dimmer
The clock display
- on the Dimmer is the small, red TM1637 hour-minute display,
- on the Matrix is a much larger, green MAX7219 led matrix display, which can display not only numbers, but also unique pixel shapes.
There is no LED Ring on the matrix.
However, it has a buzzer (small speaker) for which I collected melodies in regard to another project, and it serves the purpose that if the light of the Dimmer was not effective enough to wake up until the end of the wake-up time, then the sound of the buzzer gives the final blow.
I solved the temperature detection with an NTC thermistor, of which I put one on both: a half-meter long one on the Dimmer, and a two-meter long one to the Matrix, which end I hung out on the balcony. To calibrate the measurements, I used a commercially available thermistor relay module.
To measure indoor temperature and humidity, I installed a DHT22 type heat and humidity sensor module in the Matrix, but due to the lack of another humidity measuring device, in the end I was unable to calibrate it.
Sync with the Dimmer
The Matrix and the Dimmer regularly check each other’s presence. The prerequisite for this is that they are on the same LAN and know each other’s IP address.
If the other party is available, they can synchronize:
- The current time: if an NTP request failed
- The current operating state: when booting, they query the other’s and set it on themselves; when the operating state changes, they tell the other to switch over as well. Thus, it is enough to set an alarm on only one of them: When the set alarm starts, it starts on the other one as well. In the same way: when going to sleep it is enough to press the button just on the Dimmer and both devices will switch to night mode.
In order for the two devices to find each other, and for me to be able to always access the websites of the devices from the same addresses, I reserved specific IP address in the DHCP setting of our home router for both of them. These addresses must be entered in the configuration of both the Dimmer and the Matrix so they know where to look for the other.
Communication with the cloud
The Matrix sends its measurement data to the ThingSpeak cloud application, which stores it for at least one year.
This gauge shows the most recent measurement:
It is interesting to see how the recorded temperature changes trough a weak, and trough the months:
Summary
The Matrix became a great replacement for the previous clock. I never have to press buttons to set the time again.
The display of the outside temperature is quite useful. In winter, when going to work, all I have to do is look at the Matrix to decide how layered I should dress.
And if I’m curious about how the temperature around the house has turned in the last 3-4 months, I can see it from the cloud.