Design Opinion Req: IR Receiver as an I2C slave
Posted: Mon Dec 13, 2021 1:20 pm
I am thinking of using some ATTiny84's as I2C slaves for a series of sensor clusters with the ESP32 as the master. Part of those clusters include an IR Rx TSOP. The reason I am thinking of using the ATtiny and I2C is to simplify the cabling between sensors and also make them expandable to allow me to add a few more sensor clusters easily. (4 wire cable runs that allow me to daisy chain sensor clusters)
The intent of the cluster is to be able to tell which cluster received properly encoded data so I can deduce the direction of the signal as well as control other things at that sensor like a series of PWM controlled RGBW LEDs.
My question is around the concept of polling the I2C slaves for IR data from the ESP32 I2C master. I haven't found many projects where IR rx are being used as slaves so I want to make sure this is a sound concept before proceeding. My only alternative is to do a home run wire from each sensor back to the ESP32 and use it's channels to receive all of the IR. This makes my wiring bundles a little less clean and I am limited to the 8 channels available on the ESP (should be enough, but mainly want to keep wiring clean).
I found this project for inspiration on the AtTiny:
https://github.com/fotisl/ir2i2c
I know I can poll the I2C pretty rapidly. I am a little concerned that it may be difficult to deduce the order that the signals are received by the clusters. Perhaps I need to include a value similar to millis() in the I2C traffic to indicate when the signal was processed to help the master determine which cluster received data first?
Any links to similar efforts or wise words on the concept of the solution would be valued.
Thanks!
The intent of the cluster is to be able to tell which cluster received properly encoded data so I can deduce the direction of the signal as well as control other things at that sensor like a series of PWM controlled RGBW LEDs.
My question is around the concept of polling the I2C slaves for IR data from the ESP32 I2C master. I haven't found many projects where IR rx are being used as slaves so I want to make sure this is a sound concept before proceeding. My only alternative is to do a home run wire from each sensor back to the ESP32 and use it's channels to receive all of the IR. This makes my wiring bundles a little less clean and I am limited to the 8 channels available on the ESP (should be enough, but mainly want to keep wiring clean).
I found this project for inspiration on the AtTiny:
https://github.com/fotisl/ir2i2c
I know I can poll the I2C pretty rapidly. I am a little concerned that it may be difficult to deduce the order that the signals are received by the clusters. Perhaps I need to include a value similar to millis() in the I2C traffic to indicate when the signal was processed to help the master determine which cluster received data first?
Any links to similar efforts or wise words on the concept of the solution would be valued.
Thanks!