Mechanical ventilators work by themselves without manual operation and are usually controlled by computers, and can be powered by either electricity connected to a wall outlet or battery, or pneumatics without the use of electricity. The air can be moved in and out of the patient by attaching an oxygen mask on the patient or by connecting the ventilator to a breathing tube inserted into the nostrils, the larynx or the trachea. They are used to help the patient breathe for a long period of time.