Mega 2560 50 I/O's = Meyham?!?

Hello,

I am building a project using an Arduino Mega, I am using 50 digital pins as I/O. 25 Inputs and 25 outputs,

Each input is reading from a transistor switch which is controlled by an Opto reflective sensor, each input will need to be read at the same time or very close in time to each other.

Each output is sending a pulse message to control a stepper driver.

Basicially controlling a Split Flap display

I have gotten it to work with 5 inputs and 5 outputs to control 5 letters, but once I add another 5. So a total of 10 inputs and 10 outputs, Once the Sensor is triggered the arduino flashes and possibling loosing power?

I am connected to a external power supply to the Vin of arduino, 12V 8A, so i do not think the power supply is the issue. (Pulling 500ma when running)

Is there some reason why I cannot have this many inputs reading at the same time?

The outputs work fine, but once the inputs are all triggered together it fails.

Here is a video of 5 split flap letters working.

Any help greatly appreciated

:o

Hi and welcome,

L4S7: Each output is sending a pulse message to control a stepper driver.

How are the steppers powered? Can you post a schematic? It can be hand drawn, or if you want to use Fritzing, use the Schematic View not the Breadboard View. You don'thave to show all 25 steppers, just a few to give us the idea.

L4S7: I am connected to a external power supply to the Vin of arduino, 12V 8A, so i do not think the power supply is the issue. (Pulling 500ma when running)

The Mega is pulling 500mA or a total of 500mA is pulled by all components? If the Mega is pulling 500mA, that is worrying!

L4S7: Is there some reason why I cannot have this many inputs reading at the same time?

Theoretically, no problem. If your sketch is poorly written, however... Post your sketch, but before you do, read the "Read This" post at the top of the forum. We will know if you don't read it!

Paul

L4S7: I am connected to a external power supply to the Vin of arduino, 12V 8A, so i do not think the power supply is the issue. (Pulling 500ma when running)

Well firstly, you cannot power the steppers from the Arduino in any way. So you need to explain what you are using for stepper drivers and how they are connected.

Next, you cannot connect any quantity of components that draw power - such as LEDs - from the Arduino if you are powering it through the on-board regulator at 12V.

You need a 5V switchmode regulator to power the Arduino and the sensors.

Hey,

Sorry for the lack of info, posted in a hurry.

I figured out the issue, I was using the 5v rail from the ardunio and it drawing too much current from the Arduino to supply all the sensors triggering at the same time.

Thanks for your help

L4S7: I figured out the issue, I was using the 5v rail from the ardunio and it drawing too much current from the Arduino

Glad our comments helped you figure it out.