LiamsGitHub / AS7265x-spectrometer

Python module to drive the SparkFun Triad Spectroscopy Sensor
16 stars 13 forks source link

Using multiple sensors through TCA9548A I2C Multiplexer #3

Open parsaeemojtaba opened 3 years ago

parsaeemojtaba commented 3 years ago

Hi Liam,

Thank you for your code for the AS7265x which helps me a lot. However, I am using your code to run four of this spectrometer through a single Raspberry pi 3 by connecting all sensors to a TCA9548A I2C Multiplexer. But, I cannot figure out how to adjust the addresses to run all sensors. I am a not expert in electronics and coding, and I really need to run all sensors through a single Pi. I use this python script for the Multiplexer (https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A). Could you please help me to run the sensors by adjusting the script? what should I adjust in your script? or in the multiplexer script? I spend so many hours so far and I could not figure it out. Thanks a lot in advance.

KMSC93 commented 4 months ago

Hi, I have successfully used two of these sensors with one Raspberry Pi by using n-channel MOSFETs (part number BUZ11-NR4941) on the data line of each SparkFun TRIAD board to enable and disable each board at will. Since it is not possible to change the I2C address of the TRIAD boards and I didn't have a multiplexer to hand, this was my best solution. It works well. You must dedicate a GPIO pin to each MOSFET to enable and disable it.