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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,141
» Latest member: California Landscape
» Forum threads: 4,068
» Forum posts: 20,410

Full Statistics

Online Users
There are currently 45 online users.
» 0 Member(s) | 37 Guest(s)
Amazonbot, Baidu, PetalBot, bot

Latest Threads
INCREMENTAL ENCODER
Forum: KC868-A8
Last Post: fabuena
12 minutes ago
» Replies: 0
» Views: 3
"KCS" v3.25.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 01:43 AM
» Replies: 5
» Views: 596
"KCS" v3 Nx energy meter ...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 01:39 AM
» Replies: 0
» Views: 21
"KCS" v3 TCP/IP Standard ...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 01:36 AM
» Replies: 0
» Views: 19
"KCS" v3 Modbus RTU over ...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 01:33 AM
» Replies: 0
» Views: 20
"KCS" v3 RS485 Standard M...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 01:28 AM
» Replies: 0
» Views: 22
[Arduino IDE demo source ...
Forum: KC868-A16
Last Post: admin
06-06-2026, 11:28 PM
» Replies: 18
» Views: 12,271
Kincony A32 Pro - Remove ...
Forum: KC868-A32/A32 Pro
Last Post: admin
06-06-2026, 01:03 AM
» Replies: 3
» Views: 870
KC868-A32 PCB layout CAD ...
Forum: Schematic & diagram & Dimensions of KinCony PCB layout CAD file
Last Post: admin
06-05-2026, 11:44 AM
» Replies: 0
» Views: 37
Help with Product Slectio...
Forum: Suggestions and feedback on KinCony's products
Last Post: admin
06-05-2026, 10:35 AM
» Replies: 9
» Views: 612

  [arduino code examples for B24M]-03 Read ADS1115 analog input ports value
Posted by: admin - 07-31-2025, 06:57 AM - Forum: B24M - 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: 379)
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: 192.69 KB / Downloads: 393)

Print this item

  [arduino code examples for B24]-03 Read ADS1115 analog input ports value
Posted by: admin - 07-31-2025, 06:57 AM - Forum: B24 - 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: 431)
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: 192.69 KB / Downloads: 407)

Print this item

  [arduino code examples for B32M]-03 Read ADS1115 analog input ports value
Posted by: admin - 07-31-2025, 06:57 AM - Forum: B32M - 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: 402)
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: 192.69 KB / Downloads: 387)

Print this item

  [arduino code examples for B24M]-02 Read digital input ports state
Posted by: admin - 07-31-2025, 06:55 AM - Forum: B24M - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads the state of two 16-channel PCF8575 I/O expanders
* and prints the state of all input pins (1-24) to the Serial Monitor.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
* - PCF8575 I2C Address: 0x22 for inputs 1-16, 0x25 for inputs 17-24
*/

#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 addresses
PCF8575 pcf8575_IN1(0x22); // The I2C address of the first PCF8575 (inputs 1-16)
PCF8575 pcf8575_IN2(0x25); // The I2C address of the second PCF8575 (inputs 17-24)

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

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

    // Initialize both PCF8575 modules
    pcf8575_IN1.begin();
    pcf8575_IN2.begin();

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

