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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,030
» Latest member: toachdiechngiec
» Forum threads: 3,977
» Forum posts: 20,163

Full Statistics

Online Users
There are currently 7 online users.
» 0 Member(s) | 3 Guest(s)
Google, bot

Latest Threads
N60 N30 N20 N10 ARM CPU f...
Forum: N30
Last Post: pvana
10 hours ago
» Replies: 24
» Views: 923
How can I control 170 sma...
Forum: Development
Last Post: yosetadi4321
Yesterday, 08:16 AM
» Replies: 2
» Views: 355
RS485 Modbus SHT30 sensor...
Forum: "KCS" v3 firmware
Last Post: admin
05-11-2026, 02:30 AM
» Replies: 4
» Views: 292
Current and Power not add...
Forum: N60
Last Post: edalquist
05-09-2026, 03:58 AM
» Replies: 10
» Views: 320
Python and arduino code
Forum: News
Last Post: admin
05-08-2026, 12:38 PM
» Replies: 1
» Views: 40
[SOLVED] N10 - no KWH sho...
Forum: N10
Last Post: admin
05-07-2026, 05:56 AM
» Replies: 7
» Views: 131
B24 Smart Controller Wiri...
Forum: B24
Last Post: admin
05-06-2026, 10:12 PM
» Replies: 2
» Views: 102
AIO Hybrid ESP32-S3 IO pi...
Forum: AIO Hybrid
Last Post: H_spadacini
05-06-2026, 10:03 AM
» Replies: 3
» Views: 596
T32M issue with Output 1
Forum: DIY Project
Last Post: BarbaraVikuvis
05-06-2026, 06:49 AM
» Replies: 4
» Views: 373
RTC DS3231 yaml code
Forum: KC868-A16v3
Last Post: admin
05-05-2026, 01:38 PM
» Replies: 1
» Views: 67

Wink 【Sensor series program】-#01-Arduino code of KC868-A6 and Hall Sensor
Posted by: KinCony Support - 05-20-2022, 03:11 AM - Forum: KC868-A6 - No Replies

【Sensor series program】-#01-Arduino code of KC868-A6 and Hall Sensor

Code:
/*【Sensor series program】Arduino code of KC868-A6 and Hall Sensor*/
/*When the Hall sensor is triggered, Turn on relay 1; Otherwise turn off relay1*/
#include "Wire.h"
#include"PCF8574.h"

PCF8574 pcf8574_RE(0x24,4,15);
int rawValue;

void setup(){

  pinMode(32,INPUT);
  Serial.begin(115200);
  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.begin();
  for(int i=0;i<6;i++)
  {
   pcf8574_RE.digitalWrite(i,HIGH);
  }
}

void loop(){
  rawValue=analogRead(32);
  Serial.println(rawValue);
  if(rawValue==0)
  {
     
      pcf8574_RE.digitalWrite(P0,LOW);
  }
  else {
      pcf8574_RE.digitalWrite(P0,HIGH);
  }
}
 
   

Print this item

  KC868 H32B in node red and home assistant
Posted by: ahmedwizza - 05-19-2022, 11:52 AM - Forum: KC868-HxB series Smart Controller - Replies (1)

Hello Engineer 

I faced some problem.when I active Alexa bridge and made switch .then connect Alexa node to controller by TCP out 
  all okay .... the sound control by Alexa is okay ...the switch appeared in Alexa app in my phone ...but I cant find the switch in Alexa entities in home assistant to control

as attached photos



Attached Files Thumbnail(s)
           
Print this item

Rainbow How to use tasmota for KC868-A32 via PCF8574 IIC extend GPIO
Posted by: KinCony Support - 05-18-2022, 02:50 AM - Forum: KC868-A32/A32 Pro - Replies (10)

How to use tasmota for KC868-A32 via PCF8574 IIC extend GPIO

   
The Tamplate code is:

{"NAME":"KC868-A32","GPIO":[32,0,1120,0,641,609,0,0,0,608,1,640,0,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,1],"FLAG":0,"BASE":1}
   

Set all Device port to  "OUTPUT"
   

   



