PCA9685 wiring

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
wutu
Normal user
Posts: 35
Joined: 05 Feb 2016, 07:33

PCA9685 wiring

#1 Post by wutu » 23 Feb 2016, 13:27

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?

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: PCA9685 wiring

#2 Post by costo » 23 Feb 2016, 15:54

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>

wutu
Normal user
Posts: 35
Joined: 05 Feb 2016, 07:33

Re: PCA9685 wiring

#3 Post by wutu » 23 Feb 2016, 16:34

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.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: PCA9685 wiring

#4 Post by costo » 23 Feb 2016, 17:23

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.

wutu
Normal user
Posts: 35
Joined: 05 Feb 2016, 07:33

Re: PCA9685 wiring

#5 Post by wutu » 23 Feb 2016, 19:17

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

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: PCA9685 wiring

#6 Post by costo » 23 Feb 2016, 19:56

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.

wutu
Normal user
Posts: 35
Joined: 05 Feb 2016, 07:33

Re: PCA9685 wiring

#7 Post by wutu » 24 Feb 2016, 08:03

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

wthiess
New user
Posts: 6
Joined: 29 Jul 2017, 00:53

Re: PCA9685 wiring

#8 Post by wthiess » 13 Sep 2017, 15:05

Hello!

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

lg
wolfgang

wutu
Normal user
Posts: 35
Joined: 05 Feb 2016, 07:33

Re: PCA9685 wiring

#9 Post by wutu » 01 Oct 2017, 13:43

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.

wthiess
New user
Posts: 6
Joined: 29 Jul 2017, 00:53

Re: PCA9685 wiring

#10 Post by wthiess » 03 Oct 2017, 20:02

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

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: PCA9685 wiring

#11 Post by Shardan » 03 Oct 2017, 20:14

+1 for that.

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

wthiess
New user
Posts: 6
Joined: 29 Jul 2017, 00:53

Re: PCA9685 wiring

#12 Post by wthiess » 10 Oct 2017, 09:39

Hallo wutu!

Thank you I made it.
lg
Wolfgang

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest