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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,001
» Latest member: qbtobc
» Forum threads: 2,433
» Forum posts: 12,575

Full Statistics

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

Latest Threads
AS ESPHome yaml for home ...
Forum: KinCony AS
Last Post: eyevisions
2 hours ago
» Replies: 5
» Views: 312
KC868-A8 board esphome + ...
Forum: KC868-A8
Last Post: gnetinternet@gmail.com
Today, 07:19 AM
» Replies: 10
» Views: 73
"KCS" v3.0.3 firmware for...
Forum: "KCS" firmware system
Last Post: admin
Yesterday, 10:01 PM
» Replies: 0
» Views: 18
Kc868-a16 v1.6
Forum: DIY Project
Last Post: admin
Yesterday, 11:17 AM
» Replies: 1
» Views: 19
KCS firmware - MQTT LWT?
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 11:15 AM
» Replies: 35
» Views: 3,334
"KCS" v2.2.7 firmware BIN...
Forum: "KCS" firmware system
Last Post: admin
Yesterday, 11:09 AM
» Replies: 0
» Views: 52
Help whit update Cold CPU...
Forum: KC868-HxB series Smart Controller
Last Post: admin
Yesterday, 08:36 AM
» Replies: 3
» Views: 24
Clarification on CT Clamp...
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
Yesterday, 12:40 AM
» Replies: 1
» Views: 23
KC868-AIO connecting to E...
Forum: KC868-AIO
Last Post: admin
Yesterday, 12:37 AM
» Replies: 1
» Views: 23
Digital input 11.2v
Forum: KC868-A8
Last Post: admin
Yesterday, 12:35 AM
» Replies: 1
» Views: 5

Heart [Arduino IDE demo source code for KC868-A6]--#04-Ds18b20_code
Posted by: KinCony Support - 04-25-2022, 08:49 AM - Forum: KC868-A6 - Replies (4)

[Arduino IDE demo source code for KC868-A6]--#04-Ds18b20_code

Code:
/*KC868-A6 DS18B20 CODE*/
#include <DS18B20.h>
DS18B20 ds1(32);  //channel-1-DS18b20
DS18B20 ds2(33);  //channel-2-DS18b20

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

void loop()
{
  Serial.print("Temperature1:");
  Serial.print(ds1.getTempC());
  Serial.print(" C /");
  delay(500);
  Serial.print("Temperature2:");
  Serial.print(ds2.getTempC());
  Serial.print(" C /\n");
  delay(500); 
}

.zip   4.ds18b20.zip (Size: 674 bytes / Downloads: 295)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#03-DAC_code
Posted by: KinCony Support - 04-25-2022, 08:48 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#03-DAC_code

Code:
/*KC868-A6 DAC CODE*/
#define DAC1 26
#define DAC2 25

void setup() {
 
}

void loop() {
  int Value = 127; //255= 10V
 
  dacWrite(DAC1, 127);
  delay(500);
  dacWrite(DAC2, 255);
  delay(500);
}


.zip   3.DAC.zip (Size: 573 bytes / Downloads: 258)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#02-ADC_code
Posted by: KinCony Support - 04-25-2022, 08:46 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#02-ADC_code

Code:
/*KC868-A6 ADC code*/
#include "Arduino.h"
#include "PCF8574.h"

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

void setup()
{
    Serial.begin(115200);
  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  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));
  Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));
  Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));
  delay(500);
}

.zip   ADC.zip (Size: 547 bytes / Downloads: 254)

Print this item

Heart [Arduino IDE demo source code for KC868-A6]--#01-nRF24L01_code
Posted by: KinCony Support - 04-25-2022, 08:43 AM - Forum: KC868-A6 - No Replies

[Arduino IDE demo source code for KC868-A6]--#01-nRF24L01_code
Receive code

