Servo motor control circuit

The Servo motor circuit setup is very straightforward. The breadboard setup of the servo motor with Arduino Uno is shown in the following figure for reference. Follow the schematic diagram shown below to build the DC motor circuit.

This setup has been designed in such a way that every time upon pressing the right-hand side button, the servo motor's rotor position will get incremented by 5 degrees, until it reaches 175 degrees. Similarly, upon pressing the left-hand side button, the position of the servo motor's rotor will get decremented by 5 degrees:

Figure 5: Servo motor breadboard setup

Note how the two momentary push buttons have been powered from the 3.3V pin. Since the Arduino Uno treats 3.3 volt signals as HIGH, we can use the 3.3V pin with the push buttons and read the HIGH signals using the digitalRead() function.

Start running this prototype by pressing the right-hand side button as the right side button press is coded to increment the servo motor's rotor position from zero. If you try to press the left side button in the beginning, then there will be no response, as the servo motor position will be set to zero degrees to begin with.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.147.190