PCA9685

From Let's Control It
Jump to: navigation, search

Introduction

The number of GPIO pins on the ESP module can be expanded with a PWM Expander. We will use the PCA9685 that provides 16 more pins that can be used as PWM output. This way it becomes possible to control 16 dimmable LED's

Hardware

PCA9685Module.jpg

The PCA9685 needs to be connected through the I2C interface. This chip is compatible with 3V3 and it can be connected to the ESP without levelshifters..

Connections

 PCA9685 	ESP-01
 GND 	 	GND
 VCC    	VCC
 SDA		GPIO 0
 SCL		GPIO 2

ESP Easy

The device is listed in the device dropdown, but you don't have to select it. There's actually nothing to configure there and the logic will work without selecting this plugin. You can use the control web page to set PWM levels using http commands to ESP Easy.

Commands

Command Value Extra information
PCAPWM,<pin>,<value> 0...4095 Control PCA9685 pwm level.
PCFGPIO,<value> 1,0 Control PCF8574 output pins.
PCFPulse,<pin>,<value>,<duration> 1,0 Pulse control on PCF8574 output pins (duration in mS, MILLIseconds)
PCFLongPulse,<pin>,<value>,<duration> 1,0 Pulse control on PCF8574 output pins (duration in S, seconds)