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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,367
» Latest member: talljane
» Forum threads: 2,574
» Forum posts: 13,313

Full Statistics

Online Users
There are currently 48 online users.
» 0 Member(s) | 34 Guest(s)
Amazonbot, Bytespider, Crawl, Google, PetalBot, Yandex, bot

Latest Threads
How can I power multiple ...
Forum: KC868-A series and Uair Smart Controller
Last Post: ingersoj
2 hours ago
» Replies: 11
» Views: 121
how to use AS ESP32-S3 vo...
Forum: KinCony AS
Last Post: biofects
3 hours ago
» Replies: 13
» Views: 455
change wake up name
Forum: KinCony AS
Last Post: admin
4 hours ago
» Replies: 13
» Views: 95
Problem with IFTTT automa...
Forum: "KCS" firmware system
Last Post: admin
6 hours ago
» Replies: 6
» Views: 45
A32 Pro ESPHome yaml incl...
Forum: KC868-A32/A32 Pro
Last Post: admin
7 hours ago
» Replies: 18
» Views: 185
KC868-A2 ESP32 I/O pin de...
Forum: KC868-A2
Last Post: admin
7 hours ago
» Replies: 8
» Views: 2,266
Need help with configurat...
Forum: KC868-HxB series Smart Controller
Last Post: admin
Yesterday, 04:32 AM
» Replies: 32
» Views: 395
ESP32 S3 set up issue
Forum: Extender module
Last Post: admin
12-17-2024, 11:43 PM
» Replies: 10
» Views: 68
KC868-A8 Schematic
Forum: KC868-A8
Last Post: admin
12-17-2024, 11:40 PM
» Replies: 7
» Views: 51
"KCS" v2.2.8 firmware BIN...
Forum: "KCS" firmware system
Last Post: admin
12-17-2024, 11:38 PM
» Replies: 2
» Views: 179

  [Arduino source code for KC868-AP]-05 -PWM_Output
Posted by: KinCony Support - 01-03-2023, 01:48 AM - Forum: KC868-AP / ADR - No Replies

 [Arduino source code for KC868-AP]-05 -PWM_Output

Code:
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#define SDA  4
#define SCL  16
// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40);
int brightness = 0;   
int fadeAmount = 64;   
void setup() {
  Serial.begin(9600);
  Serial.println("16 channel PWM test!");
  Wire.begin(SDA,SCL,100000);
  pwm.begin();
  pwm.setOscillatorFrequency(27000000);
 
  pwm.setPWMFreq(1000);  // 1600 This is the maximum PWM frequency

  // if you want to really speed stuff up, you can go into 'fast 400khz I2C' mode
  // some i2c devices dont like this so much so if you're sharing the bus, watch
  // out for this!
  Wire.setClock(400000);
}

void loop() {
  // Drive each PWM in a 'wave'

   for (uint8_t pwmnum=0; pwmnum < 16; pwmnum++) {
      pwm.setPWM(pwmnum, 0, brightness );
    }
    brightness = brightness + fadeAmount;
   if (brightness == 0 || brightness == 4096) {
    fadeAmount = -fadeAmount ;
  }
  Serial.println(brightness);             
   delay(20);
   
 
   

 
}



Attached Files
.zip   KC868-AP-PWM.zip (Size: 1.05 KB / Downloads: 201)
Print this item

  [Arduino source code for KC868-AP]-04 _digital_input
Posted by: KinCony Support - 01-03-2023, 01:43 AM - Forum: KC868-AP / ADR - No Replies

 [Arduino source code for KC868-AP]-04 _digital_input

Code:
#include "Arduino.h"
#include "PCF8574.h"
#define AP_8574_SDA 4
#define AP_8574_SCL 16

// Set i2c address
PCF8574 pcf8574_1(0x22,AP_8574_SDA,AP_8574_SCL);
PCF8574 pcf8574_2(0x21,AP_8574_SDA,AP_8574_SCL);

