A dry powder inhaler for pulmonary or nasal delivery, having a chamber for housing therein a capsule containing a dry powder formulation, an inhalation channel in fluid communication with said chamber and an inhaler body defining at least partially said chamber, said chamber being shaped in order to determine an agitated motion of said capsule in said chamber during an inhalation of a user through said inhalation channel, said inhaler comprising: - a capsule-piercing mechanism arranged to pierce said capsule in said chamber; and - a monitoring system comprising: - an accelerometer arranged to measure mechanical oscillations determined at least by said agitated motion and by a flow of air through said chamber and/or inhalation channel; - a detection unit arranged to detect an activation of the capsule-piercing mechanism; and - an electronic processing unit configured to receive signals from said detection unit and from said accelerometer, characterized in that reception of a signal from said detection unit triggers processing of signals from said accelerometer by said electronic processing unit in order to generate inhalation data; wherein said monitoring system comprises a printed circuit board mechanically coupled to said inhaler body in order to be affected by mechanical oscillations during said inhalation, wherein said accelerometer is fixed on said printed circuit board in order to measure said mechanical oscillations, and wherein said printed circuit board is arranged to transmit the mechanical oscillations from the inhaler body to the accelerometer. said inhaler comprising: - a capsule-piercing mechanism arranged to pierce said capsule in said chamber; and - a monitoring system comprising: - an accelerometer arranged to measure mechanical oscillations determined at least by said agitated motion and by a flow of air through said chamber and/or inhalation channel; - a detection unit arranged to detect an activation of the capsule-piercing mechanism; and - an electronic processing unit configured to receive signals from said detection unit and from said accelerometer, - a capsule-piercing mechanism arranged to pierce said capsule in said chamber; and - a monitoring system comprising: - an accelerometer arranged to measure mechanical oscillations determined at least by said agitated motion and by a flow of air through said chamber and/or inhalation channel; - a detection unit arranged to detect an activation of the capsule-piercing mechanism; and - an electronic processing unit configured to receive signals from said detection unit and from said accelerometer, - an accelerometer arranged to measure mechanical oscillations determined at least by said agitated motion and by a flow of air through said chamber and/or inhalation channel; - a detection unit arranged to detect an activation of the capsule-piercing mechanism; and - an electronic processing unit configured to receive signals from said detection unit and from said accelerometer, characterized in that reception of a signal from said detection unit triggers processing of signals from said accelerometer by said electronic processing unit in order to generate inhalation data; wherein said monitoring system comprises a printed circuit board mechanically coupled to said inhaler body in order to be affected by mechanical oscillations during said inhalation, wherein said accelerometer is fixed on said printed circuit board in order to measure said mechanical oscillations, and wherein said printed circuit board is arranged to transmit the mechanical oscillations from the inhaler body to the accelerometer.