This paper describes the design and implementation of a gas mixer for mechanical ventilators using a system of PID controllers in multiloop and parallel configuration. The theoretical principles of gas mixing by partial volumes and their relationship with mechanical ventilation parameters are addressed. The design of the electro-pneumatic system of the mixer, the control system, and its implementation are presented in detail. All electronic designs, 3D components, and the complete programming code are provided. Finally, the performance results obtained through experimental tests are presented.