unsigned long timeElapsed;
void setup()
{
Serial.begin(115200);
delay(1000);
pinMode(34, INPUT);// input 17
pinMode(35, INPUT);// input 18
pcf8574_1.pinMode(P0, INPUT);
pcf8574_1.pinMode(P1, INPUT);
pcf8574_1.pinMode(P2, INPUT);
pcf8574_1.pinMode(P3, INPUT);
pcf8574_1.pinMode(P4, INPUT);
pcf8574_1.pinMode(P5, INPUT);
pcf8574_1.pinMode(P6, INPUT);
pcf8574_1.pinMode(P7, INPUT);

pcf8574_2.pinMode(P0, INPUT);
pcf8574_2.pinMode(P1, INPUT);
pcf8574_2.pinMode(P2, INPUT);
pcf8574_2.pinMode(P3, INPUT);
pcf8574_2.pinMode(P4, INPUT);
pcf8574_2.pinMode(P5, INPUT);
pcf8574_2.pinMode(P6, INPUT);
pcf8574_2.pinMode(P7, INPUT);
pcf8574_1.begin();
pcf8574_2.begin();

}

void loop()
{
uint8_t val1 = pcf8574_1.digitalRead(P0);
uint8_t val2 = pcf8574_1.digitalRead(P1);
uint8_t val3 = pcf8574_1.digitalRead(P2);
uint8_t val4 = pcf8574_1.digitalRead(P3);
uint8_t val5 = pcf8574_1.digitalRead(P4);
uint8_t val6 = pcf8574_1.digitalRead(P5);
uint8_t val7 = pcf8574_1.digitalRead(P6);
uint8_t val8 = pcf8574_1.digitalRead(P7);

uint8_t val9 = pcf8574_2.digitalRead(P0);
uint8_t val10 = pcf8574_2.digitalRead(P1);
uint8_t val11 = pcf8574_2.digitalRead(P2);
uint8_t val12 = pcf8574_2.digitalRead(P3);
uint8_t val13 = pcf8574_2.digitalRead(P4);
uint8_t val14 = pcf8574_2.digitalRead(P5);
uint8_t val15 = pcf8574_2.digitalRead(P6);
uint8_t val16 = pcf8574_2.digitalRead(P7);
 
if (val1==LOW) Serial.println("KEY1 PRESSED");
if (val2==LOW) Serial.println("KEY2 PRESSED");
if (val3==LOW) Serial.println("KEY3 PRESSED");
if (val4==LOW) Serial.println("KEY4 PRESSED");
if (val5==LOW) Serial.println("KEY5 PRESSED");
if (val6==LOW) Serial.println("KEY6 PRESSED");
if (val7==LOW) Serial.println("KEY7 PRESSED");
if (val8==LOW) Serial.println("KEY8 PRESSED");

if (val9==LOW) Serial.println("KEY9 PRESSED");
if (val10==LOW) Serial.println("KEY10 PRESSED");
if (val11==LOW) Serial.println("KEY11 PRESSED");
if (val12==LOW) Serial.println("KEY12 PRESSED");
if (val13==LOW) Serial.println("KEY13 PRESSED");
if (val14==LOW) Serial.println("KEY14 PRESSED");
if (val15==LOW) Serial.println("KEY15 PRESSED");
if (val16==LOW) Serial.println("KEY16 PRESSED");
if(digitalRead(34)== LOW) Serial2.println("KEY17 PRESSED");
if(digitalRead(35)== LOW) Serial2.println("KEY18 PRESSED");
    delay(100);
}



Attached Files
.zip   KC868-AP8574-DI.zip (Size: 886 bytes / Downloads: 192)
Print this item

  [Arduino source code for KC868-AP]-03 _RS485_communication
Posted by: KinCony Support - 01-03-2023, 01:36 AM - Forum: KC868-AP / ADR - No Replies

 [Arduino source code for KC868-AP]-03 _RS485_communication

Code:
void setup() {
  Serial.begin(115200);
  Serial2.begin(115200,SERIAL_8N1,33,14);
   Serial2.println("RS485 SEND is OK!!");
   Serial2.println("******************");
 
}

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-AP-485.zip (Size: 855 bytes / Downloads: 176)
Print this item

  [Arduino source code for KC868-AP]-02 _UDP_communication
Posted by: KinCony Support - 01-03-2023, 01:33 AM - Forum: KC868-AP / ADR - No Replies

 [Arduino source code for KC868-AP]-02 _UDP_communication

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-AP_LAN8720_UDP.zip (Size: 1.13 KB / Downloads: 178)
Print this item

  [Arduino source code for KC868-AP]-01 _relay_control
Posted by: KinCony Support - 01-03-2023, 01:24 AM - Forum: KC868-AP / ADR - No Replies

 [Arduino source code for KC868-AP]-01 _relay_control

Code:
void setup() {
  pinMode(13,OUTPUT);
  pinMode(2,OUTPUT);

}

// the loop function runs over and over again forever
void loop() {


  digitalWrite(2, HIGH);
  delay(1000);
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(2, LOW);
  delay(1000);
  digitalWrite(13, LOW);

}



