Looking for MEGA 2560 pin connect wire solution

Thread Starter

LAOADAM

Joined Nov 21, 2018
216
Hello,
I am doing a MEGA 2560 controlled Robot, which used 5 stepper motors (4 pins each) and 5 ultrasonic sensors and many switches, basically used up all pins on MEGA. any solution how to wiring that easy?

Thanks
Adam
 

Papabravo

Joined Feb 24, 2006
13,759
Hello,
I am doing a MEGA 2560 controlled Robot, which used 5 stepper motors (4 pins each) and 5 ultrasonic sensors and many switches, basically used up all pins on MEGA. any solution how to wiring that easy?

Thanks
Adam
I'm not clear on what your exact problem is. Can you express yourself with more clarity?
 

Papabravo

Joined Feb 24, 2006
13,759
Thanks.
I need wiring up 4 stepper motors, 5 sensors, 6 switches to MEGA 2561, how to do it easy?
Best
I still do not understand the nature of your question. The way to do it is neither easy or hard. What is your major malfunction?
Do you have a schematic diagram that you would care to share. It might help to clarify the issues.
 

narkeleptk

Joined Mar 11, 2019
461
tedious is the word I think of.
You could run them all to one main connector or you could give each group there own I guess. Usually when I need to do stuff like this I just browse mouser/digikey for connectors that I like. might even be worth looking for and building around some pre assembled cable that are out there.
 

djsfantasi

Joined Apr 11, 2010
6,439
Thanks.
I need wiring up 4 stepper motors, 5 sensors, 6 switches to MEGA 2561, how to do it easy?
Best
The Mega2560 has over 50 GPIO pins, so that shouldn’t be your problem.

In a similar complex design, I used an Arduino prototype board and brought all my GPIO pins to it, to organize connections to my device being controlled yet still could unplug them all by removing the prototype board. The extra GPIO pins on the Mega were brought to the prototype board
 

SamR

Joined Mar 19, 2019
2,134
Sensors and switches obviously direct connect. 4 motors sound like a simple motor control shield with external power for the motors? DJ should be able to point you in the right direction.
 

djsfantasi

Joined Apr 11, 2010
6,439
Sensors and switches obviously direct connect. 4 motors sound like a simple motor control shield with external power for the motors? DJ should be able to point you in the right direction.
There’s a motor shield that drives 4 motors or two steppers. You’d need two shields for four steppers, each with their own I2C address. The shield includes jumpers to set unique addresses.
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
216
Sensors and switches obviously direct connect. 4 motors sound like a simple motor control shield with external power for the motors? DJ should be able to point you in the right direction.
Thanks.
each motor has a L298N shield, the shield also used 4 pins itself.
Best
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
216

djsfantasi

Joined Apr 11, 2010
6,439
Let’s do a count of the required pins.
  • 5 sensors requires 5 pins
  • 5 stepper motors @ 4 pins each requires 20 pins.
  • 8-10 switches requires 10 pins
The total is 35 pins. The Mega 2560 has 54 GPIO pins. Plenty of room for expansion without IO extender boards.
 

Thread Starter

LAOADAM

Joined Nov 21, 2018
216
Let’s do a count of the required pins.
  • 5 sensors requires 5 pins
  • 5 stepper motors @ 4 pins each requires 20 pins.
  • 8-10 switches requires 10 pins
The total is 35 pins. The Mega 2560 has 54 GPIO pins. Plenty of room for expansion without IO extender boards.
Thanks.
You are right, the total pins is OK, even with 8 buttons I'll need later on. Thing is how to easily wiring them.
Best
 
Top