Measuring or monitoring air humidity is an increasing demands in the various fields. In this work, a simple and convenient method was utilized to prepare a melamine aerogel (MA) based sensor for humidity measurement. The sensing material was made from polymerization of polypyrrole (PPy) in the matrix of MA. The surface morphology was characterized by scanning electron microscopy (SEM) to examine the inner structure of the sensing material. MA was chosen as the substrate owing to the porous structure, which facilities the adsorption of water molecules from the air. The self-powered humidity sensor was manufactured by adhering conductive tapes on both side of PPy modified MA (PPy@MA). The sensor has a flexible, ultralight and ultraporous structure, and could generate humidity-induced open-circuit voltage from the concentration gradient of the H <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">+</sup> ions. The PPy@MA sensor exhibited the response and recovery time of 1.1 s and 4.5 s, respectively, when it is used for sensing the flowing wet air (RH 75 %). Furthermore, the sensitivity of the self-powered humidity sensor was evaluated by assessing the moisture changes of the human skin, and the moisture from the human breath.