Attached Files
.zip   KC868_AP_relay.zip (Size: 535 bytes / Downloads: 193)
Print this item

  Kincony A16 - PIR motion sensor
Posted by: sonalikaatc@gmail.com - 01-02-2023, 03:28 PM - Forum: KC868-A16 - Replies (17)

HI,

I have used the KC686 A16 board for pir motion sensor model HC-SR501,

my config is
- platform: gpio
    name: "a16-input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
    device_class: motion


My output is stuck at clear and no motion is detected.

Please help ..
THANKS

Print this item

  Expand
Posted by: Vulcan - 01-01-2023, 06:52 AM - Forum: KC868-A6 - Replies (1)

With the 868-A6 can you extend the number of relays through the I2C bus or by some other means? If it can be expanded what do I need? Is there a limit of sensors on the I2C? I read somewhere that with the RF module there is no limit if one is using that option. Can you explain how the RF module provides sensor expansion please?
Given the A6 has not wired Ethernet, is there any options to power it from an injector or should we consider the A4 instead?
If in our project we wish to run two A6 units can they be linked (master/slave) or are they separate? We are creating an automated garden and greenhouse system including irrigation management and monitoring, vent control, multiple water and air temps, soil moisture and acidic levels, sunlight and baro pressures. We wish to be sure the A6 relay control can be expanded and sensors quantities are not limited. 

We are also trying to determine if a closed loop system with rules and thresholds can me met with Tasmota or if we need to write our own code, any advice would be greatly appreciated. 

Regarding the RF module option on the A6, when its installed, how is the plastic cover meant to be installed since the RF module protrudes outside the case? It would seem I either bought the wrong case or we are expected to cut out part of the case....please advise.    

Print this item

  KC868-AP ESP32 PWM Dimmer Released
Posted by: admin - 12-30-2022, 08:31 AM - Forum: News - No Replies

We have designed KC868-AP. It is a ESP32 16 channel PWM dimmer board. It use PCA9685. The PCA9685 component represents a PCA9685 12-bit PWM driver. It uses I²C Bus for communication. every channel output have MAX 3A driver chip. KC868-AP support use by ESPHome in home assistant. It also have digital input and relay output.
[Image: KC868-AP-1_01.jpg]
[Image: KC868-AP-1_02.jpg]
[Image: KC868-AP-1_03.jpg]
[Image: KC868-AP-1_04.jpg]

Print this item

  Upcoming house build
Posted by: bluepr0 - 12-29-2022, 01:48 PM - Forum: DIY Project - Replies (10)

Hi!

I'm in the process of researching to build a house and have a centralised place to control lights, blinds, etc.

Needs & Goals

  1. Have ESPHome Ethernet boards with relays I can control using regular light switches (momentary switches too) or through home assistants automation. This could be used for lights, blind motors, etc. Won’t need more than 16A per relay
  2. Have ESPHome Ethernet boards with PWM dimming capability for 24V analog LEDs with 3/4A Per channel. I created 1 channel mosfet board as a proof of concept dimmer with LEDC component from ESPHome and it works okay.

Questions
  1. As I understand relay boards will work with switches, but Would relay boards work also with temporary switches / push button?
  2. Are these board 0 delay when activating the relays? My main goal is to have an immediate response from the moment the switch or the command is triggered to when the relay turns on. I have seen some videos where a lot of relays are turned on at the same time and they seem slow.
  3. Is there any video of relay and dimmer board using ESPHome to see the speed? What’s the max Amp per mosfet channel?
  4. I’m honestly VERY lost on the product line. I have seen KC868-A8 could be a good fit (at least to do an initial test). A 16 relay version doesn’t seem to exist?. KC868-E16S seems another interesting one but it goes really high on price so I will need to be 100% sure about speed
  5. I’m still in research phase but I’m assuming a house will need at least 32 relays, and might or might not be all boards in the same placement. So I’m thinking it might not be a good idea to pick one big board but maybe several smaller ones?
  6. What products do you guys would recommend?

Thanks!

Print this item

  KC868-H32B Pro firmware upload network tool
Posted by: admin - 12-29-2022, 02:29 AM - Forum: KC868-HxB series Smart Controller - Replies (2)

You can use this network tool update KC868-H32B Pro controller by ethernet cable.

.zip   NET_REMOTE_IAP_V1.0.zip (Size: 9.07 KB / Downloads: 372)
   

Print this item