Why doesn’t the alarm go off when my iPhone is plugged into a charger?

The Smart Sleep Cycle Alarm will go off when your iPhone or iPod touch is connected to an Apple branded charger.

Some 3rd party USB iPhone cables prevent the iPhone from playing sounds. If you charge your iPhone while recording sleep, please ensure you are using the Apple branded USB cable that came with your iPhone or iPod touch. If you use a 3rd party cable, check that your iPhone can still play sounds when it is plugged into power with that cable.