Same code working differently on Nano 33 IoT and Mega

The sensor is powered by the 5v output (by shorting the VBUS jumper on the back) of the Nano 33 IoT board.