MisterMel wrote: ↑Mon Jun 08, 2020 12:12 pm
I added a 100nF capacitor at both the motor driver and at the header pins on the RPi. This makes it work a bit better, however it is still does not work perfectly. Would adding a capacitor with a bigger value help here?
Yes, but you need a cap ten thousand times bigger (1000uf) to make much of a difference. I find it hard to believe your .1uf had any effect at all. Depending on type of DC-DC there is a common problem supplying impulse power for both the Pi and motors or relays. Their built-in output caps, on the order of 100uf, are rarely enough for this.
Also type of chip used can make a difference. IME the popular LM2596S are not adequate, specially for Pi4 and/or if anything else like HD or SSD is connected. I've had many intermittent/borderline failures with these cheap Ebay modules. Not surprising since that whole TI Simple Switcher technology is many decades old.
Much better luck with more modern devices like XL4015 or even newer sibling LM2596HV. They only cost a few pennies more but worth it IMO. And that's coming from one of the cheapest misers on the planet.
Also bigger inductor helps and toroid is better than spool or open core.
The biggest problem is with startup pulse requirements from motors. relays. solenoids, and computer boards that have big power rail caps like Pi. If steady state current draw is just too much no cap will help.
Also note that AA is a poor choice for most projects, unless a much larger number are in series, IE 12 or more cells. Specially alkaline wich have very poor power density compared to others like NIMH or Lithium. In most cases just a couple 18650 lion work much better for me. Many other benefits too, like cheaper and much longer shelf life and almost zero self discharge.