Attached Files
.zip   ESP-Flasher-Windows-x64.zip (Size: 16.07 MB / Downloads: 835)
.zip   firmware-en-a32.zip (Size: 764.89 KB / Downloads: 855)
Print this item

  Lesson24 - home assistant remote access by FREE DuckDNS
Posted by: admin - 05-17-2022, 04:27 AM - Forum: Home automation training courses - Replies (5)


https://www.duckdns.org/

Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#06-KC868-E16S-RS485
Posted by: KinCony Support - 05-17-2022, 01:29 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#06-KC868-E16S-RS485
   

Code:
/*WWW.KINCONY.COM */
/*KC868-E16S CODE OF RS485*/
void setup(){
  Serial2.begin(9600,SERIAL_8N1,13,32);// IO13 is 485RX  IO32 is 485TX
}

void loop() {
Serial2.println("abcd123456789551");// send abcd123456789551
}



Attached Files
.zip   KC868-E16S-RS485.zip (Size: 469.31 KB / Downloads: 758)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#05-KC868-E16S-LAN8720_UDP
Posted by: KinCony Support - 05-17-2022, 01:28 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#05-KC868-E16S-LAN8720_UDP
   

Code:
/*www.kincony.com */
/* KC868-E16S CODE OF LAN8720-UDP */
#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
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.");}
 
  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-E16S-LAN8720_UDP.zip (Size: 1.11 KB / Downloads: 699)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#04-KC868-E16S-ADC_IN
Posted by: KinCony Support - 05-17-2022, 01:25 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#04-KC868-E16S-ADC_IN
   

Code:
/*www.kinocny.com */
/*KC868-E16S CODE OF ADC-IN*/

#include "Arduino.h"

#define ANALOG_A1   36
#define ANALOG_A2   35
#define ANALOG_A3   34
#define ANALOG_A4   39

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

  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("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));}
  if(analogRead(ANALOG_A2)!=0)  {Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));}
  if(analogRead(ANALOG_A3)!=0)  {Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));}
  if(analogRead(ANALOG_A4)!=0)  {Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));}
  delay(50);
}



Attached Files
.zip   KC868-E16S-ADC_IN.zip (Size: 674 bytes / Downloads: 658)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#03-KC868-E16S-8574-DO
Posted by: KinCony Support - 05-17-2022, 01:21 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#03-KC868-E16S-8574-DO
   

Code:
/*KC868-E16S Code of PCF8574 OUTPUT  CONTROL RELAYS*/
/*Press and hold on key Download ,relays ON,   release key relays OFF*/
#include "Arduino.h"
#include "PCF8574.h"

/*Set pcf8574 Output i2c address and SDA IO16/ SCL IO15*/
#define buttonPin 0
PCF8574 pcf8574_1(0x21,16,15);
PCF8574 pcf8574_2(0x25,16,15);

void setup()
{
    Serial.begin(115200);
/* Set pinMode to OUTPUT*/
   pinMode(buttonPin, INPUT);// key download  IO0

    pcf8574_1.pinMode(P0, OUTPUT);
  pcf8574_1.pinMode(P1, OUTPUT);
  pcf8574_1.pinMode(P2, OUTPUT);
  pcf8574_1.pinMode(P3, OUTPUT);
  pcf8574_1.pinMode(P4, OUTPUT);
  pcf8574_1.pinMode(P5, OUTPUT);
  pcf8574_1.pinMode(P6, OUTPUT);
  pcf8574_1.pinMode(P7, OUTPUT);

  pcf8574_2.pinMode(P0, OUTPUT);
  pcf8574_2.pinMode(P1, OUTPUT);
  pcf8574_2.pinMode(P2, OUTPUT);
  pcf8574_2.pinMode(P3, OUTPUT);
  pcf8574_2.pinMode(P4, OUTPUT);
  pcf8574_2.pinMode(P5, OUTPUT);
  pcf8574_2.pinMode(P6, OUTPUT);
  pcf8574_2.pinMode(P7, OUTPUT);

  pcf8574_1.begin();
  pcf8574_2.begin();
}

