This does not narrow it down enough, can you post an annotated schematic showing how this has been wired. Be sure to show all connections, power, ground and power sources. Also post links to technical information on the hardware devices. At this point I will take a SWAG and say you are overloading the Mega regulators or power source. Here are a few rules:
Gil's Crispy Critter Rules, they apply to processor hardware:
Rule #1. A Power Supply the Arduino is NOT!
Rule #2. Never Connect Anything Inductive to an Arduino!
Rule #3 Don't connecting or disconnecting wires with power on.
Rule #4 Do not apply power to any pin unless you know what you are doing.
LaryD's Corollarys
Coro #1 when first starting out, add a 220R resistor in series with both Input and Output pins.
Coro #2 buy a DMM (Digital Multi-meter) to measure voltages, currents and resistance.
Violating these rules tends to make crispy critters out of Arduinos.