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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,575
» Latest member: e.montolivo@gmail.com
» Forum threads: 2,918
» Forum posts: 15,487

Full Statistics

Online Users
There are currently 19 online users.
» 0 Member(s) | 8 Guest(s)
Amazonbot, Bing, Crawl, PetalBot, WordPress/, bot, owler

Latest Threads
M30 negative power
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
17 minutes ago
» Replies: 1
» Views: 1
KC868-M16v2 configure yam...
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
20 minutes ago
» Replies: 44
» Views: 5,310
Simulating RF Remote Butt...
Forum: KC868-A16
Last Post: admin
21 minutes ago
» Replies: 1
» Views: 1
Fatal error while uploadi...
Forum: KC868-A16
Last Post: admin
22 minutes ago
» Replies: 6
» Views: 4,912
ESP32S3 Chip efuse check ...
Forum: "KCS" v3 firmware
Last Post: admin
24 minutes ago
» Replies: 3
» Views: 9
KC868-A16 analog input
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
24 minutes ago
» Replies: 1
» Views: 39
A32pro RGB led strip
Forum: DIY Project
Last Post: admin
27 minutes ago
» Replies: 1
» Views: 7
KC868-A16 rev. 1.6 firmwa...
Forum: "KCS" v2 firmware system
Last Post: jollyroger
6 hours ago
» Replies: 2
» Views: 19
M30 negative power
Forum: KC868-M16 / M1 / MB / M30
Last Post: Linus68
Yesterday, 11:35 AM
» Replies: 0
» Views: 1
BM16 Problems
Forum: B16M
Last Post: admin
Yesterday, 08:25 AM
» Replies: 1
» Views: 7

  [arduino code examples for B16]-04 RS485 communication test
Posted by: admin - 02-22-2025, 02:01 AM - Forum: B16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* RS485 Communication Test
*
* This program is a simple test for RS485 communication using ESP32-S3.
* It will send a message over RS485 and then read incoming messages.
* The TXD pin is defined as GPIO 18 and RXD pin is defined as GPIO 8.
*/

#include <HardwareSerial.h>

// Define RS485 pins
#define RS485_RXD 38
#define RS485_TXD 39

// Create a hardware serial object
HardwareSerial rs485Serial(1);

void setup() {
  // Start serial communication for debugging
  Serial.begin(115200);
  while (!Serial);

  // Initialize RS485 Serial communication
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);
 
  Serial.println("RS485 Test Start");
}

void loop() {
  // Send a test message
  rs485Serial.println("Hello from KinCony B16!");

  // Wait for a short period
  delay(1000);

  // Check if data is available to read
  if (rs485Serial.available()) {
    String receivedMessage = "";
    while (rs485Serial.available()) {
      char c = rs485Serial.read();
      receivedMessage += c;
    }
    // Print the received message
    Serial.print("Received: ");
    Serial.println(receivedMessage);
  }

  // Wait before sending the next message
  delay(2000);
}
arduino ino file download: 

.zip   4-RS485-Test.zip (Size: 763 bytes / Downloads: 29)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   4-RS485-Test.ino.merged.zip (Size: 184.34 KB / Downloads: 31)

Print this item

  [arduino code examples for B16]-03 Read ADS1115 analog input ports value
Posted by: admin - 02-22-2025, 01:58 AM - Forum: B16 - No Replies

Code:
/*
* This program reads voltage values from the ADS1115 analog-to-digital converter
* on all four channels (A0, A1, A2, A3) and prints the results through the serial port.
* The ADS1115 communicates via the I2C protocol. This version of the code includes
* the capability to specify custom SDA and SCL pins for I2C communication.
*
* Copyright: Made by KinCony IoT: https://www.kincony.com
*
*/

#include <Wire.h>                // Library for I2C communication
#include <DFRobot_ADS1115.h>     // Library for ADS1115 ADC module

// Define the I2C SDA and SCL pins for communication with ADS1115
#define SDA_PIN 8 
#define SCL_PIN 18

// Initialize ADS1115 instance using the Wire library
DFRobot_ADS1115 ads(&Wire);

