Résumé : We study contact angle hysteresis by tracking stable and metastable contact angles upon varying the volume of a liquid inside a chemically heterogeneous microchannel. We construct a graphical force balance for this system with a straight contact line. Hysteresis is induced by wettability gradients above a finite threshold value. Sufficiently above this threshold, we find good agreement with the reported formulas for the hysteresis force for a diluted system of defects. In particular it is found to be proportional to the defect force squared and the defect concentration.