void loop() {

if (pcf8575_IN1.read(8)==0) {Serial.print("DI1 state="); Serial.println("on");}
if (pcf8575_IN1.read(9)==0) {Serial.print("DI2 state="); Serial.println("on");}
if (pcf8575_IN1.read(10)==0) {Serial.print("DI3 state="); Serial.println("on");}
if (pcf8575_IN1.read(11)==0) {Serial.print("DI4 state="); Serial.println("on");}
if (pcf8575_IN1.read(12)==0) {Serial.print("DI5 state="); Serial.println("on");}
if (pcf8575_IN1.read(13)==0) {Serial.print("DI6 state="); Serial.println("on");}
if (pcf8575_IN1.read(14)==0) {Serial.print("DI7 state="); Serial.println("on");}
if (pcf8575_IN1.read(15)==0) {Serial.print("DI8 state="); Serial.println("on");}

if (pcf8575_IN1.read(0)==0) {Serial.print("DI9 state="); Serial.println("on");}
if (pcf8575_IN1.read(1)==0) {Serial.print("DI10 state="); Serial.println("on");}
if (pcf8575_IN1.read(2)==0) {Serial.print("DI11 state="); Serial.println("on");}
if (pcf8575_IN1.read(3)==0) {Serial.print("DI12 state="); Serial.println("on");}
if (pcf8575_IN1.read(4)==0) {Serial.print("DI13 state="); Serial.println("on");}
if (pcf8575_IN1.read(5)==0) {Serial.print("DI14 state="); Serial.println("on");}
if (pcf8575_IN1.read(6)==0) {Serial.print("DI15 state="); Serial.println("on");}
if (pcf8575_IN1.read(7)==0) {Serial.print("DI16 state="); Serial.println("on");}

if (pcf8575_IN2.read(0)==0) {Serial.print("DI17 state="); Serial.println("on");}
if (pcf8575_IN2.read(1)==0) {Serial.print("DI18 state="); Serial.println("on");}
if (pcf8575_IN2.read(2)==0) {Serial.print("DI19 state="); Serial.println("on");}
if (pcf8575_IN2.read(3)==0) {Serial.print("DI20 state="); Serial.println("on");}
if (pcf8575_IN2.read(4)==0) {Serial.print("DI21 state="); Serial.println("on");}
if (pcf8575_IN2.read(5)==0) {Serial.print("DI22 state="); Serial.println("on");}
if (pcf8575_IN2.read(6)==0) {Serial.print("DI23 state="); Serial.println("on");}
if (pcf8575_IN2.read(7)==0) {Serial.print("DI24 state="); Serial.println("on");}


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

.zip   2-digital-input.zip (Size: 880 bytes / Downloads: 378)
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: 192.64 KB / Downloads: 392)

Print this item

  [arduino code examples for B24]-02 Read digital input ports state
Posted by: admin - 07-31-2025, 06:55 AM - Forum: B24 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads the state of two 16-channel PCF8575 I/O expanders
* and prints the state of all input pins (1-24) to the Serial Monitor.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
* - PCF8575 I2C Address: 0x22 for inputs 1-16, 0x25 for inputs 17-24
*/

#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 addresses
PCF8575 pcf8575_IN1(0x22); // The I2C address of the first PCF8575 (inputs 1-16)
PCF8575 pcf8575_IN2(0x25); // The I2C address of the second PCF8575 (inputs 17-24)

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

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

    // Initialize both PCF8575 modules
    pcf8575_IN1.begin();
    pcf8575_IN2.begin();

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