void setup(void)
{
    // Begin serial communication at a baud rate of 115200
    Serial.begin(115200);

    // Initialize the I2C bus using the defined SDA and SCL pins
    Wire.begin(SDA_PIN, SCL_PIN);

    // Set the I2C address for the ADS1115 (default: 0x49)
    ads.setAddr_ADS1115(ADS1115_IIC_ADDRESS0);   // Address is 0x49

    // Set the gain for the ADS1115 (2/3x gain allows for a maximum input voltage of 6.144V)
    ads.setGain(eGAIN_TWOTHIRDS);

    // Set the ADS1115 to operate in single-shot mode (each reading is a single conversion)
    ads.setMode(eMODE_SINGLE);

    // Set the sample rate to 128 samples per second (SPS)
    ads.setRate(eRATE_128);

    // Set the operational status mode to single-conversion start
    ads.setOSMode(eOSMODE_SINGLE);

    // Initialize the ADS1115 module
    ads.init();
}

void loop(void)
{
    // Check if the ADS1115 is properly connected and functioning
    if (ads.checkADS1115())
    {
        // Variables to store the voltage readings for each channel
        int16_t adc0, adc1, adc2, adc3;

        // Read the voltage from channel A0 and print the value
        adc0 = ads.readVoltage(0);
        Serial.print("A0:");
        Serial.print(adc0);
        Serial.print("mV,  ");    // Print the value in millivolts

        // Read the voltage from channel A1 and print the value
        adc1 = ads.readVoltage(1);
        Serial.print("A1:");
        Serial.print(adc1);
        Serial.print("mV,  ");    // Print the value in millivolts

        // Read the voltage from channel A2 and print the value
        adc2 = ads.readVoltage(2);
        Serial.print("A2:");
        Serial.print(adc2);
        Serial.print("mV,  ");    // Print the value in millivolts

        // Read the voltage from channel A3 and print the value
        adc3 = ads.readVoltage(3);
        Serial.print("A3:");
        Serial.print(adc3);
        Serial.println("mV");     // Print the value in millivolts and end the line
    }
    else
    {
        // If ADS1115 is not connected, print a message indicating disconnection
        Serial.println("ADS1115 Disconnected!");
    }

    // Wait for 1 second before the next loop iteration
    delay(1000);
}
arduino ino file download: 

.zip   3-ads1115_adc.zip (Size: 1.2 KB / Downloads: 34)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   3-ads1115_adc.ino.merged.zip (Size: 190.05 KB / Downloads: 43)

Print this item

  [arduino code examples for B16]-02 Read digital input ports state
Posted by: admin - 02-22-2025, 01:57 AM - Forum: B16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads the state of a 16-channel PCF8575 I/O expander
* and prints the state of all input pins to the Serial Monitor. The state of
* each pin is represented as a bit in a 16-bit value, where each bit corresponds
* to an input pin. The program prints the input state in binary format.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
* - PCF8575 I2C Address: 0x24
*/

#include "Arduino.h"
#include "PCF8575.h"

// Define I2C pins
#define I2C_SDA 8  // Define SDA pin
#define I2C_SCL 18  // Define SCL pin

// Set I2C address
PCF8575 pcf8575_IN1(0x24); // The I2C address of the PCF8575

void setup() {
    Serial.begin(115200);

    // Initialize I2C communication
    Wire.begin(I2C_SDA, I2C_SCL); // Initialize I2C with defined SDA and SCL pins

    pcf8575_IN1.begin(); // Initialize the PCF8575

    Serial.println("KinCony F16 16 channel input state 0:ON  1:OFF");
}

void loop() {
    uint16_t state = 0;

    // Read the state of each pin (assuming 16 pins)
    for (int pin = 0; pin < 16; pin++) {
        if (pcf8575_IN1.read(pin)) {
            state |= (1 << pin); // Set the bit for the active pin
        }
    }

    Serial.print("Input state: ");
    Serial.println(state, BIN); // Print the state of inputs in binary

    delay(500); // Delay 500ms
}
arduino ino file download:

.zip   2-digital-input.zip (Size: 837 bytes / Downloads: 30)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   2-digital-input.ino.merged.zip (Size: 189.52 KB / Downloads: 30)

Print this item

  [arduino code examples for B16]-01 Turn ON/OFF OUTPUT
