Does the iPhone need to be plugged in during a sleep recording?

In general a fully charged iPhone should have plenty of battery capacity to run the sensors used to monitor you sleep throughout the night. For older iPhones with less battery capacity, you can opt to plug in your iPhone and place it on your mattress. To conserve battery, place the iPhone screen-down so the proximity sensor can turn the screen off to reduce battery consumption.