void loop() {

if (pcf8575_IN1.read(8)==0) {Serial.print("DI1 state="); Serial.println("on");}
if (pcf8575_IN1.read(9)==0) {Serial.print("DI2 state="); Serial.println("on");}
if (pcf8575_IN1.read(10)==0) {Serial.print("DI3 state="); Serial.println("on");}
if (pcf8575_IN1.read(11)==0) {Serial.print("DI4 state="); Serial.println("on");}
if (pcf8575_IN1.read(12)==0) {Serial.print("DI5 state="); Serial.println("on");}
if (pcf8575_IN1.read(13)==0) {Serial.print("DI6 state="); Serial.println("on");}
if (pcf8575_IN1.read(14)==0) {Serial.print("DI7 state="); Serial.println("on");}
if (pcf8575_IN1.read(15)==0) {Serial.print("DI8 state="); Serial.println("on");}

if (pcf8575_IN1.read(0)==0) {Serial.print("DI9 state="); Serial.println("on");}
if (pcf8575_IN1.read(1)==0) {Serial.print("DI10 state="); Serial.println("on");}
if (pcf8575_IN1.read(2)==0) {Serial.print("DI11 state="); Serial.println("on");}
if (pcf8575_IN1.read(3)==0) {Serial.print("DI12 state="); Serial.println("on");}
if (pcf8575_IN1.read(4)==0) {Serial.print("DI13 state="); Serial.println("on");}
if (pcf8575_IN1.read(5)==0) {Serial.print("DI14 state="); Serial.println("on");}
if (pcf8575_IN1.read(6)==0) {Serial.print("DI15 state="); Serial.println("on");}
if (pcf8575_IN1.read(7)==0) {Serial.print("DI16 state="); Serial.println("on");}

if (pcf8575_IN2.read(0)==0) {Serial.print("DI17 state="); Serial.println("on");}
if (pcf8575_IN2.read(1)==0) {Serial.print("DI18 state="); Serial.println("on");}
if (pcf8575_IN2.read(2)==0) {Serial.print("DI19 state="); Serial.println("on");}
if (pcf8575_IN2.read(3)==0) {Serial.print("DI20 state="); Serial.println("on");}
if (pcf8575_IN2.read(4)==0) {Serial.print("DI21 state="); Serial.println("on");}
if (pcf8575_IN2.read(5)==0) {Serial.print("DI22 state="); Serial.println("on");}
if (pcf8575_IN2.read(6)==0) {Serial.print("DI23 state="); Serial.println("on");}
if (pcf8575_IN2.read(7)==0) {Serial.print("DI24 state="); Serial.println("on");}


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

.zip   2-digital-input.zip (Size: 880 bytes / Downloads: 409)
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: 192.64 KB / Downloads: 393)

Print this item

  [arduino code examples for B32M]-02 Read digital input ports state
Posted by: admin - 07-31-2025, 06:55 AM - Forum: B32M - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads the state of two 16-channel PCF8575 I/O expanders
* and prints the state of all input pins (1-24) to the Serial Monitor.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
* - PCF8575 I2C Address: 0x22 for inputs 1-16, 0x25 for inputs 17-24
*/

#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 addresses
PCF8575 pcf8575_IN1(0x22); // The I2C address of the first PCF8575 (inputs 1-16)
PCF8575 pcf8575_IN2(0x25); // The I2C address of the second PCF8575 (inputs 17-24)
PCF8575 pcf8575_IN3(0x26); // The I2C address of the second PCF8575 (inputs 25-32)

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

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

    // Initialize both PCF8575 modules
    pcf8575_IN1.begin();
    pcf8575_IN2.begin();
    pcf8575_IN3.begin();

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