Posted by: admin - 02-22-2025, 01:56 AM - Forum: B16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program controls a 16-channel relay board via a PCF8575 I/O expander.
* It sequentially turns on each relay and then turns them off in a loop.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
*
* Delay Time:
* - 200 milliseconds between switching relays
*/

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

#define SDA 8           // Define the SDA pin
#define SCL 18           // Define the SCL pin
#define DELAY_TIME 200   // Define the delay time in milliseconds

// Set I2C address of the PCF8575 module
#define I2C_ADDRESS 0x22 // I2C address of the PCF8575 module

PCF8575 pcf8575_R1(I2C_ADDRESS); // Create a PCF8575 object with the specified I2C address

void setup() {
  // Initialize I2C communication
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)
 
  // Initialize serial communication for debugging (optional)
  Serial.begin(115200);
  Serial.println("PCF8575 Relay Control: Starting...");

  // Initialize the PCF8575 module
  pcf8575_R1.begin();

  // Turn off all relays initially (set all pins HIGH)
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, HIGH); // Set all relays to OFF (assuming HIGH means OFF for relays)
  }
}

void loop() {
  // Sequentially turn on each relay
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, LOW);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // Sequentially turn off each relay
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }
}
arduino ino file download:

.zip   1-output.zip (Size: 926 bytes / Downloads: 27)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   1-output.ino.merged.zip (Size: 189.23 KB / Downloads: 30)

Print this item

  B16 ESPHome yaml for home assistant with tuya
Posted by: admin - 02-22-2025, 01:53 AM - Forum: B16 - No Replies

Code:
esphome:
  name: b16
  friendly_name: b16
  platformio_options:
    board_build.extra_flags:
      # WIFI_CONTROL_SELF_MODE = 0
      # WIFI_CONTROL_SELF_MODE = 1
      - "-DWIFI_CONTROL_SELF_MODE=1"
esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
   
   
   

external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu
      ref: v1.1.0

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

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

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: 0x22
    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: 39
    rx_pin: 38

  - id: tuya_mcu_uart
    tx_pin: GPIO16
    rx_pin: GPIO17
    baud_rate: 9600

tuya_wifi_mcu:
  # tuya mcu product id
  product_id: byxtsco8rwt4x8km
  uart_id: tuya_mcu_uart
  wifi_reset_pin: 28
  wifi_led_pin: 16

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

  - platform: gpio
    name: "b16-output01"
    id: "b16_output01"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output1-tuya
    dp_id: 1
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output01"

  - platform: gpio
    name: "b16-output02"
    id: "b16_output02"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output2-tuya
    dp_id: 2
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output02"

  - platform: gpio
    name: "b16-output03"
    id: "b16_output03"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output3-tuya
    dp_id: 3
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output03"

  - platform: gpio
    name: "b16-output04"
    id: "b16_output04"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output4-tuya
    dp_id: 4
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output04"

  - platform: gpio
    name: "b16-output05"
    id: "b16_output05"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output5-tuya
    dp_id: 5
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output05"

  - platform: gpio
    name: "b16-output06"
    id: "b16_output06"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output6-tuya
    dp_id: 6
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output06"

  - platform: gpio
    name: "b16-output07"
    id: "b16_output07"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output7-tuya
    dp_id: 101
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output07"

  - platform: gpio
    name: "b16-output08"
    id: "b16_output08"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output8-tuya
    dp_id: 102
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output08"

  - platform: gpio
    name: "b16-output09"
    id: "b16_output09"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output9-tuya
    dp_id: 103
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output09"

  - platform: gpio
    name: "b16-output10"
    id: "b16_output10"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output10-tuya
    dp_id: 104
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output10"

  - platform: gpio
    name: "b16-output11"
    id: "b16_output11"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output11-tuya
    dp_id: 105
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output11"

  - platform: gpio
    name: "b16-output12"
    id: "b16_output12"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output12-tuya
    dp_id: 106
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output12"

  - platform: gpio
    name: "b16-output13"
    id: "b16_output13"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output13-tuya
    dp_id: 107
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output13"

  - platform: gpio
    name: "b16-output14"
    id: "b16_output14"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output14-tuya
    dp_id: 108
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output14"

  - platform: gpio
    name: "b16-output15"
    id: "b16_output15"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output15-tuya
    dp_id: 109
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output15"

  - platform: gpio
    name: "b16-output16"
    id: "b16_output16"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-output16-tuya
    dp_id: 110
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "b16_output16"

