Can't connect servo on Arduino MEGA2560


I'm trying to connect a servo on the arduino mega2560 board, but the momen i connect my ground cable the board goes off. I mean it's like losing connection with the pc and the "Serial Port" option under "Tools" option, is unavailable. I connect my +5V cable, no problem, but the second I connect the ground cable it behaves like this, which indicates something like a short circuit, but I have no idea why it happens, since I connect, like, 2 cables. I have used 2 servos and they behave the same. One of them actually I have used in previous project, but now I just wanted to test them alone on the board. The servo is the only peripheral on the board, so I exclude something else. The test code I wanted to use is one from the compilers example, the "Sweep" or the "Knob" under servo section. I'm in the middle of my dissertation and the really sets me back, so any help would be really really helpful.

Thank you very much in advance.

Does your dissertation include a circuit diagram?

Well, I made the circuit my self. The thing is, I just connect a simple 3 pin servo ( Vcc, GND, Data) on the board and the moment I touch the GND pin to the GND sock on the arduino board it loses communication with the serial port. The servo and the arduino board are of course pre designed, so there's no error from my point. I just took a pre designed servo and the pre designed board and wanted to supply voltage on the servo. It sounds really really simple to be something complicated, because it's like 2 damn cables. I haven't even connected the data cable because of the behavior.

See reply #1, particularly with reference to the separate servo power supply.

I have included the circuit as link on imgur: Imgur: The magic of the Internet. It's a really simple circuit and I only have the servo connected. The sensor is not connected. The schematics I have designed them myself along with the libraries to include them, because Eagle did not have the sensor or the servo. Eagle does have though a schematic of the arduino board but I created that so it would look very simple and not chaotic.

There's no external power supply on the servo. He is supplied with 5V from the arduino as you can see in the schematic

There's no external power supply on the servo. He is supplied with 5V from the arduino

Well then, you've answered your own question.
Power the servo from a separate supply, like 4 AAs, and don't forget to connect the grounds (0V)

The thing is I have used it before just like that. I connected all the pins on the arduino board. I have never used external power supply on the servo and that's the reason it looks so bizarre to me. Can't it be something else?

Yes, it could be that you've already damaged something else, like the unspecified 5V supply, it can't supply enough current for the Mega, the U/S sensor and the servo, and its voltage is dropping too low when you connect the servo.
That could be another explanation.

I forgot to mention that the arduino board was supplied via USB (5V). Then a supplied the board with a 9V battery through the barrel jack. Still the same. Out of curiosity thought I tried to manually rotate the axis of the servo and it was barely rotating. Without any voltage supplied, you can easily rotate it with your hand, but with voltage applied on, it was really hard to rotate it so I didn't force it. Plus the body of the servo was getting hot. Any clues on that?

Plus the body of the servo was getting hot. Any clues on that?

Yes, it was burning current.
VI or I2R and all that.

Then a supplied the board with a 9V battery

Money to burn too.

So, general conclusion...? Supply the servo exclusively alone?

Supply the board from USB.
Put the 9V battery back in your smoke alarm where it belongs.
Power the servo from four AAs, with a common ground to the Mega.

Ok, but should that not work as well? Any suggestions after that? Plus, the board will be on a vehicle and the distance sensor attached on the axis of the servo. The vehicle will be moving all the time, so I won't be able to connect it via USB all the time. So I will be definitely needing the 9V battery to supply the board and the sensor.

Suggest you google "9V battery mAh", and remember those ratings will be for smoke-alarm type loads, i.e. very low.