void loop() {

if (pcf8575_IN1.read(8)==0) {Serial.print("DI1 state="); Serial.println("on");}
if (pcf8575_IN1.read(9)==0) {Serial.print("DI2 state="); Serial.println("on");}
if (pcf8575_IN1.read(10)==0) {Serial.print("DI3 state="); Serial.println("on");}
if (pcf8575_IN1.read(11)==0) {Serial.print("DI4 state="); Serial.println("on");}
if (pcf8575_IN1.read(12)==0) {Serial.print("DI5 state="); Serial.println("on");}
if (pcf8575_IN1.read(13)==0) {Serial.print("DI6 state="); Serial.println("on");}
if (pcf8575_IN1.read(14)==0) {Serial.print("DI7 state="); Serial.println("on");}
if (pcf8575_IN1.read(15)==0) {Serial.print("DI8 state="); Serial.println("on");}

if (pcf8575_IN1.read(0)==0) {Serial.print("DI9 state="); Serial.println("on");}
if (pcf8575_IN1.read(1)==0) {Serial.print("DI10 state="); Serial.println("on");}
if (pcf8575_IN1.read(2)==0) {Serial.print("DI11 state="); Serial.println("on");}
if (pcf8575_IN1.read(3)==0) {Serial.print("DI12 state="); Serial.println("on");}
if (pcf8575_IN1.read(4)==0) {Serial.print("DI13 state="); Serial.println("on");}
if (pcf8575_IN1.read(5)==0) {Serial.print("DI14 state="); Serial.println("on");}
if (pcf8575_IN1.read(6)==0) {Serial.print("DI15 state="); Serial.println("on");}
if (pcf8575_IN1.read(7)==0) {Serial.print("DI16 state="); Serial.println("on");}

if (pcf8575_IN2.read(0)==0) {Serial.print("DI17 state="); Serial.println("on");}
if (pcf8575_IN2.read(1)==0) {Serial.print("DI18 state="); Serial.println("on");}
if (pcf8575_IN2.read(2)==0) {Serial.print("DI19 state="); Serial.println("on");}
if (pcf8575_IN2.read(3)==0) {Serial.print("DI20 state="); Serial.println("on");}
if (pcf8575_IN2.read(4)==0) {Serial.print("DI21 state="); Serial.println("on");}
if (pcf8575_IN2.read(5)==0) {Serial.print("DI22 state="); Serial.println("on");}
if (pcf8575_IN2.read(6)==0) {Serial.print("DI23 state="); Serial.println("on");}
if (pcf8575_IN2.read(7)==0) {Serial.print("DI24 state="); Serial.println("on");}

if (pcf8575_IN3.read(0)==0) {Serial.print("DI25 state="); Serial.println("on");}
if (pcf8575_IN3.read(1)==0) {Serial.print("DI26 state="); Serial.println("on");}
if (pcf8575_IN3.read(2)==0) {Serial.print("DI27 state="); Serial.println("on");}
if (pcf8575_IN3.read(3)==0) {Serial.print("DI28 state="); Serial.println("on");}
if (pcf8575_IN3.read(4)==0) {Serial.print("DI29 state="); Serial.println("on");}
if (pcf8575_IN3.read(5)==0) {Serial.print("DI30 state="); Serial.println("on");}
if (pcf8575_IN3.read(6)==0) {Serial.print("DI31 state="); Serial.println("on");}
if (pcf8575_IN3.read(7)==0) {Serial.print("DI32 state="); Serial.println("on");}

    delay(1000); // Delay 500ms
}

arduino ino file download:

.zip   2-digital-input.zip (Size: 942 bytes / Downloads: 91)
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: 198.36 KB / Downloads: 99)

Print this item

  [arduino code examples for B24M]-01 Turn ON/OFF OUTPUT
Posted by: admin - 07-31-2025, 06:54 AM - Forum: B24M - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program controls a 24-channel relay board via two PCF8575 I/O expanders.
* 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 addresses of the PCF8575 modules
#define I2C_ADDRESS_R1 0x25 // I2C address of the first PCF8575 module
#define I2C_ADDRESS_R2 0x24 // I2C address of the second PCF8575 module

PCF8575 pcf8575_R1(I2C_ADDRESS_R1); // Create a PCF8575 object for the first module (for relays 9-24)
PCF8575 pcf8575_R2(I2C_ADDRESS_R2); // Create a PCF8575 object for the second module (for relays 1-8)

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 modules
  pcf8575_R1.begin();
  pcf8575_R2.begin();

  // Turn off all relays initially (set all pins HIGH)

  for (int i = 8; i < 16; i++) {
    pcf8575_R1.write(i, HIGH); // Set relays 1-8 to OFF (assuming HIGH means OFF for relays)
  }

  for (int i = 0; i < 16; i++) {
    pcf8575_R2.write(i, HIGH); // Set relays 9-24 to OFF (assuming HIGH means OFF for relays)
  }
}