binary_sensor:
  - platform: gpio
    name: "b16-input01"
    id: "b16_input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input1-tuya
    dp_id: 111
    bind_binary_sensor_id: b16_input01
    internal: true

  - platform: gpio
    name: "b16-input02"
    id: "b16_input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input2-tuya
    dp_id: 112
    bind_binary_sensor_id: b16_input02
    internal: true

  - platform: gpio
    name: "b16-input03"
    id: "b16_input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input3-tuya
    dp_id: 113
    bind_binary_sensor_id: b16_input03
    internal: true

  - platform: gpio
    name: "b16-input04"
    id: "b16_input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input4-tuya
    dp_id: 114
    bind_binary_sensor_id: b16_input04
    internal: true

  - platform: gpio
    name: "b16-input05"
    id: "b16_input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input5-tuya
    dp_id: 115
    bind_binary_sensor_id: b16_input05
    internal: true

  - platform: gpio
    name: "b16-input06"
    id: "b16_input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input6-tuya
    dp_id: 116
    bind_binary_sensor_id: b16_input06
    internal: true

  - platform: gpio
    name: "b16-input07"
    id: "b16_input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input7-tuya
    dp_id: 117
    bind_binary_sensor_id: b16_input07
    internal: true

  - platform: gpio
    name: "b16-input08"
    id: "b16_input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input8-tuya
    dp_id: 118
    bind_binary_sensor_id: b16_input08
    internal: true

  - platform: gpio
    name: "b16-input09"
    id: "b16_input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input9-tuya
    dp_id: 119
    bind_binary_sensor_id: b16_input09
    internal: true

  - platform: gpio
    name: "b16-input10"
    id: "b16_input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input10-tuya
    dp_id: 120
    bind_binary_sensor_id: b16_input10
    internal: true

  - platform: gpio
    name: "b16-input11"
    id: "b16_input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input11-tuya
    dp_id: 121
    bind_binary_sensor_id: b16_input11
    internal: true

  - platform: gpio
    name: "b16-input12"
    id: "b16_input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input12-tuya
    dp_id: 122
    bind_binary_sensor_id: b16_input12
    internal: true

  - platform: gpio
    name: "b16-input13"
    id: "b16_input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input13-tuya
    dp_id: 123
    bind_binary_sensor_id: b16_input13
    internal: true

  - platform: gpio
    name: "b16-input14"
    id: "b16_input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input14-tuya
    dp_id: 124
    bind_binary_sensor_id: b16_input14
    internal: true

  - platform: gpio
    name: "b16-input15"
    id: "b16_input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input15-tuya
    dp_id: 125
    bind_binary_sensor_id: b16_input15
    internal: true

  - platform: gpio
    name: "b16-input16"
    id: "b16_input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: b16-input16-tuya
    dp_id: 126
    bind_binary_sensor_id: b16_input16
    internal: true

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

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

  - platform: gpio
    name: "b16-W1-io40"
    pin:
      number: 40
      inverted: true

  - platform: gpio
    name: "b16-W1-io7"
    pin:
      number: 7
      inverted: true
## without resistance on PCB
  - platform: gpio
    name: "b16-io13"
    pin:
      number: 13
      inverted: false

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

  - platform: gpio
    name: "b16-21"
    pin:
      number: 21
      inverted:  false

  - platform: gpio
    name: "b16-0"
    pin:
      number: 0
      inverted:  false

ads1115:
  - address: 0x48
sensor:
  - platform: ads1115
    multiplexer: 'A0_GND'
    gain: 6.144
    resolution: 16_BITS
    name: "ADS1115 Channel A0-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A1_GND'
    gain: 6.144
    name: "ADS1115 Channel A1-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A2_GND'
    gain: 6.144
    name: "ADS1115 Channel A2-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A3_GND'
    gain: 6.144
    name: "ADS1115 Channel A3-GND"
    update_interval: 5s

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 B16");
download yaml file:
.txt   B16-HA.txt (Size: 13.84 KB / Downloads: 39)

Print this item

  B16 ESP32-S3 IO pins define
Posted by: admin - 02-22-2025, 01:52 AM - Forum: B16 - No Replies

IIC Bus:

SDA:GPIO8
SCL:GPIO18

