PCA 9685 Expander

Dewd

Member
Hi.  Just checking if I'm understanding things correctly.

If using the PCA9685 Expander, does it allow you to use :-

4 x Power Bars 
or
3 x Power Bars and 1 x Reef-Pi Extension (6+2)
or 
2 x Power Bars and 2 x Reef-Pi Extension (6+2)

Or any other combination of the above you might see fit?

If so, I think this is an absolute game changer.
 
Hi Des, yeah you're right but one thing to note is the pca9685 expander only has outputs, if an extension was plugged into it only the DC ports would work. This means currently only two extensions are fully supported and the power bars would plug into the pca9685 expander. You can daisy chain the expanders as well so more than 2 power bars could be used. The max limit of sensors is 18.
 
Currently I have enough sensors. What I would like is to add a universal Power bar to make a total of 3 Power Bars.

So could I have 2 x Universal Power Bars on the Power 1 and 2 Ports on the controller and then a pca9685 expander on the I2C port with 1 x Power Bar and possibly one of the extensions if I really found that necessary?
 
Dom59 said:
Hi Rob,
I am not sure I understand...  could you show the fitting of  PCA9685 Expander and extension? Also how to setup the new sensors and DC ports?

Dom.

Hi Dom, here's something I wrote up going through the steps. The extensions need to plug into a controller DB9 and you plug the power bars into the PCA9685 expander.

PCA9685 expander
  • Connect to I2C port on controller. You’ll need to remove the lid from expander so you can see which pin is SCL, SDA, +5v and GND. The header pins and green connector on back of expander are the same.
  • Once connected run i2cdetect -y 1 in the Raspberry Pi terminal window, it should print a list with 4 numbers, one of them should be 50. If so you are good to continue as the controller sees the expander. 
  • In reef-pi you need to create a driver for pca9685 expander, go to configuration -> driver tab, you'll see one named "extra ports" you need to add another like that except use address 80, you can name it Expander 1 or something.
  • Now go to configuration -> admin tab and press the “reload” button.
  • Now you need to remove any outlets you might be controlling through timers, ATO, or macros. For example if you have a timer for outlet 5 you need to delete the timer or remove the outlet from timer so it’s not pointing to it, same with everything else. If you change “control” to nothing on all these it should be ok and when you get things finished you can go back to these and select the devices to control.
  • Now you need to delete all 16 outlets from the "equipment" tab. If you have a chart on the home page for outlets delete that first.
  • Then you need to go to configuration -> connectors and edit all the connectors for the power bar outlets, should be 16 of them. When you edit them change the driver for each outlet from Raspberry Pi to the new driver you created for the pca9685 expander. Then change the pin number, you should have 0-15 to choose from. Here’s how you configure them.
Power Bar 1 – Outlet 1 =  0
Power Bar 1 – Outlet 2 =  1
Power Bar 1 – Outlet 3 =  2
Power Bar 1 – Outlet 4 =  3
Power Bar 1 – Outlet 5 =  4
Power Bar 1 – Outlet 6 =  5
Power Bar 1 – Outlet 7 =  6
Power Bar 1 – Outlet 8 =  7

Power Bar 2 – Outlet 1 =  8
Power Bar 2 – Outlet 2 =  9
Power Bar 2 – Outlet 3 =  10
Power Bar 2 – Outlet 4 =  11
Power Bar 2 – Outlet 5 =  12
Power Bar 2 – Outlet 6 =  13
Power Bar 2 – Outlet 7 =  14
Power Bar 2 – Outlet 8 =  15
  • When finished go to configuration -> admin tab and press the “reload” button.
  • Now you need to add all 16 outlets again to the “equipment” tab and after this you can put back pointers to timers, ATO and macros that you may use.
  • That should be it for the expander and both power bars should be working again.

Extension – 6 DC, 2 Sensors
  • First you want to add connectors, go to configuration -> connectors tab and add “outlet” connectors for DC ports and “inlet” connectors for sensor ports, you’ll need 6 and 2 respectively. For driver you use the “Raspberry Pi” and these are the pin numbers for each port.