void loop()
{
if(digitalRead(buttonPin)==0)
{
      pcf8574_1.digitalWrite(P0, LOW);  delay(100);
    pcf8574_1.digitalWrite(P1, LOW);  delay(100);
    pcf8574_1.digitalWrite(P2, LOW);  delay(100);
    pcf8574_1.digitalWrite(P3, LOW);  delay(100);
    pcf8574_1.digitalWrite(P4, LOW);  delay(100);
    pcf8574_1.digitalWrite(P5, LOW);  delay(100);
    pcf8574_1.digitalWrite(P6, LOW);  delay(100);
    pcf8574_1.digitalWrite(P7, LOW);  delay(100);
 
    pcf8574_2.digitalWrite(P0, LOW);  delay(100);
    pcf8574_2.digitalWrite(P1, LOW);  delay(100);
    pcf8574_2.digitalWrite(P2, LOW);  delay(100);
    pcf8574_2.digitalWrite(P3, LOW);  delay(100); 
    pcf8574_2.digitalWrite(P4, LOW);  delay(100);
    pcf8574_2.digitalWrite(P5, LOW);  delay(100);
    pcf8574_2.digitalWrite(P6, LOW);  delay(100);
    pcf8574_2.digitalWrite(P7, LOW);  delay(100);
  }
  else
  {
    pcf8574_1.digitalWrite(P0, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P1, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P2, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P3, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P4, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P5, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P6, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P7, HIGH);  delay(100);
 
    pcf8574_2.digitalWrite(P0, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P1, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P2, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P3, HIGH);  delay(100); 
    pcf8574_2.digitalWrite(P4, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P5, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P6, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P7, HIGH);  delay(100);
  }
}



Attached Files
.zip   KC868-E16S-8574-DO.zip (Size: 911 bytes / Downloads: 648)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#02-KC868-E16S-8574-DI
Posted by: KinCony Support - 05-17-2022, 01:17 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#02-KC868-E16S-8574-DI
   

Code:
/*KC868-E16S pcf8574 -digital input code*/
#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address
PCF8574 pcf8574_IN1(0x22,16,15);
PCF8574 pcf8574_IN2(0x24,16,15);
void setup()
{
    Serial.begin(115200);
    delay(1000);

  pcf8574_IN1.begin();
  pcf8574_IN2.begin();


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_IN2.pinMode(P0, INPUT);
pcf8574_IN2.pinMode(P1, INPUT);
pcf8574_IN2.pinMode(P2, INPUT);
pcf8574_IN2.pinMode(P3, INPUT);
pcf8574_IN2.pinMode(P4, INPUT);
pcf8574_IN2.pinMode(P5, INPUT);
pcf8574_IN2.pinMode(P6, INPUT);
pcf8574_IN2.pinMode(P7, INPUT);
}

void loop()
{
   if (pcf8574_IN1.digitalRead(P0)==0)  {Serial.println("KEY1 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P1)==0)  {Serial.println("KEY2 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P2)==0)  {Serial.println("KEY3 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P3)==0)  {Serial.println("KEY4 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P4)==0)  {Serial.println("KEY5 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P5)==0)  {Serial.println("KEY6 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P6)==0)  {Serial.println("KEY7 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P7)==0)  {Serial.println("KEY8 PRESSED");}delay(100);
   
   if (pcf8574_IN2.digitalRead(P0)==0)  {Serial.println("KEY9 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P1)==0)  {Serial.println("KEY10 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P2)==0)  {Serial.println("KEY11 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P3)==0)  {Serial.println("KEY12 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P4)==0)  {Serial.println("KEY13 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P5)==0)  {Serial.println("KEY14 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P6)==0)  {Serial.println("KEY15 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P7)==0)  {Serial.println("KEY16 PRESSED");}delay(100);   

 
}
   



Attached Files
.zip   KC868-E16S-8574-DI.zip (Size: 783 bytes / Downloads: 672)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode
Posted by: KinCony Support - 05-17-2022, 01:07 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode
   

Code:
/*www.kinocny.com */
/*KC868-E16S CODE OF 433MHz decode*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

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

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
.zip   KC868-E16S-433-decode.zip (Size: 669 bytes / Downloads: 633)
Print this item