PCF8575Sadrelay1-16): i2c address:0x22

PCF8575Sadinput1-16): i2c address:0x24

24C02 EPROM i2c address: 0x50
DS3231 RTC i2c address: 0x68
SSD1306 display: i2c address:0x3c
ADS1115 (4CH ADC): i2c address:0x48

Analog input (A1Big GrinC 0-5v)
Analog input (A2Big GrinC 0-5v)
Analog input (A3Big GrinC 4-20mA)
Analog input (A4Big GrinC 4-20mA)

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

free GPIOs (without pull-up resistance on PCB):
GPIO13
GPIO14
GPIO21

free GPIOs (with pull-up resistance on PCB):
GPIO40
GPIO48
GPIO47
GPIO7

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

Ethernet (W5500) I/O define:

clk_pin: GPIO1
mosi_pin: GPIO2
miso_pin: GPIO41
cs_pin: GPIO42

interrupt_pin: GPIO43
reset_pin: GPIO44

--------------------
RS485:
RXD:GPIO38
TXD:GPIO39

Tuya module:
RXD:GPIO17
TXD:GPIO16

Tuya network button: Tuya module's P28
Tuya network LED: Tuya module's P16
--------------------
SD Card:
SPI-MOSI:GPIO10
SPI-SCK:GPIO11
SPI-MISO:GPIO12
SPI-CS:GPIO9

Print this item

  KinCony controller to Mushroom farm
Posted by: intelligsystems - 02-21-2025, 11:30 PM - Forum: DIY Project - Replies (3)

Hi everyone,
I'm new to this forum and new to ESP/Home Assistant.
I have a mushroom cultivation tent where I use a humidifier, blower motors, LED lights, sensors, and an electric heater.
Currently, I control the climate using WiFi-connected sensors, but I would like to fully automate all devices and manage them using Home Assistant (I already have a server and WiFi infrastructure set up).
I'm unsure which Kincony controller would be the best choice, so I’d appreciate your advice. I've attached a diagram showing the devices I want to connect to the controller.

List of devices and required functions in Home Assistant:

  • Electric Heater (PTC 1.5 kW): Turn on/off based on the temperature sensor.
  • Humidity, Temperature, and CO2 Sensor: Read and monitor sensor data.
  • UV Lamp (in humidifier water container): Activate for short intervals (e.g., every 10 seconds).
  • Blower Motor: Adjust fan speed based on CO2 sensor readings.
  • LED Lights: Run for 12 hours daily with adjustable intensity.
  • Humidifier: Turn on/off based on the humidity sensor.

Thanks in advance for your help!
Krzysztof



Attached Files Thumbnail(s)
   
Print this item

  Free GPIO pins
Posted by: dionamket - 02-21-2025, 10:37 PM - Forum: KC868-A16 - Replies (1)

Just received the board, no problem setting up!
Is it possible to add a Neopixel light strip for a self made indicator of the input pins status? (green/red for on/off). That would require just one free GPIO. From what I understand there are no free GPIO pins on V2 of the board, just the new V3.
Are the 3 HT pin inputs only for temperature/humidity?
Thanks for your time!

Print this item

  COM problem on A32 Pro
Posted by: alamiran - 02-21-2025, 06:41 PM - Forum: KC868-A32/A32 Pro - Replies (1)

Hello everyone,

I recently installed 2 cards module A32 Pro into my electric cabinet, and they come as usual without firmware, when I turn on the card the dispay shows A32 Pro

I tried to connect via USBC-USBC cable to my laptop, but the port is not reconginzed on my windows device manager, and since the port is not physical viable, I won't be able to load the firmware app to load the software.

I turned off the card, press on the DL button, and Turn on the card and then released the DL botton in order to boot the card in bootloader mode, Yet this couldn't help in finding the COM port on my device.

My Computer is fine, and so is the Cable, i used same cable and same computer on F16 card, and i's worked smoothly without any issues.

Please advice I need help.

Thank you,
Rani

Print this item

  Operation log
Posted by: Yosemite - 02-21-2025, 09:17 AM - Forum: "KCS" v2 firmware system - Replies (4)

Hi,

For the next revision of KCS firmware V2, would Kincony consider adding an operation log of input and output states? This would be very helpful for troubleshooting.

Print this item