Hello everyone. I am having issues with a TM1637 module controlling a 7segment 4 digit display, and I just cannot figure out what is wrong. I hope you are able to help me. Thank you a lot in advance.
Project context
I am building a KTAN-like game:
in a physical medium, where the player has various boxes (each module/minigame fits into a box) and can join in boxes together, to create the defusable bomb.
Right now, I have developed the "controller box" that will deal with communication between all the minigames, and will serve as the starting point to the user, and I have developed the first minigame, morse code. I am having issues in the controller box. Here are some photos, to get the general feeling for what I am talking about:
FRONT VIEW, with 7segment display missing
Partial wiring
Here is the wiring that I think is critical to understand what is connected to what:
Not everything is in this diagram (the application I was using did not have many of the things I needed, and I do not think they are that useful anyway). What is missing is a LCD display (as seen in the front view photo), and encoder, and a buzzer, all properly connected to the arduino as they work just fine. They are all connected to the 5V rail as well.
In the diagram, I depicted the rest of the wiring. A 7segment 4 digits module connected to the arduino, and finally a fan also controlled by the arduino. The fan is part of the minigame requirements, and there are 3 of them connected in a similar fashion ( to different output pins of course). They are turned on and off by the microcontroller at certain instances throughout the game duration.
Everything is powered by an outside 12V source, and I use a stepdown to lower the voltage to the necessary 5v for the arduino and other components, whilst I feed the 12v directly to the DC fans.
Problem
When I start the game, the 7segment display should show the time ( like a ticking bomb) left to defuse the bomb. It is updated every second. Everything worked fine at first, but, at some point, the display starts showing gibberish with every update, until inevitably stops showing anything at all. That's pretty much it. I could not find a pattern to when it shuts down, for how long it stays working correctly, or if its related to other components wired in the same rails (I am especially suspicious of the fans)
What I tried and my suspicions
I have tried I could remember. My first step was to remove the display and try a simple sketch on a different arduino, to see if it would work. To my surprise, it did not. The power led was on, but nothing showed. Weird. I connected a second module, and it worked just fine. Maybe the first module was defective? I put the new module in my minigame and it worked for a while... until, sure enough, it went crazy and black. What I discovered though, was that, if you give some time to the modules to " rest ", they will start working again just fine, after some time disconnected. This raises my suspicion of some capacitance accumulation or something?
I have tried other tests, but I do not know how relevant they are to mention here. I think that it is likely that something is going on with the fact that these sensitive modules are connected to the same rails as DC motors, close by physically, but I dont have enough knowledge or experience to understand what it could be. Given that this was the only thing that I did not previously tested on a breadboard ( the fans with the rest of the hardware) it also makes some sense that the fans are the culprit. But why? And how to possibly fix it?
I hope the explanation was not too confusing. Thank you so much for your time, and any help provided.
EDIT 1: A bit of context from myself, which could help with the replies. I have a masters in electrical engineering, but I work on a totally different field (chess coaching), which means that I will know some technical stuff if you mention it to me, and I am used to programming, but I lack the "on field experience" which could be helpful on this case