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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,495
» Latest member: StuartFox
» Forum threads: 4,178
» Forum posts: 20,768

Full Statistics

Online Users
There are currently 39 online users.
» 0 Member(s) | 29 Guest(s)
Amazonbot, Baidu, Crawl, Google, PetalBot, bot

Latest Threads
B8 ADS1115 current inputs
Forum: B8
Last Post: admin
07-29-2026, 09:47 PM
» Replies: 6
» Views: 45
KINCONY IN KSA
Forum: DIY Project
Last Post: admin
07-29-2026, 10:43 AM
» Replies: 14
» Views: 1,632
A32 Pro ESPHome yaml for ...
Forum: KC868-A32/A32 Pro
Last Post: admin
07-27-2026, 06:25 AM
» Replies: 1
» Views: 1,187
E8v3 E16v3 E24v3 relay mo...
Forum: Extender module
Last Post: admin
07-27-2026, 01:00 AM
» Replies: 0
» Views: 33
KC868-H32B V5.08 firmware
Forum: News
Last Post: admin
07-25-2026, 11:53 PM
» Replies: 23
» Views: 7,623
[arduino code examples fo...
Forum: B2
Last Post: admin
07-25-2026, 06:40 AM
» Replies: 0
» Views: 36
[arduino code examples fo...
Forum: B2
Last Post: admin
07-25-2026, 06:39 AM
» Replies: 0
» Views: 61
[arduino code examples fo...
Forum: B2
Last Post: admin
07-25-2026, 06:38 AM
» Replies: 0
» Views: 31
[arduino code examples fo...
Forum: B2
Last Post: admin
07-25-2026, 06:37 AM
» Replies: 0
» Views: 39
[arduino code examples fo...
Forum: B2
Last Post: admin
07-25-2026, 06:36 AM
» Replies: 0
» Views: 35

  KC868-A6 PCB size details
Posted by: admin - 04-15-2023, 01:15 PM - Forum: KC868-A6 - No Replies


.pdf   A6 SIZE.pdf (Size: 52.1 KB / Downloads: 960)
   

Print this item

  Control relay on KC868-E16S from K868-AM using RS485
Posted by: AshS - 04-14-2023, 09:17 PM - Forum: KC868-AM - Replies (1)

I am using ESPHome on a E16S and an AM board.

I need to control 1 relay on the E16S from the AM board using RS485.

Please can you tell me how do use this?

I have not used RS485 before.

Thank you.

Print this item

  KC868-A16 - Different digital Output modes
Posted by: oxedgar - 04-14-2023, 04:42 AM - Forum: DIY Project - Replies (8)

Hello, I try to get KCS-Firmware to work has i want...
I have one output to need to work in two modes ...
the first is  normal On-OFF toggle with one input triggered (this work fine)
The the second mode is to delayed this same output if i trigger another input (this do not work)

The result is to provide one wall button to ON Off Light and for the same light one motion PIR not temporised to work with specific delay set in this smart controller!
Can i make this with KCS firmware?

Print this item

  [Arduino source code for KC868-A8M]-06 RS485
Posted by: KinCony Support - 04-14-2023, 03:19 AM - Forum: KC868-A8M - Replies (6)

[Arduino source code for KC868-A8M]-06 RS485

Code:
#define A8M_RS485_RX 15
#define A8M_RS485_TX 13
void setup() {
  Serial.begin(115200);
  Serial2.begin(115200,SERIAL_8N1,A8M_RS485_RX,A8M_RS485_TX);//A8M
  Serial2.println("A8M RS485 SEND is OK!!"); 
}

void loop() {
  /*print the received data of RS485 port*/
  while(Serial2.available()>0)
   {
    Serial2.print((char)Serial2.read());//Read rs485 receive data  and print it
   }
  delay(200);
}



Attached Files
.zip   KC868-A8M_RS485.zip (Size: 596 bytes / Downloads: 793)
Print this item

  [Arduino source code for KC868-A8M]-05 OUTPUT
Posted by: KinCony Support - 04-14-2023, 03:16 AM - Forum: KC868-A8M - No Replies

Code:
#include "Arduino.h"
#include "PCF8574.h"

#define SDA 5
#define SCL 4

PCF8574 pcf8574_RE1(0x24,SDA,SCL);//DO
void setup()
{
    Serial.begin(115200);
for(int i=0;i<=7;i++)
{
   pcf8574_RE1.pinMode(i, OUTPUT);
}
   pcf8574_RE1.begin();

for(int i=0;i<=7;i++)
{
  pcf8574_RE1.digitalWrite(i, LOW);delay(200);
}
for(int i=0;i<=7;i++)
{
  pcf8574_RE1.digitalWrite(i, HIGH);delay(200);
}   
}

void loop()
{
  /******Output is all off by default, and can be turned
on or off manually when pressed by the keypad**************/
for(int i=0;i<=7;i++)
{
  pcf8574_RE1.digitalWrite(i, HIGH);delay(100);
}

}
[Arduino source code for KC868-A8M]-05 OUTPUT



Attached Files
.zip   KC868-A8M_OUTPUT.zip (Size: 664 bytes / Downloads: 724)
Print this item

  [Arduino source code for KC868-A8M]-04 LAN8720_UDP
Posted by: KinCony Support - 04-14-2023, 03:16 AM - Forum: KC868-A8M - No Replies

[Arduino source code for KC868-A8M]-04 LAN8720_UDP

Code:
#include <ETH.h>
#include <WiFiUdp.h>

#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

WiFiUDP Udp;                      //Create UDP object
unsigned int localUdpPort = 4196; //local port

// Set it based on the IP address of the router
IPAddress local_ip(192, 168, 1, 200);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 1, 1);

void setup()
{
  Serial.begin(115200);
  Serial.println();
   
  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); //start with ETH

  // write confir for static IP, gateway,subnet,dns1,dns2
  if (ETH.config(local_ip, gateway, subnet, dns, dns) == false) {
    Serial.println("LAN8720 Configuration failed.");
  }else{Serial.println("LAN8720 Configuration success.");}
 
/* while(!((uint32_t)ETH.localIP())) //wait for IP
  {

  }*/
  Serial.println("Connected");
  Serial.print("IP Address:");
  Serial.println(ETH.localIP());

  Udp.begin(localUdpPort); //begin UDP listener
}

void loop()
{
  int packetSize = Udp.parsePacket(); //get package size
  if (packetSize)                     //if have received data
  {
    char buf[packetSize];
    Udp.read(buf, packetSize); //read current data

    Serial.println();
    Serial.print("Received: ");
    Serial.println(buf);
    Serial.print("From IP: ");
    Serial.println(Udp.remoteIP());
    Serial.print("From Port: ");
    Serial.println(Udp.remotePort());

    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); //ready to send data
    Udp.print("Received: ");   
    Udp.write((const uint8_t*)buf, packetSize); //copy data to sender buffer
    Udp.endPacket();            //send data
  }
}



Attached Files
.zip   KC868-A8M_LAN8720_UDP.zip (Size: 1.13 KB / Downloads: 733)
Print this item

  [Arduino source code for KC868-A8M]-03 INPUT
Posted by: KinCony Support - 04-14-2023, 03:15 AM - Forum: KC868-A8M - No Replies

Code:
/*KC868-A8M input trigger output*/
#include "Arduino.h"
#include "PCF8574.h"

#define SDA 5
#define SCL 4
// Set i2c address
PCF8574 pcf8574_IN1(0x22,SDA,SCL);
PCF8574 pcf8574_RE(0x24,SDA,SCL);
unsigned long timeElapsed;
void setup()
{
    Serial.begin(115200);
    delay(1000);
    pcf8574_RE.pinMode(P0, OUTPUT);
    pcf8574_RE.pinMode(P1, OUTPUT);
    pcf8574_RE.pinMode(P2, OUTPUT);
    pcf8574_RE.pinMode(P3, OUTPUT);
    pcf8574_RE.pinMode(P4, OUTPUT);
    pcf8574_RE.pinMode(P5, OUTPUT);
    pcf8574_RE.pinMode(P6, OUTPUT);
    pcf8574_RE.pinMode(P7, OUTPUT);
   
    pcf8574_IN1.pinMode(P0, INPUT);
    pcf8574_IN1.pinMode(P1, INPUT);
    pcf8574_IN1.pinMode(P2, INPUT);
    pcf8574_IN1.pinMode(P3, INPUT);
    pcf8574_IN1.pinMode(P4, INPUT);
    pcf8574_IN1.pinMode(P5, INPUT);
    pcf8574_IN1.pinMode(P6, INPUT);
    pcf8574_IN1.pinMode(P7, INPUT);
    pcf8574_IN1.begin();
    pcf8574_RE.begin();
}

void loop()
{
uint8_t val1 = pcf8574_IN1.digitalRead(P0);
uint8_t val2 = pcf8574_IN1.digitalRead(P1);
uint8_t val3 = pcf8574_IN1.digitalRead(P2);
uint8_t val4 = pcf8574_IN1.digitalRead(P3);
uint8_t val5 = pcf8574_IN1.digitalRead(P4);
uint8_t val6 = pcf8574_IN1.digitalRead(P5);
uint8_t val7 = pcf8574_IN1.digitalRead(P6);
uint8_t val8 = pcf8574_IN1.digitalRead(P7);
if (val1==LOW) {
  pcf8574_RE.digitalWrite(P0,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P0,HIGH);
if (val2==LOW) {
  pcf8574_RE.digitalWrite(P1,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P1,HIGH);
if (val3==LOW)  {
  pcf8574_RE.digitalWrite(P2,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P2,HIGH);
if (val4==LOW)  {
  pcf8574_RE.digitalWrite(P3,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P3,HIGH);
if (val5==LOW)  {
  pcf8574_RE.digitalWrite(P4,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P4,HIGH);
if (val6==LOW)  {
  pcf8574_RE.digitalWrite(P5,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P5,HIGH);
if (val7==LOW)  {
  pcf8574_RE.digitalWrite(P6,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P6,HIGH);
if (val8==LOW)  {
  pcf8574_RE.digitalWrite(P7,LOW);
  delay(100);
  }
else pcf8574_RE.digitalWrite(P7,HIGH);

    delay(300);
}
[Arduino source code for KC868-A8M]-03 INPUT



Attached Files
.zip   KC868-A8M_INPUT.zip (Size: 822 bytes / Downloads: 754)
Print this item

  [Arduino source code for KC868-A8M]-02 DS18B20
Posted by: KinCony Support - 04-14-2023, 03:15 AM - Forum: KC868-A8M - Replies (2)

Code:
#include <DS18B20.h>

DS18B20 ds(14);   //IO13

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

void loop() {
 
    Serial.printf("Temperature: %.2f C\n",ds.getTempC());
    delay(1000);
}
[Arduino source code for KC868-A8M]-02 DS18B20



Attached Files
.zip   KC868-A8M_DS18B20.zip (Size: 514 bytes / Downloads: 762)
Print this item

  [Arduino source code for KC868-A8M]-01 ADC
Posted by: KinCony Support - 04-14-2023, 03:15 AM - Forum: KC868-A8M - No Replies

Code:
/*Code for KC868-A8S*/
#include "Arduino.h"

#define ANALOG_A1   34        // IO36 
#define ANALOG_A2   35        // IO39   
#define ANALOG_A3   39        // IO34   
#define ANALOG_A4   36        // IO35   
void setup()
{
    Serial.begin(115200);
    delay(1000);

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  if(analogRead(ANALOG_A1)!=0)
    {  Serial.printf("A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));delay(500);}
  if(analogRead(ANALOG_A2)!=0)
    {  Serial.printf("A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));delay(500);}
  if(analogRead(ANALOG_A3)!=0)
    {  Serial.printf("A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));delay(500);}
  if(analogRead(ANALOG_A4)!=0)
    {  Serial.printf("A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));delay(500);}

}
[Arduino source code for KC868-A8M]-01 ADC



Attached Files
.zip   KC868-A8M_ADC.zip (Size: 643 bytes / Downloads: 713)
Print this item

  [Arduino source code for KC868-A16S]-06 DS18B20
Posted by: KinCony Support - 04-14-2023, 02:47 AM - Forum: KC868-A16S - No Replies

Code:
#include <DS18B20.h>

#define A16S_RS485_RX  32
#define A16S_RS485_TX  33
#define DL 0
DS18B20 ds(14);

void setup() {
  Serial.begin(115200);
  Serial2.begin(115200,SERIAL_8N1,A16S_RS485_RX,A16S_RS485_TX); //A16S
  Serial2.println("A16S RS485 SEND OK");
  pinMode(DL,INPUT);
  Serial2.print(ds.getTempC());
  Serial2.println(" C");
}
void loop() {
  if(digitalRead(DL)==LOW)
  {
    delay(20);
     if(digitalRead(DL)==LOW)
  {
    Serial2.println("Download key ok");
    Serial2.print(ds.getTempC());
    Serial2.println(" C");
   
  }
  }
  while(Serial2.available()>0)
   {
    Serial2.print((char)Serial2.read());//print rs485 receive
   }
   delay(200);
}
[Arduino source code for KC868-A16S]-06 DS18B20



Attached Files
.zip   A16S_DS18B20.zip (Size: 852 bytes / Downloads: 728)
Print this item