Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,418
» Latest member: 8xbet71live
» Forum threads: 4,322
» Forum posts: 21,300

Full Statistics

Online Users
There are currently 134 online users.
» 0 Member(s) | 117 Guest(s)
AwarioBot, Baidu, Bytespider, Crawl, PetalBot, bot

Latest Threads
KC868-A4 – Relay 1 clicks...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 11:58 PM
» Replies: 3
» Views: 25
⚡ 40 Buttons, 36 Lighting...
Forum: DIY Project
Last Post: lulu01
Yesterday, 07:34 PM
» Replies: 24
» Views: 2,947
[arduino code examples fo...
Forum: CO16
Last Post: admin
Yesterday, 03:04 AM
» Replies: 0
» Views: 7
[arduino code examples fo...
Forum: CO16
Last Post: admin
Yesterday, 01:34 AM
» Replies: 0
» Views: 12
[arduino code examples fo...
Forum: CO16
Last Post: admin
Yesterday, 12:15 AM
» Replies: 0
» Views: 15
450 Hz allowed on input?
Forum: Development
Last Post: admin
11-02-2026, 09:41 PM
» Replies: 3
» Views: 31
How Do You Handle Relay C...
Forum: KC868-A6
Last Post: lulu01
11-02-2026, 05:41 PM
» Replies: 2
» Views: 34
"KCS" v3.27.4 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
11-02-2026, 06:02 AM
» Replies: 0
» Views: 55
how to check i2c extend c...
Forum: T16M
Last Post: admin
11-02-2026, 12:38 AM
» Replies: 0
» Views: 15
T16M ESPHome yaml for hom...
Forum: T16M
Last Post: admin
11-02-2026, 12:35 AM
» Replies: 0
» Views: 12

  F16 ESPHome yaml for home assistant without tuya
Posted by: admin - 01-21-2025, 12:15 AM - Forum: F16 - No Replies

Code:
esphome:
  name: f16
  friendly_name: f16

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
   
# Enable logging

  # hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
  encryption:
    key: "WeVOuL5oNhjXcfzXtTirlOwvtWvCD5yqIxd3oV4es1k="

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO43
  miso_pin: GPIO44
  cs_pin: GPIO41
  interrupt_pin: GPIO2
  reset_pin: GPIO1

i2c:
   - id: bus_a
     sda: 8
     scl: 18
     scan: true
     frequency: 400kHz

pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-16
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_in_1'  # for input channel 1-16
    i2c_id: bus_a
    address: 0x24
    pcf8575: true

uart:
  - id: uart_1    #RS485
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 16
    rx_pin: 17

switch:
  - platform: uart
    uart_id: uart_1
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: gpio
    name: "f16-output01"
    id: "f16_output01"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output02"
    id: "f16_output02"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output03"
    id: "f16_output03"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output04"
    id: "f16_output04"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output05"
    id: "f16_output05"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output06"
    id: "f16_output06"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output07"
    id: "f16_output07"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output08"
    id: "f16_output08"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output09"
    id: "f16_output09"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output10"
    id: "f16_output10"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output11"
    id: "f16_output11"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output12"
    id: "f16_output12"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output13"
    id: "f16_output13"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output14"
    id: "f16_output14"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output15"
    id: "f16_output15"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f16-output16"
    id: "f16_output16"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true

binary_sensor:
  - platform: gpio
    name: "f16-input01"
    id: "f16_input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input02"
    id: "f16_input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input03"
    id: "f16_input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input04"
    id: "f16_input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input05"
    id: "f16_input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input06"
    id: "f16_input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input07"
    id: "f16_input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input08"
    id: "f16_input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input09"
    id: "f16_input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input10"
    id: "f16_input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input11"
    id: "f16_input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input12"
    id: "f16_input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input13"
    id: "f16_input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input14"
    id: "f16_input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input15"
    id: "f16_input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f16-input16"
    id: "f16_input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true

##pull-up resistance on PCB
  - platform: gpio
    name: "f16-W1-io48"
    pin:
      number: 48
      inverted: true

  - platform: gpio
    name: "f16-W1-io47"
    pin:
      number: 47
      inverted: true

  - platform: gpio
    name: "f16-W1-io21"
    pin:
      number: 21
      inverted: true

  - platform: gpio
    name: "f16-W1-io15"
    pin:
      number: 15
      inverted: true
## without resistance on PCB
  - platform: gpio
    name: "f16-W1-io13"
    pin:
      number: 13
      inverted: false

  - platform: gpio
    name: "f16-W1-io14"
    pin:
      number: 14
      inverted:  false

  - platform: gpio
    name: "f16-433M"
    pin:
      number: 40
      inverted:  false

sensor:
  - platform: adc
    pin: 5
    name: "F16 A1 Voltage"
    update_interval: 5s
    attenuation: 11db
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 7
    name: "F16 A2 Voltage"
    update_interval: 5s
    attenuation: 11db
    filters:
      # - multiply: 1.51515
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 6
    name: "F16 A3 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 4
    name: "F16 A4 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

web_server:
  port: 80

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

display:
  - platform: ssd1306_i2c
    i2c_id: bus_a
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "KinCony F16");
yaml download: 
.txt   F16-HA-without-Tuya.txt (Size: 8.48 KB / Downloads: 555)

Print this item

  Need help in designing a system for my project
Posted by: moosejam - 01-20-2025, 11:03 PM - Forum: DIY Project - Replies (5)

Hi,

I came across your Youtube channel and was wondering if you would help me design a solution for my Off Grid Expedition Camper Truck.

I would like to monitor and ultimately control all items via Alex Hub.

I am currently in the process of building the vehicle and all electrics are going to be supplied using Victron System (Inverter), via Batteries/Solar/240V hook up.

The system will have a 240V AC requirement with 17 Circuit Breakers and a 12V Circuit with 36 fused (Spade type or can be railed DC Breakers).

Is this something you can help with?

I wait your reply.

Many Thanks

Dion Mack

Print this item

  kc868 M16-V2
Posted by: athxp - 01-20-2025, 09:03 PM - Forum: KC868-M16 / M1 / MB / M30 - Replies (19)

hi, i would be interested in using kc868 M16-V2 with home assistant. but i would need to know the power of each channel (and not the current) can the board calculate it for each channel?

Print this item

  Remove Tuya of ESPHome
Posted by: Fernando_FSF - 01-20-2025, 05:31 PM - Forum: DIY Project - Replies (3)

Good afternoon, I have a Kincony F16 and I am interested in removing Tuya from the .yaml file and keeping only ESPHome. I do it another way to connect from outside the home and I don't need Tuya. Could you tell me exactly what I have to remove so that nothing remains of  en el archivo .yaml "F16-HA.txt". I'm afraid I won't be able to connect if I delete something by mistake. Thank you.

Print this item

  T16M ESPHome yaml for home assistant by PCF8575 chip
Posted by: admin - 01-20-2025, 08:29 AM - Forum: T16M - Replies (7)

Code:
esphome:
  name: t16m
  friendly_name: t16m

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO43
  miso_pin: GPIO44
  cs_pin: GPIO41
  interrupt_pin: GPIO2
  reset_pin: GPIO1

i2c:
   - id: bus_a
     sda: 11
     scl: 12
     scan: true
     frequency: 400kHz

pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-16
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_in_1'  # for input channel 1-16
    i2c_id: bus_a
    address: 0x24
    pcf8575: true

uart:
  - id: uart_1    #RS485
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 13
    rx_pin: 14

switch:
  - platform: uart
    uart_id: uart_1
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: gpio
    name: "t16m-output01"
    id: "t16m_output01"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output02"
    id: "t16m_output02"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output03"
    id: "t16m_output03"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output04"
    id: "t16m_output04"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output05"
    id: "t16m_output05"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output06"
    id: "t16m_output06"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output07"
    id: "t16m_output07"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output08"
    id: "t16m_output08"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output09"
    id: "t16m_output09"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output10"
    id: "t16m_output10"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output11"
    id: "t16m_output11"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output12"
    id: "t16m_output12"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output13"
    id: "t16m_output13"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output14"
    id: "t16m_output14"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output15"
    id: "t16m_output15"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "t16m-output16"
    id: "t16m_output16"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true

binary_sensor:
  - platform: gpio
    name: "t16m-input01"
    id: "t16m_input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input02"
    id: "t16m_input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input03"
    id: "t16m_input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input04"
    id: "t16m_input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input05"
    id: "t16m_input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input06"
    id: "t16m_input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input07"
    id: "t16m_input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input08"
    id: "t16m_input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input09"
    id: "t16m_input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input10"
    id: "t16m_input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input11"
    id: "t16m_input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input12"
    id: "t16m_input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input13"
    id: "t16m_input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input14"
    id: "t16m_input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input15"
    id: "t16m_input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "t16m-input16"
    id: "t16m_input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true

##pull-up resistance on PCB
  - platform: gpio
    name: "t16m-W1-io8"
    pin:
      number: 8
      inverted: true

  - platform: gpio
    name: "t16m-W1-io9"
    pin:
      number: 9
      inverted: true

  - platform: gpio
    name: "t16m-W1-io10"
    pin:
      number: 10
      inverted: true

  - platform: gpio
    name: "t16m-W1-io15"
    pin:
      number: 15
      inverted: true

  - platform: gpio
    name: "t16m-W1-io16"
    pin:
      number: 16
      inverted: false

  - platform: gpio
    name: "t16m-W1-io17"
    pin:
      number: 17
      inverted:  false

  - platform: gpio
    name: "t16m-W1-io18"
    pin:
      number: 18
      inverted:  false

  - platform: gpio
    name: "t16m-io0"
    pin:
      number: 0
      inverted:  false

web_server:
  port: 80
download yaml file:
.txt   T16M-HA.txt (Size: 7.27 KB / Downloads: 722)
   

Print this item

  T16M ESP32-S3 IO pins define
Posted by: admin - 01-20-2025, 08:28 AM - Forum: T16M - No Replies

IIC Bus:

SDA:GPIO11
SCL:GPIO12

PCF8575/XL9555:U22 (output1-16): i2c address:0x25

PCF8575/XL9555:U17 (input1-16): i2c address:0x24

Note: after 2026-11-01 KinCony begin use XL9555 i2c extend chip. you can use KCS v3 "SYSTEM" webpage to scan device show the model or config by ESPHome to scan i2c bus, will find the chip model.

   


24C02 EPROM i2c address: 0x50

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

1-wire (pull-up resistance on PCB):
1-wire1:GPIO8
1-wire2:GPIO9
1-wire3:GPIO10
1-wire4:GPIO15
1-wire5:GPIO16
1-wire6:GPIO17
1-wire7:GPIO18

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

Ethernet (W5500) I/O define:

clk_pin: GPIO42
mosi_pin: GPIO43
miso_pin: GPIO44
cs_pin: GPIO41

interrupt_pin: GPIO2
reset_pin: GPIO1

--------------------
RS485:
RXD:GPIO14
TXD:GPIO13

Print this item

  Questions about Analog Inputs KC868-A16
Posted by: Decilitr - 01-19-2025, 08:00 PM - Forum: KC868-A16 - Replies (9)

Hi all!
I received my KC868-A16 board and now experimenting with it. My goal is to use it for Home Assistant.
Digital inputs and outputs work fine, but there are some confusing points with analog inputs.
I would appreciate clarification.

1. I used the lines from the example .yaml file and it turned out that because of the lines
------------------------------------
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
------------------------------------
the measured voltage values were greatly inflated. So I removed these lines from my .yaml file and the voltage values became correct.
What were these lines in the original example for anyway?

2. When the same voltage is applied simultaneously to all four analog inputs, the spread of readings between them is no more than 5%. This is very good accuracy, but can it be increased by changing the parameter "attenuation: 11db" ?

3. When connecting each of the analog inputs to ground, the voltage value is not 0V but 0.14V
Is there any way to fix this?

4. And the main problem. When the input voltage changes from minimum to 3.14V, its value is displayed correctly. However, when the input voltage increases from 3.14V to 5V, it stops changing and always shows 3.14V, which is obviously wrong.
What is the problem here?

Print this item

  analog input resolution 30%erro
Posted by: jltluc57 - 01-19-2025, 10:39 AM - Forum: KC868-A16 - Replies (16)

Hello

Can you tell me the resolution on the analog inputs.
Because for 1.5v in I visualize 2.01v which is 30% error..
That's a lot

Board A16



Attached Files Image(s)
       
Print this item

  NTP not update
Posted by: jltluc57 - 01-19-2025, 09:25 AM - Forum: KC868-A16 - Replies (22)

Hello

i have a problem with the NFP, in fact impossible to have a correct display with the right time zone.
What is the reading cycle of the NTP server?


The internet connection is good.
This NTP server works well on all my computers

The capture 3 is the time of my computer

Regards



Attached Files Image(s)
           
Print this item

  [arduino code examples for T16M]-06 digital INPUT trigger OUTPUT directly
Posted by: admin - 01-19-2025, 02:15 AM - Forum: T16M - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program reads 16 input states from a PCF8575 I/O expander and
* controls a corresponding 16-channel relay module. When an input pin
* is LOW, the corresponding relay is turned ON (LOW means ON for the relay).
* When the input pin is HIGH, the corresponding relay is turned OFF.
*
* Pin Definitions:
* - SDA: GPIO 11
* - SCL: GPIO 12
* - Input I2C Address: 0x24
* - Relay I2C Address: 0x25
*/

#include <Wire.h>        // I2C communication
#include <PCF8575.h>     // Library to control the PCF8575 I/O expander

// Define I2C pins
#define SDA 11           // SDA pin
#define SCL 12           // SCL pin

// I2C addresses
#define INPUT_I2C_ADDRESS 0x24   // I2C address for the input PCF8575 module
#define RELAY_I2C_ADDRESS 0x25   // I2C address for the relay PCF8575 module

PCF8575 pcf8575_IN(INPUT_I2C_ADDRESS);    // Create an object for the input PCF8575
PCF8575 pcf8575_RL(RELAY_I2C_ADDRESS);    // Create an object for the relay PCF8575

void setup() {
  // Initialize I2C communication
  Wire.begin(SDA, SCL);
 
  // Initialize serial communication
  Serial.begin(115200);
 
  // Initialize input and relay modules
  pcf8575_IN.begin();
  pcf8575_RL.begin();
 
  // Turn off all relays at the start
  for (int i = 0; i < 16; i++) {
    pcf8575_RL.write(i, LOW);  // Assuming relays are LOW when OFF, setting all relays to OFF initially
  }
 
  Serial.println("System started: Input state controlling 16 relays");
}

void loop() {
  uint16_t inputState = 0;

  // Read the state of 16 inputs
  for (int i = 0; i < 16; i++) {
    if (pcf8575_IN.read(i)) {
      inputState |= (1 << i);  // If input is HIGH, set the corresponding bit
    } else {
      inputState &= ~(1 << i); // Otherwise, clear the corresponding bit
    }
  }
 
  // Control the relays based on the input state
  for (int i = 0; i < 16; i++) {
    if (inputState & (1 << i)) {
      pcf8575_RL.write(i, HIGH);  // If input is HIGH, turn the relay OFF
    } else {
      pcf8575_RL.write(i, LOW);   // If input is LOW, turn the relay ON
    }
  }

  // Delay for 500 milliseconds
  delay(500);
}
arduino ino file download: 
.zip   6-input-trigger-output.zip (Size: 1.02 KB / Downloads: 771)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
.zip   6-input-trigger-output.ino.merged.zip (Size: 189.39 KB / Downloads: 796)

Print this item