The other night I was puttering around, looking in my box of goodies to see what I brought to play with. I usually grab a few items and then see what inspires me along the way. Tonight it is two 8×8 led matrices, i2c, ok that looks like fun. The goal started out being able to move something across the screen. The 8×8’s are from Keyestudio, are I2C, and use the HT16K33 controller. It is also found on the Adafruit panels.
It seems, in my general searches, that most all of the 8×8 panels use the Max7219, or another chip in the family. Information was a little scare for the HT16K33, but between some searching and wandering through some user forums I was able to get the information I needed. Adafruit provided the libraries and the function that got me started. A thank to them and their great work! Note to self: Take this project and port it over to my IstyBitsy M4 just ’cause I want to.
As I was getting started, it came to me that just moving some random text across the screen wasn’t very much fun. A quick stepping stone, but it needs to do something. Shazaam! Another clock. I grabbed a spare DS3231 laying around.
What Board to Use
- Arduino Uno, generic
- Arduino Nano, generic
- Adafruit ItsyBitsy M4
- Adafruit IstyBitsy 328
- NodeMCU ESP8266-12E
- Heavens to Murgatroyd I didn’t realize I was lugging around some many boards!!!
I wound up picking up the Uno. For this is was just the easiest to get to and put to work. The DS3231 RTC I have is one that I picked up for a Raspberry Pi, but hey, it will work just as well here.
Rest of the Parts, the BOM
Quickly, here is the Bill of Material (BOM) for this project
- 1x 1/2 sizeBreadboard
- 1x Arduino Uno
- 2 x KeyStudio I2C HT16K33 8×8 LED matrix
- 1 x RTC DS3213
- Jumper wires
- 1 x micro USB data cable
Putting it Together
I started with the usual ritual of plugging the screens and checking on the I2C addresses. You can find a sketch in the Arduino IDE that will scan the bus and return the addresses it finds. I was short of some jumper wires, so I pulled out the creative hat; here is my tip. A short piece of ethernet cable and the project is back on track. I already have the address of the DS3231 Real Time Clock (RTC) from an earlier project. Screen A is 0x70 and screen B is 0x72, the clock is 0x68. If you look close in the picture you will see that one of the address pads is soldered. See the screen on the left hand side, and in its’ upper right-hand area. They are labeled A2, A1, and A0. I solder bridged A2 so that the address will be different than the first.
Getting all wired up with my makeshift jumpers
The wiring is simple as everything is using I2C for communication; just daisy chain them SCL to SCL, SDA to SDA. Only four Uno pins are required, 2 for I2C and 2 for power and ground. It is important to make sure that all of the addresses are different.
- SCL –> Uno Pin 5
- SDA –> Uno Pin 4
- 5v –> 5v
- Gnd –> Gnd
The base code I found on one of the Adafruit forums. It was pertaining to scrolling text. I copied it and started to play around with it. I do need a clock in the living room. Clock are few and far between in my house and not sure why. This will help change that.
I took the code from one of my earlier clocks and used it with the scrolling function. I won’t go to in-depth right now. You can check out the code over on my GitHub. I have tried to comment it as to explain what is going on and why.
The clock is done. Not bad for a nights work. Being back home I am looking around my workshop for a project box or something to use for an enclosure. By time I had the code tweaked it was getting late and I wanted it done, ok I wanted it up and useable. I found a box, a small one, the prefect size.
I found a little cardboard box that will work well for my little clock. It is big enough for all of the electronics and still some spare room. After some quick measurements, it was time to take the plunge and cut the hole.
A quick check and it fits pretty good. Note: Once installed the top of the opening needs to be raised up or reading the numbers is hard.
Mounting it was pretty easy. For now everything is still on a breadboard. So the breadboard was glued to the bottom of the box and the Uno to the lid. The wires are just about perfect length to open/close the lid. A USB cable is run through a hole I cut in the back of the box.
At the tone the time will be. . .
I do have a wooden box set aside for a project something like this. I am thinking that the wooden cover should be replaced with an acrylic cover. Along with the cover I have some updates for the code as well. I think this one may just be getting started.
After a couple of days I have a list of things that I want to update on this project.
- Remove seconds, they are always behind when scrolling. And this clock is for general use, down to the minute will suffice.
- Build a proper case. 2 possible candidates for use.
- Add alarm and time set. This is use three buttons. One for mode and the other two for up and down.
- Waaaaay out there add or move to processor with, BLE and display messages to family members.
Adafruit Forums – information on scrolling
Keyestudio – KS0064 i2c 8×8 led matrix ht16k33
© 2019, wrightmac. All rights reserved.No tags for this post.