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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,666
» Latest member: hi88red
» Forum threads: 4,195
» Forum posts: 20,848

Full Statistics

Online Users
There are currently 109 online users.
» 0 Member(s) | 90 Guest(s)
Amazonbot, Baidu, Bing, Bytespider, Crawl, PetalBot, Semrush, bot

Latest Threads
N60 configure yaml for ES...
Forum: N60
Last Post: admin
Today, 01:42 AM
» Replies: 7
» Views: 1,885
KCS VERSUS ESPHOME
Forum: "KCS" v3 firmware
Last Post: EDVALDO DE MARINGA
Yesterday, 01:31 PM
» Replies: 2
» Views: 40
KC868-AGv3
Forum: Getting Started with ESPHome and Home Assistant
Last Post: admin
08-20-2026, 10:18 PM
» Replies: 5
» Views: 102
[arduino code examples fo...
Forum: KC868-A32/A32 Pro
Last Post: huanmarie
08-19-2026, 07:09 AM
» Replies: 2
» Views: 1,603
KC868-H32B V5.08 firmware
Forum: News
Last Post: meoowu77
08-18-2026, 11:46 AM
» Replies: 24
» Views: 8,457
KinCony B2 Smart Controll...
Forum: News
Last Post: admin
08-17-2026, 01:07 PM
» Replies: 0
» Views: 58
KC868-A8v3 PCB layout CAD...
Forum: Schematic & diagram & Dimensions of KinCony PCB layout CAD file
Last Post: admin
08-17-2026, 08:44 AM
» Replies: 0
» Views: 68
CT Clamp Compatibility
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
08-16-2026, 11:08 PM
» Replies: 12
» Views: 2,151
N60 Sensor channel label
Forum: N60
Last Post: marekd1
08-14-2026, 09:14 PM
» Replies: 18
» Views: 2,529
solar production and cons...
Forum: N30
Last Post: admin
08-14-2026, 01:46 AM
» Replies: 3
» Views: 150

Star [Arduino IDE demo source code for KC868-A8]--#03-ADC INPUT
Posted by: KinCony Support - 01-05-2022, 06:35 AM - Forum: KC868-A8 - No Replies

Code 2: //The demo code is ADC INPUT    You can copy the code to your Arduino IDE

Code:
#include "Arduino.h"
#include "PCF8574.h"          //install library "PCF8574 library"

#define ANALOG_A1   34        // IO34   Board: V1.4 
#define ANALOG_A2   35        // IO35   Board: V1.4

byte out_arr[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
// Set i2c address
//TwoWire my_def
PCF8574 pcf8574_input(0x22);

PCF8574 pcf8574_output(0x24);

byte value = 0;

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

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);


    // Set pinMode to OUTPUT
  pcf8574_output.pinMode(P0, OUTPUT);
  pcf8574_output.pinMode(P1, OUTPUT);
  pcf8574_output.pinMode(P2, OUTPUT);
  pcf8574_output.pinMode(P3, OUTPUT);
  pcf8574_output.pinMode(P4, OUTPUT);
  pcf8574_output.pinMode(P5, OUTPUT);
  pcf8574_output.pinMode(P6, OUTPUT);
  pcf8574_output.pinMode(P7, OUTPUT);

    Serial.print("Init pcf8574 output...");
    if (pcf8574_output.begin()){
        Serial.println("OK");
    }else{
        Serial.println("failed");
    }

  pcf8574_input.pinMode(P0, INPUT);
  pcf8574_input.pinMode(P1, INPUT);
  pcf8574_input.pinMode(P2, INPUT);
  pcf8574_input.pinMode(P3, INPUT);
  pcf8574_input.pinMode(P4, INPUT);
  pcf8574_input.pinMode(P5, INPUT);
  pcf8574_input.pinMode(P6, INPUT);
  pcf8574_input.pinMode(P7, INPUT);
Serial.print("Init pcf8574 input...");
if (pcf8574_input.begin()){
    Serial.println("OK");
  }else{
    Serial.println("failed");
  }
 
}

