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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,369
» Latest member: talljane
» Forum threads: 2,574
» Forum posts: 13,305

Full Statistics

Online Users
There are currently 45 online users.
» 0 Member(s) | 29 Guest(s)
AhrefsBot, Bing, Bytespider, Crawl, Go-http-client, Google, PetalBot, bot

Latest Threads
KC868-A2 ESP32 I/O pin de...
Forum: KC868-A2
Last Post: tugra
3 hours ago
» Replies: 7
» Views: 2,261
change wake up name
Forum: KinCony AS
Last Post: gal
11 hours ago
» Replies: 12
» Views: 78
A32 Pro ESPHome yaml incl...
Forum: KC868-A32/A32 Pro
Last Post: xarouli5
Today, 06:38 AM
» Replies: 17
» Views: 181
Need help with configurat...
Forum: KC868-HxB series Smart Controller
Last Post: admin
Today, 04:32 AM
» Replies: 32
» Views: 393
ESP32 S3 set up issue
Forum: Extender module
Last Post: admin
Yesterday, 11:43 PM
» Replies: 10
» Views: 66
KC868-A8 Schematic
Forum: KC868-A8
Last Post: admin
Yesterday, 11:40 PM
» Replies: 7
» Views: 49
"KCS" v2.2.8 firmware BIN...
Forum: "KCS" firmware system
Last Post: admin
Yesterday, 11:38 PM
» Replies: 2
» Views: 172
Dimensions/drawings of bo...
Forum: Schematic and diagram
Last Post: admin
Yesterday, 11:37 PM
» Replies: 1
» Views: 22
how to use AS ESP32-S3 vo...
Forum: KinCony AS
Last Post: admin
12-16-2024, 10:55 PM
» Replies: 12
» Views: 448
Problem with IFTTT automa...
Forum: "KCS" firmware system
Last Post: admin
12-16-2024, 10:53 PM
» Replies: 5
» Views: 34

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: 272)

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: 269)

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: 291)


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

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

Wink [Case Study-01]: KC868-A4 Green house temperature monitoring
Posted by: admin - 04-21-2022, 01:35 AM - Forum: DIY Project - Replies (1)

[Image: kc868-a4-email.jpg]
In this series, we will analyze examples of the application of Kincony controllers in solving cases from practical applications. Practical cases are usually not complex, but they solve important things in the production process. In some cases, mistakes can cause large losses in production. Such systems need to be approached seriously.
author: wrote by Nebojsa from Croatia
 
Case study:  Greenhouse temperature management
The user owns a greenhouse for growing vegetables. Summer temperature inside the greenhouse should not exceed 35oC. At a temperature of > 40oC the plants begin to be irreversibly destroyed.
When the temperature reaches 30oC, the automation system should immediately send an e-mail warning to the responsible person and start the industrial fans to injecting cooler air. If the temperature continues to rise and reaches (set + 4oC) 34oC, the system should start opening the sides via automatic actuators.
When the temperature drops below 30oC, it is necessary to stop the ventilation and close the sides.
Reading the current temperature inside the greenhouse, and changing the system parameters can be done through the website on the local network.
 
We will use these components:
[Image: kc868-a4.jpg]
KC868-A4 controller
[Image: ds18b20-1.png][Image: ds18b20-2.jpg]
Temperature sensor DS18B20
[Image: contact.jpg][Image: 2NO.jpg][Image: 2NC.jpg]
Contactors, 1 x 2NO; 1 x 1NO – 1 NC
Program structure:
[Image: Program-structure-1.png]
[Image: Program-structure-2.png]This block enable data entry over LAN Web. Start any web browser and in address field enter IP what see after start program over Arduino IDE (for example: 192.168.8.153 as can see on screen)
Programing details
In my series of case studies will not so much fokusing on programming details. Some interesting parts of programs will be comented in source code.
I think you have read the published articles about the KC868-A4 controller, but to note in the Tools menu you should choose Board: NodeMCU 32S.
Include the necessary libraries via Manage Libraries ...
Included libraries:
#include <WiFi.h>               // Enables network connection.
#include <AsyncTCP.h>           // This is a fully asynchronous TCP library
#include <ESPAsyncWebServer.h>  // Async HTTP and WebSocket Server
#include <OneWire.h>            // Access 1-wire devices as temp. sensors
#include <DallasTemperature.h>  // Library for Dallas Temperature ICs
#include "ESP32_MailClient.h"   // Mail Client Arduino Library for ESP32
#include "time.h"               // Date and Time functions, NTP sync.
 
 
Slanje maila preko KC868-A4
We recommend that you create a new mail, and do not use your existing mail account. This mail will be used to send emails. On this occasion, I opened a new gmail.com account via the link.
In the Select app field, choose mail and password.
The SMTP server settings for the sender email.

  • SMTP Server: gmail.com
  • SMTP username: Complete Gmail address
  • SMTP password: Your Gmail password
  • SMTP port (TLS): 587
  • SMTP port (SSL): 465
  • SMTP TLS/SSL required: yes
 
// To send Email using Gmail use port 465 (SSL) and SMTP Server smtp.gmail.com
const String emailSenderAccount  = "your mail@gmail.com";
const String emailSenderPassword = "your password";
const String smtpServer          = "smtp.gmail.com";
const int    smtpServerPort      = 465;
 
The mailing address for reception, can be our existing mail or any other.
 
KC868-A4 Mailing source program download here.
 
Run the temperature mailing notification
Start Tools -> Serial monitor
First start WiFi connecting over assign SSID and password of the router WiFi.
Remember this IP address, will need later.
[Image: arduino-serial.jpg]
The program provided the date and time via an internet NTP server. It is important for real time the temperature monitoring. After this program read temperature from DS18B20 sensor.
As the case study defined, the temperature less than 30oC mean normal situation, no any action and there is no need to turn on the cooling, the fan stay Off and wall is closed.
[Image: temperature-output-1.jpg]
After the temperature exceeds the set limit (30oC), ventilation is switched on (Fan -> ON), system send Alert mail to defined address, but the wall actuators stay closed.
If the temperature continues to rise and reaches 4oC more than the set limit, the actuator is started to open the sides of the greenhouse. State: Fan -> On; Wall -> Open.
[Image: temperature-output-2.jpg]
If the temperature starts to drop, the fan will continue to run until it falls below the set limit. The sides will also be open during this time. When the temperature falls below the set limit, the system sends an e-mail to the user to inform him that the temperature has returned to normal, the fan is stopped and the side walls of the greenhouse are closed.
[Image: temperature-output-3.jpg]
Received mail when temperature goes over the defined limit:
[Image: temperature-output-4.jpg]
[Image: alarm-mail.jpg]
Received mail when temperature again become the normal:
[Image: alarm-mail-2.jpg]
[Image: alarm-mail-3.jpg]
Temperature readings and settings can be performed via a web browser. We need to start our web browser (any), enter the IP address obtained at the beginning, we will get the web page as shown below.
[Image: alarm-mail-4.jpg]
The HTML code generated by the specified screen was created in our program. We will not go into deeper explanations, we would just look the HTML code.
[Image: http-code.jpg]
Hardware system configuration
[Image: hardware-system.png]
Conclusion:
This case study like all others can be performed in many ways. One solution is presented here. The Kincony controller KC868-A4 was used, the Arduino IDE was used for programming. For settings see the link about KC868-A4. The plan is to process several different projects related to practical applications.
If you have any questions, suggestions or comments, write to info@edata.hr

Print this item