void loop() {
  // Sequentially turn on each relay (1-24)
 
  // First control the relays on the second PCF8575 (relays 1-8)
  for (int i = 8; 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
  }

  // Then control the relays on the first PCF8575 (relays 9-24)
  for (int i = 0; i < 16; i++) {
    pcf8575_R2.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 (1-24)
 
  // First control the relays on the second PCF8575 (relays 1-8)
  for (int i = 8; 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
  }

  // Then control the relays on the first PCF8575 (relays 9-24)
  for (int i = 0; i < 16; i++) {
    pcf8575_R2.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-relay.zip (Size: 1.01 KB / Downloads: 401)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   1-relay.ino.merged.zip (Size: 192.11 KB / Downloads: 397)

Print this item

  [arduino code examples for B24]-01 Turn ON/OFF OUTPUT
Posted by: admin - 07-31-2025, 06:54 AM - Forum: B24 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program controls a 24-channel relay board via two PCF8575 I/O expanders.
* 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 addresses of the PCF8575 modules
#define I2C_ADDRESS_R1 0x25 // I2C address of the first PCF8575 module
#define I2C_ADDRESS_R2 0x24 // I2C address of the second PCF8575 module

PCF8575 pcf8575_R1(I2C_ADDRESS_R1); // Create a PCF8575 object for the first module (for relays 9-24)
PCF8575 pcf8575_R2(I2C_ADDRESS_R2); // Create a PCF8575 object for the second module (for relays 1-8)

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 modules
  pcf8575_R1.begin();
  pcf8575_R2.begin();

  // Turn off all relays initially (set all pins HIGH)

  for (int i = 8; i < 16; i++) {
    pcf8575_R1.write(i, HIGH); // Set relays 1-8 to OFF (assuming HIGH means OFF for relays)
  }

  for (int i = 0; i < 16; i++) {
    pcf8575_R2.write(i, HIGH); // Set relays 9-24 to OFF (assuming HIGH means OFF for relays)
  }
}

void loop() {
  // Sequentially turn on each relay (1-24)
 
  // First control the relays on the second PCF8575 (relays 1-8)
  for (int i = 8; 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
  }

  // Then control the relays on the first PCF8575 (relays 9-24)
  for (int i = 0; i < 16; i++) {
    pcf8575_R2.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 (1-24)
 
  // First control the relays on the second PCF8575 (relays 1-8)
  for (int i = 8; 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
  }

  // Then control the relays on the first PCF8575 (relays 9-24)
  for (int i = 0; i < 16; i++) {
    pcf8575_R2.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-relay.zip (Size: 1.01 KB / Downloads: 376)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   1-relay.ino.merged.zip (Size: 192.11 KB / Downloads: 385)

Print this item

  [arduino code examples for B32M]-01 Turn ON/OFF OUTPUT
Posted by: admin - 07-31-2025, 06:54 AM - Forum: B32M - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program controls a 24-channel relay board via two PCF8575 I/O expanders.
* 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 addresses of the PCF8575 modules
#define I2C_ADDRESS_R1 0x25 // I2C address of the first PCF8575 module
#define I2C_ADDRESS_R2 0x24 // I2C address of the second PCF8575 module
#define I2C_ADDRESS_R3 0x26 // I2C address of the second PCF8575 module

PCF8575 pcf8575_R1(I2C_ADDRESS_R1); // Create a PCF8575 object for the first module (for relays 9-24)
PCF8575 pcf8575_R2(I2C_ADDRESS_R2); // Create a PCF8575 object for the second module (for relays 1-8)
PCF8575 pcf8575_R3(I2C_ADDRESS_R3); // Create a PCF8575 object for the second module (for relays 25-32)

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 modules
  pcf8575_R1.begin();
  pcf8575_R2.begin();
  pcf8575_R3.begin();

  // Turn off all relays initially (set all pins HIGH)

  for (int i = 8; i < 16; i++) {
    pcf8575_R3.write(i, HIGH); // Set relays 1-8 to OFF (assuming HIGH means OFF for relays)
  }


  for (int i = 8; i < 16; i++) {
    pcf8575_R1.write(i, HIGH); // Set relays 9-16 to OFF (assuming HIGH means OFF for relays)
  }

  for (int i = 0; i < 16; i++) {
    pcf8575_R2.write(i, HIGH); // Set relays 17-32 to OFF (assuming HIGH means OFF for relays)
  }




}

void loop() {
  // Sequentially turn on each relay (1-24)
 
  // control the relays on the second PCF8575 (relays 1-8)
  for (int i = 8; i < 16; i++) {
    pcf8575_R3.write(i, LOW);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }


  // First control the relays on the second PCF8575 (relays 9-16)
  for (int i = 8; 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
  }

  // Then control the relays on the first PCF8575 (relays 17-32)
  for (int i = 0; i < 16; i++) {
    pcf8575_R2.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 (1-24)
 
  // Then control the relays on the first PCF8575 (relays 1-8)
  for (int i = 8; i < 16; i++) {
    pcf8575_R3.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // First control the relays on the second PCF8575 (relays 9-16)
  for (int i = 8; 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
  }

  // Then control the relays on the first PCF8575 (relays 17-32)
  for (int i = 0; i < 16; i++) {
    pcf8575_R2.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-relay.zip (Size: 1.08 KB / Downloads: 90)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   1-relay.ino.merged.zip (Size: 197.71 KB / Downloads: 91)

Print this item

  B24M ESPHome yaml for home assistant without tuya
Posted by: admin - 07-31-2025, 06:52 AM - Forum: B24M - Replies (2)

Code:
esphome:
  name: b24
  friendly_name: b24

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

# Enable logging
logger:

# Enable Home Assistant API
api:

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

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

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

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

  - id: 'pcf8574_hub_in_out_1'  # for digital input channel 17-24 & ouptut 1-8
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_out_1'  # for output channel 9-24
    i2c_id: bus_a
    address: 0x24
    pcf8575: true

binary_sensor:
  - platform: gpio
    name: "b24-input01"
    id: "b24_input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input02"
    id: "b24_input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input03"
    id: "b24_input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input04"
    id: "b24_input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input05"
    id: "b24_input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input06"
    id: "b24_input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input07"
    id: "b24_input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input08"
    id: "b24_input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input09"
    id: "b24_input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input10"
    id: "b24_input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input11"
    id: "b24_input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input12"
    id: "b24_input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input13"
    id: "b24_input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input14"
    id: "b24_input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input15"
    id: "b24_input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "b24-input16"
    id: "b24_input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input17"
    id: "b24_input17"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input18"
    id: "b24_input18"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input19"
    id: "b24_input19"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input20"
    id: "b24_input20"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input21"
    id: "b24_input21"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input22"
    id: "b24_input22"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input23"
    id: "b24_input23"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "b24-input24"
    id: "b24_input24"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 7
      mode: INPUT
      inverted: true

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

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

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

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

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

  - platform: gpio
    name: "b24-W1-io21"
    pin:
      number: 21
      inverted:  false

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

switch:
  - platform: gpio
    name: "b24-output01"
    id: "b24_output01"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output02"
    id: "b24_output02"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output03"
    id: "b24_output03"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output04"
    id: "b24_output04"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output05"
    id: "b24_output05"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output06"
    id: "b24_output06"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output07"
    id: "b24_output07"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output08"
    id: "b24_output08"
    pin:
      pcf8574: pcf8574_hub_in_out_1
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output09"
    id: b24_output09
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output10"
    id: b24_output10
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output11"
    id: b24_output11
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output12"
    id: b24_output12
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output13"
    id: b24_output13
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output14"
    id: b24_output14
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output15"
    id: b24_output15
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output16"
    id: b24_output16
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output17"
    id: b24_output17
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output18"
    id: b24_output18
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output19"
    id: b24_output19
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output20"
    id: b24_output20
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output21"
    id: b24_output21
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output22"
    id: b24_output22
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output23"
    id: b24_output23
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "b24-output24"
    id: b24_output24
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true

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

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 B24");
download yaml file:

.txt   B24-HA-without Tuya.txt (Size: 10.92 KB / Downloads: 330)

Print this item