void loop()
{
  delay(500);
  Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));
  Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));

 
}
   

Print this item

Star [Arduino IDE demo source code for KC868-A8]--#02-RF_receive
Posted by: KinCony Support - 01-05-2022, 06:28 AM - Forum: KC868-A8 - No Replies

Code 1: //The demo code is RF-receive    You can copy the code to your Arduino IDE

Code:
#include <RCSwitch.h>  //Install library "rcswitch"

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(15));  //receive PIN IO15
}

void loop() {
  if (mySwitch.available()) {
   
    Serial.print("Received ");
    Serial.print( mySwitch.getReceivedValue() );
    Serial.print(" / ");
    Serial.print( mySwitch.getReceivedBitlength() );
    Serial.print("bit ");
    Serial.print("Protocol: ");
    Serial.println( mySwitch.getReceivedProtocol() );

    mySwitch.resetAvailable();
  }
}



Attached Files Thumbnail(s)
   
Print this item

Star [Arduino IDE demo source code for KC868-A8]--#01-config Arduino IDE for ESP32 module
Posted by: KinCony Support - 01-05-2022, 05:26 AM - Forum: KC868-A8 - No Replies

  Before using KC868-A8, you need to set the parameters of the preference

Copy the following URL: https://dl.espressif.com/dl/package_esp32_index.json


   
Select the Board "NodeMCU -32S"
   

   
#define ANALOG_A1  34  updated in PCB V1.4
#define ANALOG_A2  35  updated in PCB V1.4

IIC SDA:4
IIC SCL:5

Relay_IIC_address 0x24

Relay1 = pcf8574.pinMode(P0, OUTPUT);
Relay2 = pcf8574.pinMode(P1, OUTPUT);
Relay3 = pcf8574.pinMode(P2, OUTPUT);
Relay4 = pcf8574.pinMode(P3, OUTPUT);
Relay5 = pcf8574.pinMode(P4, OUTPUT);
Relay6 = pcf8574.pinMode(P5, OUTPUT);
Relay7 = pcf8574.pinMode(P6, OUTPUT);
Relay8 = pcf8574.pinMode(P7, OUTPUT);

Input_IIC_address 0x22

Input1 = pcf8574.pinMode(P0, INPUT);
Input2 = pcf8574.pinMode(P1, INPUT);
Input3 = pcf8574.pinMode(P2, INPUT);
Input4 = pcf8574.pinMode(P3, INPUT);
Input5 = pcf8574.pinMode(P4, INPUT);
Input6 = pcf8574.pinMode(P5, INPUT);
Input7 = pcf8574.pinMode(P6, INPUT);
Input8 = pcf8574.pinMode(P7, INPUT);


DS18B20/DHT11/DHT21/LED strip -1: 14
DS18B20/DHT11/DHT21/LED strip -2: 13

DS18B20/DHT11/DHT21/LED strip -3: 32   updated in PCB V1.4
DS18B20/DHT11/DHT21/LED strip -4: 33   updated in PCB V1.4



RF433MHz wireless receiver: 15

Ethernet (LAN8720) I/O define:

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

Print this item

  [arduino source code for KC868-Uair-9] Send RF 433MHz wireless signal
Posted by: admin - 01-05-2022, 12:47 AM - Forum: KC868-Uair - No Replies

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableTransmit(digitalPinToInterrupt(2));
}

void loop() {
  mySwitch.switchOn("11111", "00010");
  delay(1000);
  mySwitch.switchOff("11111", "00010");
  delay(1000);

  mySwitch.send(5393, 24);
  delay(1000); 
  mySwitch.send(5396, 24);
  delay(1000); 

  mySwitch.send("000000000001010100010001");
  delay(1000); 
  mySwitch.send("000000000001010100010100");
  delay(1000);

  mySwitch.sendTriState("00000FFF0F0F");
  delay(1000); 
  mySwitch.sendTriState("00000FFF0FF0");
  delay(1000);
}

download arduino IDE source code file: 

.zip   433-sender-code.zip (Size: 407 bytes / Downloads: 887)

