In this study, we have designed a compact sample chamber that can achieve accurate and continuous control of the relative humidity (RH) in the vicinity of 100\%. A 1,2-dioleoyl-sn-glycero-3-phosphocholine (DOPC) multilayer can be used as a humidity sensor by measuring its inter-layer repeat distance (d-spacing) via X-ray diffraction. We convert from DOPC d-spacing to RH according to a theory given in the literature and previously measured data of DOPC multilamellar vesicles in polyvinylpyrrolidone (PVP) solutions. This curve can be used for calibration of RH close to 100\%, a regime where conventional sensors do not have sufficient accuracy. We demonstrate that this control method can provide RH accuracies of 0.1 to 0.01\%, which is a factor of 10-100 improvement compared to existing methods of humidity control. Our method provides fine tuning capability of RH continuously for a single sample, whereas the PVP solution method requires new samples to be made for each PVP concentration. The use of this cell also potentially removes the need for an X-ray or neutron beam to pass through bulk water if one wishes to work close to biologically relevant conditions of nearly 100\% RH. © the Owner Societies 2015.