DC 6 =  9
DC 5 =  10
DC 4 =  22
DC 3 =  15
DC 2 =  14
DC 1 =  23
Sensor 1 =  24
Sensor 2 =  25
  • Now go to configuration -> admin tab and press the “reload” button.
  • Now these are ready to add to “equipment” tab and “ATO” tab.
Extension – 2 DC, 6 Sensors
  • First you want to add connectors, go to configuration -> connectors tab and add “outlet” connectors for DC ports and “inlet” connectors for sensor ports, you’ll need 2 and 6 respectively. For driver you use the “Raspberry Pi” and these are the pin numbers for each port.
Sensor 6 =  16
Sensor 5 =  6
Sensor 4 =  5
Sensor 3 =  7
Sensor 2 =  11
Sensor 1 =  8
DC 1 =  12
DC 2 =  13
  • Now go to configuration -> admin tab and press the “reload” button.
  • Now these are ready to add to “equipment” tab and “ATO” tab.
 
Hello @Rob F, I ran across this thread while trying to figure out how to setup my PCA9685. When I run the i2cdetect -y 1 command it doesn’t include a “50” as you mentioned in your third post here. How do I fix this or what should I do moving foward? I’m running two power bars and one 6DC/2sensor and one 2DC/6sensor. Power bars connect to the PCA9685. I’m a novice at this so please excuse my ignorance if this is a simple fix. I couldn’t find any documentation on the website for the PCA9685 expander. I have attached a screen shot to show what I’m seeing.

IMG_0969.png
 
Hello @Rob F, I ran across this thread while trying to figure out how to setup my PCA9685. When I run the i2cdetect -y 1 command it doesn’t include a “50” as you mentioned in your third post here. How do I fix this or what should I do moving foward? I’m running two power bars and one 6DC/2sensor and one 2DC/6sensor. Power bars connect to the PCA9685. I’m a novice at this so please excuse my ignorance if this is a simple fix. I couldn’t find any documentation on the website for the PCA9685 expander. I have attached a screen shot to show what I’m seeing.

View attachment 784
Hi @DylanF1 it's not showing up in that list, 40/70 is the onboard pca9685, 63 is the pH and 68 is the RTC. I wonder if you have an older board where the default I2C address is the same as the onboard. On the left side of the board do you see some solder pads lined up? Is one of these soldered shut? If not I hope you have a soldering iron and can solder any one of them, that will change the address. After that you should see a 5th number when you scan the I2C.
 
Hi @DylanF1 it's not showing up in that list, 40/70 is the onboard pca9685, 63 is the pH and 68 is the RTC. I wonder if you have an older board where the default I2C address is the same as the onboard. On the left side of the board do you see some solder pads lined up? Is one of these soldered shut? If not I hope you have a soldering iron and can solder any one of them, that will change the address. After that you should see a 5th number when you scan the I2C.
A5 is soldered shut on the board I have. Does each set of contacts relate to a different address?

IMG_4320.jpeg
 
Hi @DylanF1 it's not showing up in that list, 40/70 is the onboard pca9685, 63 is the pH and 68 is the RTC. I wonder if you have an older board where the default I2C address is the same as the onboard. On the left side of the board do you see some solder pads lined up? Is one of these soldered shut? If not I hope you have a soldering iron and can solder any one of them, that will change the address. After that you should see a 5th number when you scan the I2C.
A5 is soldered shut on the board I have. Does each set of contacts relate to a different address?

View attachment 787
 
A5 is soldered shut on the board I have. Does each set of contacts relate to a different address?

View attachment 787
That looks ok, different combinations does change the address. On that board I soldered the pca9685, maybe some pins are shorted or I cooked it. Does the LED on board light up when you connect it? Either way I think I'll have to send you another one.
 
That looks ok, different combinations does change the address. On that board I soldered the pca9685, maybe some pins are shorted or I cooked it. Does the LED on board light up when you connect it? Either way I think I'll have to send you another one.
Rob, do you need anything from me to get the replacement unit sent out?
 
Rob, do you need anything from me to get the replacement unit sent out?
Sorry for the delay. I did find your order using the email you have registered on the forum so I have what I need, I'll send you an email just to be sure. I should get it shipped on Friday, I'll be sure to send the tracking number then.
 
Back
Top