Code:
/*Receive code*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 22
#define CSN_PIN 5

const uint64_t id = 0xE8E8F0F0E1LL;

RF24 radio(CE_PIN, CSN_PIN);

#define SIZE 32            // this is the maximum for this example. (minimum is 1)
char buffer[SIZE + 1];     // for the RX node
uint8_t counter = 0;       // for counting the number of received payloads

void setup()
{
   Serial.begin(9600);
   delay(1000);
   Serial.println("Nrf24L01 Receiver Starting");
   radio.begin();
   radio.openReadingPipe(1,id);
   radio.startListening();;
}

void loop()
{
    if (radio.available()) {         // is there a payload?
      radio.read(&buffer, SIZE);     // fetch payload from FIFO
      Serial.print("Received:");
      Serial.print(buffer);          // print the payload's value
      Serial.print(" - ");
      Serial.println(counter++);     // print the received counter
    }
}


Transmitter code

Code:
/*Transmitter code*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 22
#define CSN_PIN 5

const uint64_t abc = 0xE8E8F0F0E1LL;

RF24 radio(CE_PIN, CSN_PIN);
char data[] = "Hello World, KinCony";

void setup()
{
   Serial.begin(9600);
   radio.begin();
   radio.openWritingPipe(abc);
}

void loop()
{
   radio.write( data, sizeof(data) );
}
   

.zip   1.nRF24L01.zip (Size: 1.5 KB / Downloads: 275)


.txt   KC868-A6_pin_define.txt (Size: 421 bytes / Downloads: 252)

Print this item

  KC868-A6 ESP32 home automation relay module released!
Posted by: admin - 04-25-2022, 07:10 AM - Forum: News - Replies (6)

We have designed KC868-A6 smart controller , many hardware resource for you to use, added LoRa and nRF24L01 wireless module interface and SSD1306 OLED and RS485 and RTC clock chip DS1307.
 
[Image: KC868-A6-1_01.jpg]
[Image: KC868-A6-1_02.jpg]
[Image: KC868-A6-1_03.jpg]
[Image: KC868-A6-1_04.jpg]
[Image: KC868-A6-1_05.jpg]

Print this item

  Lesson18 - add ZigBee PIR motion sensor to auto control light in home assistant
Posted by: admin - 04-25-2022, 01:41 AM - Forum: Home automation training courses - No Replies


1. SONOFF SNZB-03 configure for home assistant by Zigbee2mqtt

sensor:
  - platform: mqtt
    name: pir-state
    state_topic: "zigbee2mqtt/0x00124b00251e530f"
    value_template: "{{ value_json.occupancy }}"   

Note: ID need replace with your device. such as '0x00124b00251e530f'

2. create a new automation:

create automation-1 (turn on light)
-------------------------------------------
Trigger type: State
Entity: pir-state
To: True


Actions:
Action type: Call service
Service: Switch:Switch: Turn on
+ Choose entity

create automation-2 (turn off light)
------------------------------------------
Trigger type: State
Entity: pir-state
To: False


Actions:
Action type: Call service
Service: Switch:Switch: Turn off
+ Choose entity

Print this item

  [Arduino IDE demo source code for KC868-SERVER]--#04-Key press code
Posted by: KinCony Support - 04-22-2022, 01:06 AM - Forum: KC868-Server Raspberry Pi4 local server - No Replies

Code:
void setup() {
  Serial.begin(9600);
  pinMode(0,INPUT);// Key S5  is connected to IO0   set IO0 to input mode
}
void loop() {
  if(digitalRead(0)==LOW){
    Serial.println("Key S5 Pressed!");
    delay(100);
  }
  if(digitalRead(0)==HIGH){
   Serial.println("Key S5 Not Pressed!");
   delay(1000);
   }
}
   
   

Print this item

  [Arduino IDE demo source code for KC868-SERVER]--#03-IR_send code
Posted by: KinCony Support - 04-21-2022, 08:35 AM - Forum: KC868-Server Raspberry Pi4 local server - No Replies

Code:
#include <IRremote.h>
IRsend irsend_23(23);      // set ir_send pin IO23
uint8_t sRepeats = 0;

void setup() {

  Serial.begin(9600);
  pinMode(0,INPUT);
  IrSender.begin(23, ENABLE_LED_FEEDBACK);
  IrSender.enableIROut(38);
}

void loop() {
  /*the raw_code of your remote button,you can get it by our
    example [Arduino IDE demo source code for KC868-SERVER]--#02-IR_RECEIVE code*/
        Serial.println("Turn on LED");
        irsend_23.sendNECRaw(0xF807FF00, sRepeats);   //  0xF807FF00  is the raw_code  of led on
        delay(1000);
        Serial.println("Turn off LED");
        irsend_23.sendNECRaw(0xF906FF00, sRepeats);  //   0xF906FF00 is the raw_code  of led Off
        delay(1000);
}
   
This code will turn on LED and delay 1s turn off LED
   
The raw_data of LED on is 0xF807FF00  ,you can decode the data by our example code
"[Arduino IDE demo source code for KC868-SERVER]--#02-IR_RECEIVE code"
   

Print this item

  [Arduino IDE demo source code for KC868-SERVER]--#02-IR_RECEIVE code
Posted by: KinCony Support - 04-21-2022, 06:16 AM - Forum: KC868-Server Raspberry Pi4 local server - No Replies

Code:
#include <IRremote.h>
IRrecv irrecv_22(22);// set ir_receive pin IO22
void setup() {

  Serial.begin(9600);
  irrecv_22.enableIRIn();
}

void loop() {
    if (irrecv_22.decode()) {
      if(irrecv_22.decodedIRData.decodedRawData!=(0)){
        Serial.print("irCode address: ");           
        Serial.println(irrecv_22.decodedIRData.address,HEX);
        Serial.print("irCode command: ");           
        Serial.println(irrecv_22.decodedIRData.command,HEX);
        Serial.print("irCode decodedRawData: ");           
        Serial.println(irrecv_22.decodedIRData.decodedRawData,HEX);
      }
      IrReceiver.resume();
    }
}
           

Print this item

  [Arduino IDE demo source code for KC868-SERVER]--#01-433Mhz-RF-RECEIVE code
Posted by: KinCony Support - 04-21-2022, 05:36 AM - Forum: KC868-Server Raspberry Pi4 local server - No Replies

Code:
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(13));  //The receive PIN is IO 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();
  }
}
       

Print this item