A portable electronic device comprises a housing and a chemical sensor arranged inside the housing which chemical sensor is adapted to measure a property of at least one analyte. The device further comprises an opening in the housing for exposing the chemical sensor to the fluid to be analyzed.