Difference between revisions of "PCA9685"

From Let's Control It
Jump to navigation Jump to search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Preliminary}}
 
 
 
= Introduction =
 
= 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
 
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
Line 17: Line 15:
 
   SCL GPIO 2
 
   SCL GPIO 2
  
= Software =
+
= ESP Easy =
  
== 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.
  
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 =
 +
 
 +
{| class="wikitable sortable"
 +
|-
 +
! Command
 +
! Value
 +
! Extra information
 +
|-
 +
 
 +
| PCAPWM,<pin>,<value>
 +
| '''0...4095'''
 +
| Control PCA9685 pwm level.
 +
|-
  
=== Output ===
+
| PCFGPIO,<value>
You can control output pins on this chip with the following http command:
+
| '''1,0'''
 +
| Control PCF8574 output pins.
 +
|-
  
'''<nowiki>http://<ESP IP address>/control?cmd=pcapwm,<pin>,<Level></nowiki>'''
+
| PCFPulse,<pin>,<value>,<duration>
 +
| '''1,0'''
 +
| Pulse control on PCF8574 output pins (duration in mS, MILLIseconds)
 +
|-
  
Pin can be chosen between 0 and 15.
+
| PCFLongPulse,<pin>,<value>,<duration>
Level can be set between 0 and 4095.
+
| '''1,0'''
 +
| Pulse control on PCF8574 output pins (duration in S, seconds)
 +
|-
 +
|}

Latest revision as of 18:11, 16 October 2017

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)