Video 20: Controlling Position of a Servo With a Potentiometer

This video demonstrates how to control servo position using a potentiometer and Raspberry Pi GPIO, including explanations of circuit setup, Python coding, ADC, PWM, mathematical calculations, error handling, and the importance of connections.

  1. Circuit Setup: Review of the previous lesson’s analog input circuit using the ADC0834 for Raspberry Pi.

  2. Servo Setup: Instructions for setting up the servo in the circuit, including wiring and power considerations.

  3. Understanding ADC and PWM: Get familiar with the concepts of Analog-to-Digital Converter (ADC) and Pulse Width Modulation (PWM).

  4. Reading analog signals: Discover how to read analog signals from a potentiometer connected to the Raspberry Pi.

  5. Calculating PWM percentage: Learn the formula to calculate the PWM percentage based on the analog signal value obtained.

  6. Controlling a servo motor: Explore the process of applying the calculated PWM percentage to control the position of a servo motor.

  7. Synchronization: Ensure synchronization between the potentiometer’s position and the servo motor’s position for accurate control.

  8. Mathematical Calculations: Explanation of the mathematical calculations used to determine PWM values based on potentiometer readings.

  9. Error Handling: Implementation of try-except blocks for program termination and GPIO cleanup.

  10. Importance of connections: Understand the significance of establishing reliable connections for precise readings and outputs.

Video