How to share common ground between an Arduino Mega and Wemos D1 Mini?

I have my Arduino Mega collecting sensor data and sending that via serial to a Wemos D1.

The Mega is being run off of a barrel-type power adapter. I've noticed that running it off of just the USB cable results in unreliable sensor readings (not sure why).

The Wemos D1 can only be powered off of the micro-USB port.

The two need to share a common ground to have reliable serial comms. The most direct way I can think of to do this is to find a 5V power supply and solder on a barrel connector and a micro-USB connector and power both boards from this single power supply.

Is there another easier way?

The two need to share a common ground to have reliable serial comms.

So you take the GND connector on one Arduino and connect it to the GND connector on the other Arduino. Do you not?

Grumpy_Mike:
So you take the GND connector on one Arduino and connect it to the GND connector on the other Arduino. Do you not?

Oh, duh, sorry, I think I get it now. If I don't connect the grounds of each device together there isn't a complete circuit between them - it's just the TX pin of the Mega going into the RX pin of the Wemos.

But I would expect with a broken circuit to get nothing on the Wemos since there shouldn't be current flow, but it instead gets garble if there's no common ground.

fuzzybabybunny:
it's just the TX pin of the Mega going into the RX pin of the Wemos.

So you're putting 5volt from the Mega into a 3.3volt pin of the Wemos.
Leo..

But I would expect with a broken circuit to get nothing

No you have in effect a floating input signal that is subject to interference. The biggest, but not the only source of interference, is the signal from the other Arduino, hence it will work some time but it will give you rubbish.