Encomendado em dias úteis antes das 14:00 = enviado no mesmo dia e, em 98% dos casos, entregue no dia seguinte. Devolução gratuita 30 dias para refletir 1 ano de garantia

Esquema de ligação e exemplo de código

Como ligar o Driver PWM Servo I2C de 16 canais 12-Bit a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.

PCA9685 16-Channel PWM Servo Driver Demo

This example communicates with the PCA9685 16-channel 12-bit PWM driver over I2C. The Arduino initializes the board at 50 Hz and sweeps the PWM signal on Channel 0 back and forth, perfect for testing standard servos or LED fading. Open the Serial Monitor at 115200 baud to view the current pulse values.

Esquema de ligação: Driver PWM Servo I2C de 16 canais 12-Bit num Arduino UNO
Esquema de ligação · Clique para ampliar
Tabela de ligação: Driver PWM Servo I2C de 16 canais 12-Bit num Arduino UNO
Tabela de ligação · Clique para ampliar
PCA9685_16_Channel_PWM_Servo_Driver_Demo.ino · compilado e testado
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : PCA9685 16-Channel PWM Servo Driver Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : 16 Channel 12-Bit PWM Servo Driver I2C
 *  Libraries : Adafruit PWM Servo Driver Library 3.0.3
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

// Pulse length bounds for standard 50Hz servos
const uint16_t SERVOMIN = 150; // ~0.75 ms pulse (0 degrees)
const uint16_t SERVOMAX = 600; // ~2.25 ms pulse (180 degrees)

void setup() {
  Serial.begin(115200);
  Serial.println(F("PCA9685 16-Channel Servo Driver Demo"));

  pwm.begin();
  pwm.setOscillatorFrequency(27000000);
  pwm.setPWMFreq(50); // 50 Hz PWM for hobby servos
  delay(10);
}

void loop() {
  Serial.println(F("Moving to 0 degrees..."));
  for (uint16_t pulse = SERVOMIN; pulse < SERVOMAX; pulse += 5) {
    pwm.setPWM(0, 0, pulse);
    delay(20);
  }

  delay(500);

  Serial.println(F("Moving to 180 degrees..."));
  for (uint16_t pulse = SERVOMAX; pulse > SERVOMIN; pulse -= 5) {
    pwm.setPWM(0, 0, pulse);
    delay(20);
  }

  delay(500);
}

Bibliotecas necessárias: Adafruit PWM Servo Driver Library 3.0.3

Wiring diagram and example code generated by Codey.online — https://www.codey.online

PCA9685 16-Channel PWM Servo Driver Demo

This project controls a servo motor using the PCA9685 16-channel 12-bit PWM driver over I2C. Because the PCA9685 and servos run at 5V, a 4-channel bidirectional logic level shifter protects the 3.3V ESP32 I2C pins (GPIO 21 and GPIO 22). The sketch initializes the PCA9685 and continuously sweeps the servo on Channel 0 back and forth.

Esquema de ligação: Driver PWM Servo I2C de 16 canais 12-Bit num ESP32 DevKit V1
Esquema de ligação · Clique para ampliar
Tabela de ligação: Driver PWM Servo I2C de 16 canais 12-Bit num ESP32 DevKit V1
Tabela de ligação · Clique para ampliar
PCA9685_16_Channel_PWM_Servo_Driver_Demo.ino · compilado e testado
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : PCA9685 16-Channel PWM Servo Driver Demo
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : 16 Channel 12-Bit PWM Servo Driver I2C
 *  Libraries : Adafruit PWM Servo Driver Library 3.0.3
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// Default I2C address is 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40);

// 12-bit pulse lengths (out of 4096) for standard 50Hz servos
#define SERVOMIN  150 // Minimum pulse length (~0.75 ms / 0 degrees)
#define SERVOMAX  600 // Maximum pulse length (~2.25 ms / 180 degrees)
#define SERVO_FREQ 50 // Standard analog servo frequency (50 Hz)

const uint8_t servoChannel = 0;

void setup() {
  Serial.begin(115200);
  Serial.println("PCA9685 Servo Driver Demo");

  // Initialize I2C on ESP32 pins (SDA=GPIO 21, SCL=GPIO 22)
  Wire.begin(21, 22);

  pwm.begin();
  pwm.setOscillatorFrequency(27000000);
  pwm.setPWMFreq(SERVO_FREQ);

  delay(10);
  Serial.println("Ready! Sweeping servo on Channel 0...");
}

void loop() {
  // Sweep from 0 to 180 degrees
  for (uint16_t pulselen = SERVOMIN; pulselen <= SERVOMAX; pulselen += 5) {
    pwm.setPWM(servoChannel, 0, pulselen);
    delay(15);
  }
  delay(500);

  // Sweep back from 180 to 0 degrees
  for (uint16_t pulselen = SERVOMAX; pulselen >= SERVOMIN; pulselen -= 5) {
    pwm.setPWM(servoChannel, 0, pulselen);
    delay(15);
  }
  delay(500);
}

Bibliotecas necessárias: Adafruit PWM Servo Driver Library 3.0.3

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Driver PWM Servo I2C de 16 canais 12-Bit

  • Tensão: alimentação DC5-10V
  • Interface de comunicação: IIC
  • 16 canais
  • O chip PCA9685 está colocado no centro da placa
  • Conector de entrada de alimentação
  • Indicador de corrente
  • 4 grupos de conectores de 3 pinos para ligar até 16 servomotores
  • Condensador de 10V / 1000uF
  • Todas as linhas de saída PWM têm uma resistência de 220 ohm

Dimensões
Comprimento: 6,9cm
Largura: 2,5cm
Altura: 1,5cm

  • PCA9685-chip
  • 4 groepen connectors
  • DC5-10V voeding
  • 6,9 × 2,5 × 1,5 cm

Por que escolher este produto?

  • Aansturing van 16 servo's – Sluit tot 16 servomotoren aan.
  • IIC-communicatie – Werkt via de IIC-interface.
  • Stroomindicator aanwezig – Voor visuele status van voeding.
  • Compact bordformaat – Past met 6,9 × 2,5 × 1,5 cm.
Especificações
Largura2,5 cm
Comprimento6,9 cm
Tipo16 canais
Altura1.5 cm
ModeloPCA9685
Interface de comunicaçãoIIC

Frequentemente comprados juntos

Total: € 18,10

Avaliações

★★★★★ 4,0/5 1 avaliação
  • ★★★★★George NadortCompra verificada

    Só me falta a instrução de ligação.

Escrever uma avaliação
A tua avaliação

Envio & devoluções

Envio

  • Pacote com Track & Trace€ 6,20Alemanha 1-3, França 2-3, Espanha/Itália 2-4, outros países 3-5 dias úteis
  • Pacote com Track & Trace€ 7,35Alemanha 1-3, França 2-3, Espanha/Itália 2-4, outros países 3-5 dias úteis
  • Pacote com Track & Trace€ 8,50Alemanha 1-3, França 2-3, Espanha/Itália 2-4, outros países 3-5 dias úteis
  • Pacote com Track & Trace€ 9,15Alemanha 1-3, França 2-3, Espanha/Itália 2-4, outros países 3-5 dias úteis
Tudo sobre envios

Devoluções

Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.

Tudo sobre devoluções

Vistos recentemente