esphome / esphome/feature-requests

support for multi channel SPI sensors using cd74hc4067 or similar muxes

Open
#2,763 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**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](https://esphome.io/components/sensor/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](https://github.com/boblemaire/IoTaWatt/issues/345), 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 (https://github.com/gkasprow/Sensor-Box/issues/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.

Contributor guide

No contributing guide indexed for this repository

Research direction

The request names no files, tests, or entry points. Start by reading the existing ATM90E26 and SPI component implementations; done means supporting selection of 15 or 16 devices through a CD74HC4067-like multiplexer on ESP32.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.