Page 1 of 1

PCA9685 wiring

Posted: 23 Feb 2016, 13:27
by wutu
Hi, I am unable to run PCA9685. On i2c see him. And I have this wiring: https://blog.adafruit.com/2013/03/29/po ... pberry_pi/, on ESP of course. Is it right?

Re: PCA9685 wiring

Posted: 23 Feb 2016, 15:54
by costo
When you do a I2C scan you should see address 0x40 with something like "SI7021 Temp/Hum Sensor, INA219, PCA9685" as description.
After adding this device you can use this command to set one output at a time.
http://<ESP IP address>/control?cmd=pcapwm,<pin>,<Level>

Re: PCA9685 wiring

Posted: 23 Feb 2016, 16:34
by wutu
costo: thx, of course I read it.
But on the wiki is not mentioned involved LEDs.
According to the datasheet it may be Fig 13., Fig 14. and Fig 15., on page 29.
https://www.adafruit.com/datasheets/PCA9685.pdf

Fig 13. and Fig 15. is not working for me.

Re: PCA9685 wiring

Posted: 23 Feb 2016, 17:23
by costo
wutu wrote:costo: thx, of course I read it.
But on the wiki is not mentioned involved LEDs.
According to the datasheet it may be Fig 13., Fig 14. and Fig 15., on page 29.
https://www.adafruit.com/datasheets/PCA9685.pdf

Fig 13. and Fig 15. is not working for me.
I understand your problem, it is not really ESPEasy related but about electronic fundamentals.

The easyest way is to start with only one single small led. The PCA9685 can source/sink 25mA, enough to control one single bright LED.
If you have that working you have to find out yourself how to connect a RGB strip, the adafruit site explains it all, just follow exactly the examples .
https://learn.adafruit.com/rgb-led-strips/usage

edit: make sure to have a small resistor of about 100ohm in series with the single led to limit the current to max 25mA.

Re: PCA9685 wiring

Posted: 23 Feb 2016, 19:17
by wutu
Thank you, but it's a matter ESPEasy, the program depends on what mode will control the output.
values:
INVRT
OUTDRV

P.S. I have education in electronics and telecommunications. Needless to lecture me about the basics. :D

Re: PCA9685 wiring

Posted: 23 Feb 2016, 19:56
by costo
wutu wrote:Thank you, but it's a matter ESPEasy, the program depends on what mode will control the output.
values:
INVRT
OUTDRV

P.S. I have education in electronics and telecommunications. Needless to lecture me about the basics. :D
That is why I suggested you try it first with one single LED to see how that works.
The plugin initialises the PCA9685 with default values that will work for most situations and that's it.
You can not set or control any parameters of the PCA9685 from within ESPEasy.

From the plugin:

Code: Select all

          // default mode is open drain ouput, drive leds connected to VCC
          Plugin_022_writeRegister(PCA9685_MODE1, (byte)0x01); // reset the device
          delay(1);
          Plugin_022_writeRegister(PCA9685_MODE1, (byte)B10100000);  // set up for auto increment
          Plugin_022_writeRegister(PCA9685_MODE2, (byte)0x10); // set to output
The plugin initialises MODE2 with 0x10, see table 6 of PDF .
MODE2 binary 00010000 only bit4 =1 which is the INVRT bit
INVRT = 1
OUTDRV = 0.

Hopefully this helps.
If you want other parameters you can change the byte of MODE1 and/or MODE2 register and recompile it for yourself.

Re: PCA9685 wiring

Posted: 24 Feb 2016, 08:03
by wutu
costo: Thank you, that is exactly it. Afternoon test it and let you know.

Setup is:
Plugin_022_writeRegister(PCA9685_MODE2, (byte)B00000101);

Thank you again. FETs are already hot. :P

Re: PCA9685 wiring

Posted: 13 Sep 2017, 15:05
by wthiess
Hello!

I have the same problem. How is the solution in detail.
Please help.

lg
wolfgang

Re: PCA9685 wiring

Posted: 01 Oct 2017, 13:43
by wutu
Download EASPEasy. Open it in ArduinoIDE. On tab _P022_PCA9685 change

this line
Plugin_022_writeRegister(PCA9685_MODE2, (byte)0x10); // set to output
to
Plugin_022_writeRegister(PCA9685_MODE2, (byte)B00000101); // set to output

Compile and upload to ESP.

Re: PCA9685 wiring

Posted: 03 Oct 2017, 20:02
by wthiess
Hallo!

Unfortunately, I can not cope with the IDE. You should simply install this parameter in ESPEASY. But have no idea who can be asked here.

lg
Wolfgang

Re: PCA9685 wiring

Posted: 03 Oct 2017, 20:14
by Shardan
+1 for that.

The PCA 9685 can do much more then ESPEasy allows atm.

Re: PCA9685 wiring

Posted: 10 Oct 2017, 09:39
by wthiess
Hallo wutu!

Thank you I made it.
lg
Wolfgang

PS:Nevertheless, the parameter should be adjustable. Would enrich ESPEASY.