This article describes a signal-processing approach to detect mental stress using unobtrusive wearable sensors. The approach addresses a major weakness of traditional methods based on heart-rate-variability (HRV) analysis: sensitivity to respiratory influences. To address this issue, we build a linear model that predicts the effect of breathing on the autonomic nervous system activation, as measured through HRV. Subtraction of respiratory effects leads to a residual signal that provides better discrimination between mental stress and relaxation conditions than traditional HRV tachogram. The method is experimentally validated on a discrimination task with two psycho-physiological conditions: mental stress and relaxation. To illustrate the effectiveness of the method, we impose a pacing respiratory signal that interferes with the main spectral band of the sympathetic branch. Our results suggest that the HRV residual signal has more discrimination power than conventional HRV analysis in the presence of respiration interferences.