Background: When the COVID-19 pandemic hit, many engineers and makers put their skills to use to see how they could help others. Folks started making masks. People were 3D-printing ear savers to help relief strain from wearing masks all day for essential service workers and health-care workers. People were finding all sorts of DIY solutions to protect each other, like the Corsi-Rosenthal Boxes and homemade disinfectants.
One such solution that popped up across the internet were prototypes for an Arduino driven mechanical ventilator. These typically involved an Arduino, a servo, and an Ambu bag. The Arduino would control the servo which would actuate an arm that would contract and expand the Ambu bag, forcing air in and out of someone's lung to serve as a ventilator.
Goal: Learn how to control the speed and angle of a servo motor with an Arduino. Use this knowledge to mimic the functionality required to inflate and deflate an Ambu bag to create a low-cost ventilator.
Source: https://www.prateeks.in/2021/01/arduino-based-ventilator.html
Pinout
Note: If you are using more than one servo or a larger servo, you must use an external power supply to provide 5V to the motor. Make sure to connect the ground between the Arduino board and the power supply, so they have a common reference.
Use the component resources page discussing servo motors to learn how to control a servo motor with an Arduino.