A humidifier configured to humidify an aerosol, comprising: - a first water compartment containing water used to humidify the aerosol,- a second water compartment containing water used to humidify the aerosol, wherein the first water compartment and the second water compartment each comprise a heating unit (130, 330) for heating the water in the corresponding compartment, - an intermediate chamber located between the first and the second water compartment (100, 300), the intermediate chamber comprising an aerosol inlet (21 0) and an aerosol outlet and providing first boundary surfaces of a passageway through which the aerosol to be humidified passes, - a first layer permeable to water vapour and impermeable to liquid water, which is located between the first water compartment and the intermediate chamber, wherein a section of the first layer provides a second boundary surface of the passageway, - a second layer permeable to water vapour and impermeable to liquid water, which is located between the second water compartment and the intermediate chamber, wherein a section of the second layer provides a third boundary surface of the passageway opposed to the second boundary surface and wherein the intermediate chamber has a substantially cylindrical shape, wherein the aerosol inlet and the aerosol outlet are located on the lateral surface of the intermediate chamber and wherein the intermediate chamber comprises at least two protrusions (240, 250, 260) which each protrude from the lateral surface of the intermediate chamber to its inside, wherein the at least two protrusions (240, 250, 260) are part of the first boundary surfaces, and protrude to the inside of the intermediate chamber in such a way that the passageway follows a meandering pattern inside the intermediate chamber between the at least two protrusions. - a first water compartment containing water used to humidify the aerosol,- a second water compartment containing water used to humidify the aerosol, wherein the first water compartment and the second water compartment each comprise a heating unit (130, 330) for heating the water in the corresponding compartment, - an intermediate chamber located between the first and the second water compartment (100, 300), the intermediate chamber comprising an aerosol inlet (21 0) and an aerosol outlet and providing first boundary surfaces of a passageway through which the aerosol to be humidified passes, - a first layer permeable to water vapour and impermeable to liquid water, which is located between the first water compartment and the intermediate chamber, wherein a section of the first layer provides a second boundary surface of the passageway, - a second layer permeable to water vapour and impermeable to liquid water, which is located between the second water compartment and the intermediate chamber, wherein a section of the second layer provides a third boundary surface of the passageway opposed to the second boundary surface and wherein the intermediate chamber has a substantially cylindrical shape, wherein the aerosol inlet and the aerosol outlet are located on the lateral surface of the intermediate chamber and wherein the intermediate chamber comprises at least two protrusions (240, 250, 260) which each protrude from the lateral surface of the intermediate chamber to its inside, wherein the at least two protrusions (240, 250, 260) are part of the first boundary surfaces, and protrude to the inside of the intermediate chamber in such a way that the passageway follows a meandering pattern inside the intermediate chamber between the at least two protrusions.