Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Raspberry Pi 4B Servomotor Control System with Rotary Encoder Input

Image of Raspberry Pi 4B Servomotor Control System with Rotary Encoder Input

Circuit Documentation

Summary

The circuit in question is designed to interface a Raspberry Pi 4B with various peripherals including servomotors, a PWM servo breakout board, a rotary encoder, and a power supply module. The Raspberry Pi 4B serves as the central processing unit, controlling the servomotors via the Adafruit PCA9685 PWM Servo Breakout board. The rotary encoder is directly connected to the Raspberry Pi for user input. Power is supplied to the circuit through a 2.1mm Barrel Jack with Terminal Block, which provides power to the PWM breakout board and subsequently to the servomotors.

Component List

Raspberry Pi 4B

  • A single-board computer with multiple GPIO pins for interfacing with various components.

Servomotor MG90S (2 units)

  • A small and lightweight servomotor suitable for applications that require precise control.

Adafruit PCA9685 PWM Servo Breakout

  • A 16-channel, 12-bit PWM breakout board used for controlling multiple servomotors.

TTL Serial JPEG Camera

  • A camera module capable of capturing JPEG images, interfacing via serial communication.

HW-040 Rotary Encoder

  • An input device that provides rotational feedback and can be used for navigation through menus or adjusting settings.

2.1mm Barrel Jack with Terminal Block

  • A power connector that allows for easy connection to an external power supply.

Wiring Details

Raspberry Pi 4B

  • 3V3 - Powers the HW-040 Rotary Encoder.
  • 5V - Not connected.
  • GPIO2 - Connected to SDA on Adafruit PCA9685 PWM Servo Breakout for I2C communication.
  • GPIO3 - Connected to SCL on Adafruit PCA9685 PWM Servo Breakout for I2C communication.
  • GND - Common ground for the circuit.
  • Other GPIOs - Not connected or used for other purposes not specified in the net list.

Servomotor MG90S

  • SIG - Signal input from PWM15 or PWM11 on Adafruit PCA9685 PWM Servo Breakout.
  • VCC - Power input from 5.0V on Adafruit PCA9685 PWM Servo Breakout.
  • GND - Ground connection to GND on Adafruit PCA9685 PWM Servo Breakout.

Adafruit PCA9685 PWM Servo Breakout

  • PWRIN - Power input from POS on 2.1mm Barrel Jack with Terminal Block.
  • GND - Ground connection to NEG on 2.1mm Barrel Jack with Terminal Block and common ground with Raspberry Pi 4B.
  • VCC - Connected to 3V3 on Raspberry Pi 4B.
  • SDA and SCL - I2C communication with Raspberry Pi 4B.
  • PWM7 to PWM0, PWM15 to PWM8 - PWM outputs to servomotors or not connected.
  • 5.0V - Power output to servomotors.

HW-040 Rotary Encoder

  • SW - Switch pin connected to GPIO22 on Raspberry Pi 4B.
  • + - Power input from 3V3 on Raspberry Pi 4B.
  • DT - Data pin connected to GPIO6 on Raspberry Pi 4B.
  • CLK - Clock pin connected to GPIO26 on Raspberry Pi 4B.
  • GND - Ground connection to GND on Raspberry Pi 4B.

2.1mm Barrel Jack with Terminal Block

  • POS - Positive power input to PWRIN on Adafruit PCA9685 PWM Servo Breakout.
  • NEG - Ground connection to GND on Adafruit PCA9685 PWM Servo Breakout.

Documented Code

No code has been provided for the microcontrollers or other programmable components in the circuit. Therefore, this section is not applicable for the current documentation. If code becomes available, it should be documented here with appropriate descriptions of its functionality and usage.