Note: install "rcswitch" library online firstly.
[Image: attachment.php?aid=462]

Print this item

  [arduino source code for KC868-Uair-8] RF 433MHz wireless remoter decode
Posted by: admin - 01-04-2022, 01:16 AM - Forum: KC868-Uair - No Replies

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(13));
}

void loop() {
  if (mySwitch.available()) {
   
    Serial.print("Received ");
    Serial.print( mySwitch.getReceivedValue() );
    Serial.print(" / ");
    Serial.print( mySwitch.getReceivedBitlength() );
    Serial.print("bit ");
    Serial.print("Protocol: ");
    Serial.println( mySwitch.getReceivedProtocol() );

    mySwitch.resetAvailable();
  }
}


download arduino IDE source code file: 

.zip   RF-receiver.zip (Size: 393 bytes / Downloads: 989)
Note: install "rcswitch" library online firstly.
   

Print this item

  [arduino source code for KC868-Uair-7] send IR code signal
Posted by: admin - 01-03-2022, 05:41 AM - Forum: KC868-Uair - No Replies

#include "PinDefinitionsAndMore.h"
#include <IRremote.h>

void setup() {

  Serial.begin(9600);
  IrSender.begin(IR_SEND_PIN, ENABLE_LED_FEEDBACK);

}

  uint16_t sAddress = 0x78;
  uint8_t sCommand = 0xCD;
  uint8_t sRepeats = 0;

void loop() {
  IrSender.sendNEC(sAddress, sCommand, sRepeats);
  delay(1000);
}


download arduino IDE source code file: 

.zip   Uair_IR_send.zip (Size: 388 bytes / Downloads: 961)

Note: install "IRremote" library online firstly.

[Image: attachment.php?aid=456]

set IR sender and receiver GPIO pins define as below image:
[Image: attachment.php?aid=459]

Print this item

  [arduino source code for KC868-Uair-6] IR remoter button decode
Posted by: admin - 01-02-2022, 04:15 AM - Forum: KC868-Uair - No Replies

#include "PinDefinitionsAndMore.h"
#include <IRremote.h>

void setup() {
  Serial.begin(9600);
  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
}

void loop() {
    if (IrReceiver.decode()) {
        
        IrReceiver.printIRResultShort(&Serial);
        if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
          
            IrReceiver.printIRResultRawFormatted(&Serial, true);
        }
        Serial.println();
    IrReceiver.resume();
    }
}


download arduino IDE source code file: 

.zip   Uair_IR_receive.zip (Size: 569 bytes / Downloads: 908)
Note: install "IRremote" library online firstly.
   

set IR sender and receiver GPIO pins define as below image:
   

Print this item

  KC868-A Pins to HomeSpan HomeKit
Posted by: glock4101 - 12-31-2021, 10:43 AM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

Hello, I would like to use my controller for homekit control. I found out from the instructional videos that Relay 3 and 4 are on pins 2 and 15.
I would like to use more relays, and configure digital inputs as switches.
In further configuration I would like to use analog inputs and a temperature sensor.

Print this item

  [arduino source code for KC868-Uair-5] read DS18B20 temperature sensor
Posted by: admin - 12-31-2021, 02:15 AM - Forum: KC868-Uair - No Replies

#include <DS18B20.h>

DS18B20 ds(27);

void setup() {
    Serial.begin(9600);
}

void loop() {
 
    Serial.print(ds.getTempC());
    Serial.print("℃");
    Serial.println();
}

download arduino IDE source code file: 

.zip   temperature.zip (Size: 286 bytes / Downloads: 931)

Note: install "DallasTemperature" library online firstly.
   

edit IR send and receiver GPIO pin define in "PinDefinitionsAndMore.h"
   

Print this item

  RC snubber wiring
Posted by: bigramon - 12-30-2021, 07:19 PM - Forum: KC868-HxB series Smart Controller - Replies (10)

Can you please confirm the following wiring of the RC snubber with a KC868-H32B for a furnace valve is OK ?
[Image: kincony-rc-snubber.jpg]

Print this item