Opioid‐related deaths from respiratory depression are increasing but there is only limited information on the effect of morphine on breathing during sleep. This study aimed to detect and quantify opioid‐induced cardiorespiratory pattern changes during sleep in obstructive sleep apnea (OSA) patients using novel automated methods and correlate these with conventional polysomnography (PSG) measures. Under a randomized double‐blind placebo‐controlled crossover design, 60 male OSA patients attended two one‐night visits to the sleep laboratory, at least a week apart. Either a 40‐mg controlled‐release oral morphine dose or placebo was administered. Breathing during sleep was measured by standard in‐laboratory PSG. We analysed the inter‐breath interval (IBI) from the PSG flow channel to quantify breathing irregularity. Cardiopulmonary coupling (CPC) was analysed using the PSG electrocardiogram (ECG) channel. Following the consumption of morphine, the 60 OSA patients had fewer breaths (p = .0006), a longer inter‐breath interval (p < .0001) and more irregular breathing with increased IBI coefficient of variation (CV) (p = .0015) compared to the placebo night. A higher CPC sleep quality index was found with morphine use. The change of key IBI and CPC parameters was significantly correlated with the change of key PSG sleep‐disordered breathing parameters. In conclusion, 40 mg controlled‐release morphine resulted in a longer breathing cycle and increased breathing irregularity but generally more stable sleep in OSA patients. The significant links between the IBI and CPC techniques and a range of PSG sleep‐disordered breathing parameters may suggest a practical value as surrogate overnight cardiorespiratory measurements, because both respiratory flow and ECG can be detected by small portable devices.