Need more I/o pins

I am using Nano. I got 6 servos working with PCS9685. I am wondering if we can use the second PCA9685 for 12 LEDs? Also, I need more pin I/O for several RFID. I am wondering if we can use SX1509 for more I/O pins?

The PCA9685 has 16 channels; you are using 6. You appear to have 32 available addresses for these boards so you can certainly use more than one.. What is your actual question?

For what do you propose to use "several RFID"? These are SPI interface, not simple I/O though they can be chained or used in parallel with individual Chip Select.

Note that RFID readers need to be at least 2 ft apart to prevent them loosing sensitivity.

Thanks, I will try to use the second PCA9685 for LEDs. What is the max length for Servos and LED to PCA9685. I was wondering if we can put 5 ft long wire between PCA9685 and Servos and LEDs? I plan to use them for model trains. Also, each track will have RFID.

Caution, if you extend the I2C bus and not do it properly you are asking for problems. They make I2C bus extenders that allow you to do just this, and some to maybe 50 meters maximum. Termination and speed are critical. You can get more reliability by slowing down the I2C, most of the I2C peripherals are not minimum speed limited although all have a maximum, each can be different.

I will try to use the second PCA9685 for LEDs.

Note that you can’t use the same PCA9685 for directly driving a servo and and an LED without inverting the drive signal for one of them.

I got the first PCA9685 working for servos and the second PCA9685 working for LEDs. Now I need more i/o pins for 30- 40 Sensors. I am not sure what kind of sensors should we use for Model train tracks. I would like to see where the train is on the computer screen. I was thinking to use Hall Effect Sensors and put a small magnet under Loco Engine. I have SX1509 but I could not get it working well with several sensors. Is there another better one? I would like to use I2c.

Whatever is wrong with your circuit, a "better" SX1509 wouldn't fix it. Not that there is such a thing.

Why don't you stop being vague and post a schematic? Then we won't be left wondering what model of sensors, how many "several" is or how you wired them.

My suggestion would be to use reed switches. Wire a small signal diode in series with each reed switch. A single sx1509 can scan 64 of them and inform the Arduino if anything changes.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.