Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multi channel SPI sensors using cd74hc4067 or similar muxes #2763

Open
gkasprow opened this issue Jun 16, 2024 · 0 comments
Open

Comments

@gkasprow
Copy link

gkasprow commented Jun 16, 2024

Describe the problem you have/What new integration you would like

Add addressed SPI support
I want to connect many SPI energy/temperature meter ICs to ESP32 with Ethernet. I don't have that many pins.
I use a multiplexer like cd74hc4067 to get many CS signals in such cases.
With such a chip, I need four pins for SPI and four for CS mux, and I can talk to 16 SPI devices.
I can even spare one pin and treat output 0 of cd74hc4067 as none selected and connect 15 devices to remaining outputs 1..14.

Please describe your use case for this integration and alternatives you've tried:

I want to connect 15 or 16 ATM90E26 sensors to ESP32 having Ethernet PHY chip which consumes most of it's pins.

Additional context

I'm willing to design an open hardware platform for such energy/temperature meters.
I authored over 150 OH designs (gkasprow, elhep, sinara-hw repositories)
I designed a nice HW for IotaWatt, but after 2 years of using the original IoTaWatt meter, I experienced several stability issues. The IoTaWatt has been difficult to source recently. That's like I want to switch to ESP Home
Moreover, I'd like to redesign my sensor-box (https://github.com/gkasprow/Sensor-Box/wiki) project to fully support HA features. For the moment I'm running HA on ESPboard with Ethernet and using MODBUS to talk to every module (gkasprow/Sensor-Box#19). But that makes things unnecessarily expensive because I must add a CPU to every device. The idea is to use the same mechanical approach and implement multiplexed SPI. Just make SPI bus running across all the modules and use HC4067 (or a few NAND gates) or dedicated CD74HCT85 as an address decoder. In such way when I want to talk to device no 3, I set the address bus to 0x03 and CS of channel 3 gets active. My ESP32 has most pins consumed by Ethernet chip and multplexed SPI is the simplest option. In practical implementation each sensor modul will have its address DIP switch. I'm willing to design low cost open hardware modules (in Kicad) for energy ICs and other popular chips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant