I'm making a little alarm clock with some (software) SPI-driven matrix displays + a toy DC motor alarm bell. The motor driver and motor are working great when I test them. The 3-up 8x8 matrix display works reliably when I test it.
The problem is that they don't work when I run them together. As soon as the motor starts spinning up, the display gets blotchy and corrupted. (This never happens until the motor runs).
You can see the hardware with the custom PCBA here:
The motor will certainly inject noise spikes into the power supply, and the capacitors described above will help.
A more serious problem is supply voltage drop, caused by motor current drawing down the voltage of an undersized power supply. Poor power supply decoupling compounds the problem.
For help with that, post a complete schematic, and links to the motor and power supply specifications.
These are all great suggestions, @dlloyd, @jremington and @groundFungus. I'm eager to try them all. I'm optimistic that there are so many things that can help.
I assume, since you didn't mention it, a ferrite is not helpful in addition to these changes?
I know it wasn't clear from the original post, @jremington, but I'm hoping the power supply is adequate. This 5V 25W power supply is being used to drive the ESP32, the toy motor intermittently, the 3-up 8x8 LED display, and some Dotstar RGB LEDs.
One question about this @groundFungus... The cap across the motor terminals is easy. Are the two side caps to the PCBA ground or the motor case or does it matter? (The motor case is not currently grounded in my build.)
CAT6 twisted-pair signal wires to matrix display module
47 Ω resistors in series on SPI lines
shorter matrix display cable
not running display-module signal lines under motor daughterboard
I'm excited to share that I haven't seen an issue with this new build. I'm not sure which of the improvements made the critical difference but I'm not sure it matters.
If so can you post jpg EXPORT images of the PCB please.
It looks like you are using the power supply to power the motor and the other hardware.
Have you got adequate gnd tracks and supply track widths?
Can you please post a CONNECTED schematic diagram, net list based diagrams are good for PCB design, but a pain in the rear when it comes to signal tracing and troubleshooting.
Include POWER SUPPLIES, MOTOR and other hardware.