PCA9685 connecting problem
Moderators: grovkillen, Stuntteam, TD-er
PCA9685 connecting problem
Hi,
I am currnetly trying to connect an PCA9685 to an NodeMCU (ESP8266) Board. On the ESP is running ESP Easy Mega from December.
So far I've connected GND between the ESP and PCA9685, 3,3V to VCC and also GPIO4 to SDA and GPIO5 to SCL of the PCA9685. I've left the additional Power-Connections at the PCA9685 free. After that, I've done an I2C Scan in ESPEasy and it found at adress 0x40 the PCA9685 (see image attached). Next I've created a device (don't know if this is neccessary) and choose the address 0x40 for that device (see image attached). Now I tried to create a PWM signal at PWM Pin 0 and called the following URL: http://192.168.178.10/control?cmd=pcapwm,0,2000 but unfortunately it doesen't generate a PWM signal at that PIN. Does anybody know what I am doing wrong?
I also tried to generate a PWM Signal with the ESP8266 itself and called the URL: http://192.168.178.10/control?cmd=PWM,13,400 . This works like a charm and I've successfully checked it with my Oscilloscope. But I need in total 10 different PWM signals, so the PCA9685 seems to me the better solution.
Greetings, Hannes
I am currnetly trying to connect an PCA9685 to an NodeMCU (ESP8266) Board. On the ESP is running ESP Easy Mega from December.
So far I've connected GND between the ESP and PCA9685, 3,3V to VCC and also GPIO4 to SDA and GPIO5 to SCL of the PCA9685. I've left the additional Power-Connections at the PCA9685 free. After that, I've done an I2C Scan in ESPEasy and it found at adress 0x40 the PCA9685 (see image attached). Next I've created a device (don't know if this is neccessary) and choose the address 0x40 for that device (see image attached). Now I tried to create a PWM signal at PWM Pin 0 and called the following URL: http://192.168.178.10/control?cmd=pcapwm,0,2000 but unfortunately it doesen't generate a PWM signal at that PIN. Does anybody know what I am doing wrong?
I also tried to generate a PWM Signal with the ESP8266 itself and called the URL: http://192.168.178.10/control?cmd=PWM,13,400 . This works like a charm and I've successfully checked it with my Oscilloscope. But I need in total 10 different PWM signals, so the PCA9685 seems to me the better solution.
Greetings, Hannes
- Attachments
-
- Normal PWM Command.PNG (6.52 KiB) Viewed 13632 times
-
- I2C Scan.PNG (20.68 KiB) Viewed 13632 times
-
- Hardware.PNG (22.57 KiB) Viewed 13632 times
-
- Devices.PNG (35.43 KiB) Viewed 13632 times
-
- Device.PNG (28.53 KiB) Viewed 13632 times
-
- Command.PNG (6.97 KiB) Viewed 13632 times
Re: PCA9685 connecting problem
Nobody? I've purchased a second PCA9685, but unfortunatley the same problem with the second one too. Maybe someone will find a mistake in the construction of my circuit (see image attached).
Greetings, Hannes
Greetings, Hannes
- Attachments
-
- 20190113_204034.jpg (1.33 MiB) Viewed 13610 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: PCA9685 connecting problem
I'm not sure what pin numbers that board will listen to. Probably not 0..16
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: PCA9685 connecting problem
Hi, I tried that already, but 0...16 seems to be the correct ones. I also flashed an older EspEasy Mega Version from August 2018 and made a factory reset. Unfortunately still the same, no PWM at the PCA9685 Pins. 

Re: PCA9685 connecting problem
I just flashed the older Version ESP_Easy_mega-20180804_normal_ESP8266_4096.bin on my NodeMCU Lolin V3 Board. After sending the command, I get the HTTP result (see image attached). But also no PWM at the PCA9685 pins.
- Attachments
-
- EspEasy.png (14.55 KiB) Viewed 13595 times
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: PCA9685 connecting problem
Although you found an address ...I2C Scan in ESPEasy and it found at adress 0x40
Did you ...
Connect a pull-up resistor(1.5k to 10k) on SDA line. Connect a pull-up resistor(1.5k to 10k) on SCL line ?
Although it should not be needed (there should be a pull-up on-board):
SCL - I2C clock pin, connect to your microcontrollers I2C clock line. Can use 3V or 5V logic, and has a weak pullup to VCC
SDA - I2C data pin, connect to your microcontrollers I2C data line. Can use 3V or 5V logic, and has a weak pullup to VCC
Secondary:
Although it should not be needed (there should be a pull-down on-board)OE - Output enable. Can be used to quickly disable all outputs. When this pin is low all pins are enabled. When the pin is high the outputs are disabled. Pulled low by default so it's an optional pin!
Just to make sure, connect OE to ground.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: PCA9685 connecting problem
did you try mode 0x14?
Re: PCA9685 connecting problem
Testes both, an what should I say, it was the 0x14 mode. The older ESP Mega image doesn't support setting the mode. The newer ones (I tried December 2018) let you specify the mode while creating a device. So first you have to ad the device, specify the address (0x40) and then change the mode to 0x14. Thank you so much for helping me!
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: PCA9685 connecting problem
For reference on Oct 22, 2018:
https://github.com/letscontrolit/ESPEasy/issues/1940
(that I don't understand)
What is the meaning of mode 0x10 and mode 0x14 ?
https://github.com/letscontrolit/ESPEasy/issues/1940
(that I don't understand)
What is the meaning of mode 0x10 and mode 0x14 ?
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: PCA9685 connecting problem
Good question. Here is the datasheet: https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf
On page 16 you can find the description of the Mode 2 register. The difference between 0x10 (Binary 00010000) and 0x14 (Binary 00010100) seems to be the second bit (starting at bit 0) and this is:
0 The 16 LEDn outputs are configured with an open-drain structure.
1* The 16 LEDn outputs are configured with a totem pole structure
But maybe I'm wrong
On page 16 you can find the description of the Mode 2 register. The difference between 0x10 (Binary 00010000) and 0x14 (Binary 00010100) seems to be the second bit (starting at bit 0) and this is:
0 The 16 LEDn outputs are configured with an open-drain structure.
1* The 16 LEDn outputs are configured with a totem pole structure
But maybe I'm wrong

-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: PCA9685 connecting problem
I think you are right!But maybe I'm wrong
The fourth bit seems INVRT/NOT INVRT: 0x10 (Binary 00010000) and 0x00 (Binary 00000000)
That explains 4 of the 32 (!!) options
0x00 : open-drain
0x04 : totem pole
0x10 : Inverted logic / open-drain
0x14 : Inverted logic / totem pole
From that description of the Mode 2 register, I conclude:
Bit 1: not applicable for GUI
Bit 3: not applicable for GUI
Bit 5-7: not applicable for GUI
Are those other 28 options just a source of user mistakes?
ESP-NOT-so-Easy?
@grovkillen:
Hope this helps when you document this module in RTD.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: PCA9685 connecting problem
I second that! Maybe it would be the best to reduce the ComboBox to the four entries and make 0x14 as default. Also it would help to explain within the drop down or next to it whats the result of each option.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: PCA9685 connecting problem
Thanks for digging around! 

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: PCA9685 connecting problem
Hello,
I have a wESP32 with the 27122020 release. when I send a comaand to the PCA the outputs seem to work fine, but the 'state' that is returned alway remains 0. I am using the stock 0x40 adress and mode 0xE (14) (non inverted that seems to be the PCA sources for optocouplers)
when I do for example PCAPWM,0,2000 the response is:
{
"log": "0: PWM 0",
"plugin": 22,
"pin": 0,
"mode": "PWM",
"state": 0
}
should I be worried? At the moment there is no other hardware connected to the wESP32 board. 8k2 pull up resistors are present between 3.3v and both I2C lines.
I have a wESP32 with the 27122020 release. when I send a comaand to the PCA the outputs seem to work fine, but the 'state' that is returned alway remains 0. I am using the stock 0x40 adress and mode 0xE (14) (non inverted that seems to be the PCA sources for optocouplers)
when I do for example PCAPWM,0,2000 the response is:
{
"log": "0: PWM 0",
"plugin": 22,
"pin": 0,
"mode": "PWM",
"state": 0
}
should I be worried? At the moment there is no other hardware connected to the wESP32 board. 8k2 pull up resistors are present between 3.3v and both I2C lines.
Who is online
Users browsing this forum: No registered users and 11 guests