I am using an arduino mega 2560 for my project about relay race. for this project, I am using 4 sensors which are cny70 white-black sensor, pololu qtr8a line detection white-black sensor, ultrasonic and sharp distance measurement sensors. during the project, ? tryed to use them individually for their own task and their performance and the code were acceptable. when i combined them they are all failed. that is they are all warking but not the whole time. they behaved such that there is a delay statement in the code (delay(..)) but there is no such thing. let me tell about some connections.
in the arduino there are 3 5v output pin. ? connect one of them my pololu and ultrasonic sensors which they are drawn about 100mA current. sharp is connected the second 5v output pin and cny70 is connected the last one and also ? connected all the ground wires.
moreover, my arduino and motors(2 DC geared motor and Servo motor) are drawn their power from the regulator circuitry and arduino mega's and 2 dc motors currents are coming from the 9 volt output of the LM7809 voltage regulator and servo's from the lm7805. the input power of the regulator is 11,1V Lipo Batarya 1050mAh 25C.
when the 4 sensors are on the arduino's 5v output pins, they failed. after connecting them to the lm7805 regulators output the result is the same. but when we try to connect them to 4 * 1.2 V battery they worked and with the regulator the current was about 140mA with the 4 battery it decreased to 120 mA. so regulator seems to work but in practice not.
is there any limitations of arduino mega 2560 to cause that ?
or do you have any advice for me?
Mega2560 regulator is only rated for 800mA; the 2560, 16U2, other chips & LEDs all need some of that. If you try to use more, the regulator overheats and shuts down. If the voltage at the barrel jack is higher, the regulator overheats sooner, so the current must be lower to prevent that.
When the regulator cools some, the processor restarts, which can look like a delay, probably of several seconds or more.
Can you draw a picture of all your pieces and how they are all connected?
there is not the our problem such as heating and restarting. if it was restarting, we will understand because it will be stop motion and actually the current is not higher than 500mA and ardiuno is connected the 9V regulator circuit. it is in the range of recommended value (7-12V). I/O pins can cause this? because ? have 10 analog input about 8 pins digital output and some of the 8 pins are PWM. this much connection can cause this ?