user10160: I am sending data from an Arduino Uno to an Arduino Mega via serial communication.
The data is analog value. I'm getting that data and converting it to an int. There is no problem there. However, when I connect the servo to the attached pin, the serial communication on mega becomes disconnected. When I  remove the PWM pin, the serial communication is working again. Why does the servo stop serial communication?
Wiring: Mega-- 5v and gnd pins linked to servo ( 13kg/cm ), PWM 2 pin is linked to servo's pwm input, rx2 pin is linked to uno's tx pin

user11529: If you draw too much current from an Arduino microcontroller it can reset itself (brownout), that results in it not responding. To solve this do not power your servo directly from the Arduino, use an external power supply. 

10160: <p>I am sending data from an Arduino Uno to an Arduino Mega via serial communication.</p>

<p>The data is analog value. I'm getting that data and converting it to an int. There is no problem there. However, when I connect the servo to the attached pin, the serial communication on mega becomes disconnected. When I  remove the PWM pin, the serial communication is working again. Why does the servo stop serial communication?</p>

<p>Wiring: Mega-- 5v and gnd pins linked to servo ( 13kg/cm ), PWM 2 pin is linked to servo's pwm input, rx2 pin is linked to uno's tx pin</p>
 11529: <p>If you draw too much current from an Arduino microcontroller it can reset itself (brownout), that results in it not responding. To solve this do not power your servo directly from the Arduino, use an external power supply. </p>
