The purpose of the invention is to obtain a motor device able to minimize increases in temperature of control components inside a casing of a control device while also achieving a reduction in size. A control device 3 provided in a motor 2 includes: a control component group 16 that includes a first substrate 18 and a second substrate 19; a casing 13 for accommodating the control component group 16, an opening 11 being provided to said casing 13; and a low-heat-conduction section 42 having lower heat conductivity than the housing 13. The control device 3 has a lid 14 for closing off the opening section 11 once in contact with the casing 13. The first substrate 18 is attached to the lid 14. The second substrate 19 has a power conversion element 20 that emits more heat than the total amount of heat emitted by the first substrate 18, and is accommodated inside the casing 13 once separated from the lid 14. The power conversion element 20 is set apart from the first substrate 18 in the direction tracing the axis of the motor 2. A portion of the second substrate 19 lines up with the first substrate 18 in the direction intersecting the axis of the motor 2.