Hi all, hope you're doing well. I'm very new to the whole electronics scene and just wanted some advise on some wiring.
I need to control speed and direction of x4 DC motors and control direction of x4 servos Im also including a push button switch to activate the system and 2 LED's as indicators. The modules that will be used are the following:
PCA9685 servo controller
L293D motor shield
Arduino Mega
I plan on powering all 3 modules with separate power supplies but unsure about the wiring of the PCA9685. The L293D is a shield so its just placed on top but the PCA9685 pins I'm a little unsure of. I did a bit of research and I'm aware that the SCL and SDA pins are in Pin 20, 21 but not sure how to connect the Gnd and Vcc of the PCA9685 because of the shield covering up the pins that are usually used by the PCA9685 in other diagrams I've seen. Is connecting the Gnd and Vcc of the PCA9685 to the 5V and Gnd pins by the regular digital pins (D21-D53 region of the mega) okay to do?
That sounds interesting but I do not have a clue as to what it will be! However, please keep in mind that we are not a free design or code-writing service. We’re more than happy to help with your design or code, but we need you to make an initial attempt. Please design and write your code, then post it along with an explanation of what’s not working properly.
Show Your Work First: Before asking for assistance, make an attempt to design or write the code yourself. Share your work along with details about what isn’t working.
Provide Clear Documentation: Since we can’t see your project, share an annotated schematic (best) or a clear drawing of your setup. Pictures are welcome, but avoid using Fritzing diagrams as they are wiring diagrams, not schematics, and are not ideal for troubleshooting.
Include Technical Details: If there is specific hardware involved, include links to technical information. There are often many versions of similar components, so precise details are essential.
That's the curse of shields. They are great for beginners. Plug shield into Arduino and bingo, your circuit is done.
But if you want to take the next step and add some other features to your circuit, you are in a world of pain.
One possible answer is to use a proto-shield and mount that on top of your motor shield, or sandwich it between the Arduino and the motor shield. That will give you access to be able to solder wires to those difficult pins for your servo driver. However, if the motor shield is already using the exact pins you need, bad luck.
I hope you are successful with your project, and that you learn a valuable lesson: unless you can find shields that do exactly what you need and everything you need, avoid shields altogether, and the Arduino models that take shields. Instead, use sensible, grown-up models of Arduino and driver modules that are breadboard/veroboard/PCB compatible.