An air conditioner comprising: a motor including stator windings (U, V, W); a compressor driven by the motor; and a motor driving device that drives the motor, wherein the air conditioner raises a revolution speed of the motor depending on a temperature difference between an indoor temperature and a set temperature, and the motor driving device includes: a connection switching unit (3, 4) that includes a mechanical switch (31-33, 41-46) connected to the stator windings and an excitation coil (51a-53a, 61a-66a) opening or closing the mechanical switch (31-33, 41-46) by being energized or non-energized with excitation current and switches connection condition of the stator windings (U, V, W) to either of star connection and delta connection by opening or closing the mechanical switch (31-33, 41-46); and an inverter that supplies AC drive voltages to the stator windings (U, V, W), wherein the stator windings (U, V, W) include a first open winding, a second open winding and a third open winding, the first open winding has a first winding terminal connected to the inverter and a second winding terminal connected to the connection switching unit (3, 4), the second open winding has a third winding terminal connected to the inverter and a fourth winding terminal connected to the connection switching unit (3, 4), the third open winding has a fifth winding terminal connected to the inverter and a sixth winding terminal connected to the connection switching unit (3, 4), and the air conditioner is further characterized in that the connection switching unit (3, 4) is configured to switch the connection condition of the stator windings (U, V, W) to the star connection by connecting the second winding terminal of the first open winding, the fourth winding terminal of the second open winding and the sixth winding terminal of the third open winding together when the temperature difference is less than or equal to a threshold value and the excitation coil is not energized with the excitation current, and to switch the connection condition of the stator windings (U, V, W) to the delta connection by connecting the second winding terminal of the first open winding, the fourth winding terminal of the second open winding and the sixth winding terminal of the third open winding to the inverter when the temperature difference is greater than the threshold value and the excitation coil is energized with the excitation current. a motor including stator windings (U, V, W); a compressor driven by the motor; and a motor driving device that drives the motor, wherein the air conditioner raises a revolution speed of the motor depending on a temperature difference between an indoor temperature and a set temperature, and the motor driving device includes: a connection switching unit (3, 4) that includes a mechanical switch (31-33, 41-46) connected to the stator windings and an excitation coil (51a-53a, 61a-66a) opening or closing the mechanical switch (31-33, 41-46) by being energized or non-energized with excitation current and switches connection condition of the stator windings (U, V, W) to either of star connection and delta connection by opening or closing the mechanical switch (31-33, 41-46); and an inverter that supplies AC drive voltages to the stator windings (U, V, W), wherein the stator windings (U, V, W) include a first open winding, a second open winding and a third open winding, the first open winding has a first winding terminal connected to the inverter and a second winding terminal connected to the connection switching unit (3, 4), the second open winding has a third winding terminal connected to the inverter and a fourth winding terminal connected to the connection switching unit (3, 4), the third open winding has a fifth winding terminal connected to the inverter and a sixth winding terminal connected to the connection switching unit (3, 4), and the air conditioner is further characterized in that the connection switching unit (3, 4) is configured to switch the connection condition of the stator windings (U, V, W) to the star connection by connecting the second winding terminal of the first open winding, the fourth winding terminal of the second open winding and the sixth winding terminal of the third open winding together when the temperature difference is less than or equal to a threshold value and the excitation coil is not energized with the excitation current, and to switch the connection condition of the stator windings (U, V, W) to the delta connection by connecting the second winding terminal of the first open winding, the fourth winding terminal of the second open winding and the sixth winding terminal of the third open winding to the inverter when the temperature difference is greater than the threshold value and the excitation coil is energized with the excitation current.