A user inhales medicine ejected from the medicine ejecting section of an inhaler into the air flow duct of an air flow duct forming member through a hole. A memory-transistor well is disposed within the semiconductor body. An error check cannot completely be omitted. The MEMS device also includes CMOS wafer bonded to the MEMS wafer.