Smart Home Automation Forum
KC868-AIO ESP32 I/O pin define - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-AIO (https://www.kincony.com/forum/forumdisplay.php?fid=46)
+--- Thread: KC868-AIO ESP32 I/O pin define (/showthread.php?tid=2735)

Pages: 1 2


KC868-AIO ESP32 I/O pin define - admin - 03-24-2023

ESP32 ANALOG_A1 GPIO36 For (Analog Multiplexer: cd74hc4067) to extend "analog input" 1-16

ESP32 ANALOG_A2  GPIO39  analog input 17
ESP32 ANALOG_A3  GPIO34  analog input 18
ESP32 ANALOG_A4  GPIO35  analog input 19

IIC Bus:A

SDA-A:GPIO4
SCL-A:GPIO16

PCF8575:U40 (output 1-16): 100 100 = 0x24
PCF8575:U41 (output 17-32): 100 101 = 0x25

PCF8575:U42 (output 33-38): 100 110 = 0x26

cd74hc4067
S0-A: PCF8575->U42->P10 (output 33)
S1-B: PCF8575->U42->P11 (output 34)
S2-C: PCF8575->U42->P12 (output 35)
S3-D: PCF8575->U42->P13 (output 36)

free LEDs:

LED-D7: PCF8575->U42->P14 (output 37)
LED-D8: PCF8575->U42->P15 (output 38)
-----------------------------------------------------------------------------------

PCF8575:U35 (input 1-16): 100 001 = 0x21
PCF8575:U37 (input 17-32): 100 010 = 0x22

PCF8575:U38 (input 33-48): 100 011 = 0x23
PCF8575:U42 (input 49-58): 100 110 = 0x26

PCF8575->U42->P0 (input 49)
PCF8575->U42->P1 (input 50)
PCF8575->U42->P2 (input 51)
PCF8575->U42->P3 (input 52)
PCF8575->U42->P4 (input 53)
PCF8575->U42->P5 (input 54)
PCF8575->U42->P6 (input 55)
PCF8575->U42->P7 (input 56)
PCF8575->U42->P14 (input 57)
PCF8575->U42->P15 (input 58)

-----------------------------------------------------------------------------------------

PCA9685: address 0x00
-----------------------------------------------------------------------------------------

Button-S1: reset
Button-S2: GPIO0
Button-S3: PCF8575->U42->P14 (input 57)
Button-S4: PCF8575->U42->P15 (input 58)

-------------------------------------------------------------------------------------------


DS18B20/DHT11/DHT21/LED strip -(TP1): GPIO14
DS18B20/DHT11/DHT21/LED strip -(TP2): GPIO5

-------------------------------------------------------------------------------------------

Ethernet (LAN8720) I/O define:

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN  18
#define ETH_TYPE      ETH_PHY_LAN8720
#define ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT

-------------------------------------------------------------------------------------------

RS485:
RXD(A): GPIO32
TXD(B): GPIO33

------------------------------------------------------------------------------------------

4G GSM Module / Extend serial port:

RXD: GPIO13
TXD: GPIO15

---------------------------------------------------------------------------------------------

DS3231 RTC module: IIC address 0x68
EEPROM's default I2C address is 0x57


RE: KC868-AIO ESP32 I/O pin define - xarouli5 - 03-28-2025

Can gpio05 and gpio14 work at the same time?

I tried on one_wire to define both but accepts one OR the other.

I want dht11 on one pin and DS18b20 on the other.


RE: KC868-AIO ESP32 I/O pin define - admin - 03-29-2025

Do you use KCS firmware or ESPHome?


RE: KC868-AIO ESP32 I/O pin define - xarouli5 - 03-29-2025

Esp home. 

We need two sensors:

(DS18b20) on Tp1 and dht on tp2.

Can both be used at the same time?

How many on each channel using both channels?


RE: KC868-AIO ESP32 I/O pin define - admin - 03-29-2025

sure, you can use two gpio at the same time.
if you using ESPHome, also support one gpio with multi DS18B20 sensors.


RE: KC868-AIO ESP32 I/O pin define - xarouli5 - 03-29-2025

One gpio with many DS18b20 
Also the other gpio with many Dht11?


RE: KC868-AIO ESP32 I/O pin define - admin - 03-29-2025

yes, that according to ESPHome, one gpio can work with multi ds18b20 sensors. But one gpio ONLY work with one DHT11 sensor.


RE: KC868-AIO ESP32 I/O pin define - xarouli5 - 04-14-2025

I have a DS18b20 on GPIO14 and working. Trying to use a Dht11 on GPIO05.

The code I use (try) is:


 #

one_wire:
- platform: gpio
  pin: GPIO14
  id: one_wire1
- platform: gpio
  pin: GPIO05
  id: one_wire2

Sensor 
 - platform: dallas_temp
   name: #AIO DS18B20 #1"
   update_interval: 10s
   one_wire_id: one_wire1

 - platform: dht
    model: DHT11
    one_wire_id: one_wire2
    temperature:
      name: "Temperature2"
    humidity:
      name: "Humidity2"
    update_interval: 10s

#



The error I get is:

INFO ESPHome 2024.12.4
INFO Reading configuration /config/esphome/aio.yaml...
WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
Failed config

sensor.dht: [source /config/esphome/aio.yaml:429]
  
  'pin' is a required option for [sensor.dht].
  platform: dht
  model: DHT11
  
  [one_wire_id] is an invalid option for [sensor.dht]. Please check the indentation.
  one_wire_id: one_wire2
  temperature: 
    name: Temperature2
  humidity: 
    name: Humidity2
  update_interval: 10s


What am I doing wrong? I am using 3.3v for Dht11. Tried 2 different sensors, both same error. 
https://a.aliexpress.com/_EIdTg JK
https://a.aliexpress.com/_EQCKU9Q

(04-14-2025, 07:39 PM)xarouli5 Wrote: I have a DS18b20 on GPIO14 and working. Trying to use a Dht11 on GPIO05.

The code I use (try) is:

 
Code:
one_wire:
- platform: gpio
  pin: GPIO14
  id: one_wire1
- platform: gpio
  pin: GPIO05
  id: one_wire2

Sensor:

- platform: dht
    model: DHT11
    one_wire_id: one_wire2
    temperature:
      name: "Temperature2"
    humidity:
      name: "Humidity2"
    update_interval: 10s

The error I get is:

INFO ESPHome 2024.12.4
INFO Reading configuration /config/esphome/aio.yaml...
WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
Failed config

sensor.dht: [source /config/esphome/aio.yaml:429]
  
  'pin' is a required option for [sensor.dht].
  platform: dht
  model: DHT11
  
  [one_wire_id] is an invalid option for [sensor.dht]. Please check the indentation.
  one_wire_id: one_wire2
  temperature: 
    name: Temperature2
  humidity: 
    name: Humidity2
  update_interval: 10s


What am I doing wrong? I am using 3.3v for Dht11. Tried 2 different sensors, both same error. 
https://a.aliexpress.com/_EIdTg JK
https://a.aliexpress.com/_EQCKU9Q



RE: KC868-AIO ESP32 I/O pin define - admin - 04-14-2025

you can update your esphome to 2025.3
now the one wire sensor yaml format have changed, you can check with esphome webpage.


RE: KC868-AIO ESP32 I/O pin define - xarouli5 - 04-15-2025

For any other looking the same:

The problem was not the version of ESPHome, though I updated had the same error as before. 

The code working:

#

one_wire:
- platform: gpio
  pin: GPIO14
  id: one_wire1
- platform: gpio
  pin: GPIO05
  id: one_wire2
#no need to define one_wire2 for a reason I don't understand but it works like this. #

Sensor
- platform: dallas_temp
  name: #AIO DS18B20 #1"
  update_interval: 10s
  one_wire_id: one_wire1

- platform: dht
    pin: GPIO05 
    temperature:
      name: "Temperature DHT11"
    humidity:
      name: "Humidity DHT11"
    update_interval: 60s

#