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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,443
» Latest member: kelvingreen2803
» Forum threads: 3,700
» Forum posts: 19,040

Full Statistics

Online Users
There are currently 29 online users.
» 0 Member(s) | 21 Guest(s)
AhrefsBot, Amazonbot, bot

Latest Threads
E16P Case / Cover
Forum: KC868-E16S/E16P
Last Post: admin
2 hours ago
» Replies: 1
» Views: 7
B8M Schematic
Forum: B8M
Last Post: admin
2 hours ago
» Replies: 5
» Views: 40
"KCS" v3.19.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
2 hours ago
» Replies: 2
» Views: 106
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 01:55 PM
» Replies: 19
» Views: 625
F32 and 433 Mhz
Forum: F32
Last Post: admin
01-15-2026, 11:25 PM
» Replies: 3
» Views: 10
flash Kincony software to...
Forum: DIY Project
Last Post: admin
01-15-2026, 11:24 PM
» Replies: 18
» Views: 171
Feedback: Product line di...
Forum: Suggestions and feedback on KinCony's products
Last Post: mkai
01-15-2026, 11:37 AM
» Replies: 3
» Views: 57
ESPHome Compile warning m...
Forum: KC868-A8
Last Post: admin
01-15-2026, 06:20 AM
» Replies: 1
» Views: 14
Voltage wrong
Forum: N30
Last Post: Painy
01-14-2026, 01:20 PM
» Replies: 0
» Views: 21
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
01-14-2026, 04:05 AM
» Replies: 0
» Views: 14

  KC868-A32 DS18B20 temperature sensor
Posted by: stanchiam - 09-05-2024, 01:16 AM - Forum: "KCS" v2 firmware system - Replies (12)

Hi,

I want to install DS18B20 sensor and use it instead of analog temperature sensor which is not accurate.
Will be using one of the gpio on the white serial port. 

As kcs firmware does not support A32 with DS18B20 sensor, how to make it work.
I can write arudino code to get the temperature if needed, but how can it be use together with kcs firmware?
Need some help. Thank you.

Print this item

  ALR LoRa firmware for home assistant enabled AUTO DISCOVERY
Posted by: admin - 09-05-2024, 12:42 AM - Forum: KinCony ALR - Replies (23)

here is KinCony firmware for ALR LoRa board - ALR. it support control relay , monitor DS18B20 temperature and 4 channel analog input, 1 channel digital input state in home assistant by MQTT. You not need config any code for home assistant yaml. Because we have design firmware enabled MQTT auto discovery for home assistant.
   

here are two ALR board.  one work as RECEIVER(gateway), another work as TRANSMIT(read sensor state, control relay), just set DIP switch on PCB, let two board same DIP state, so that they will communication with each other, easy!

   

RECEIVER(gateway) board's LCD displayer will show MQTT broker connection state, LoRa signal value and how many LoRa package have received.
TRANSMIT board's LCD displayer will show DS18B20 temperature value,  LoRa signal value and how many LoRa package have sent.

   

here is two firmware BIN file for different board:
for RECEIVER board:
.zip   ALR-RECEIVER-20240904.ino.merged.zip (Size: 614.04 KB / Downloads: 495)
for TRANSMIT board: 
.zip   ALR-TRANSMIT_20240904.ino.merged.zip (Size: 606.17 KB / Downloads: 432)

download firmware by ESP32 DOWNLOAD TOOL:
   
chose ESP32-S3 and USB mode.

   
chose RECEIVER board's firmware and set address to 0x0

   
chose TRANSMIT board's firmware and set address to 0x0

set router's wifi ssid, password, mqtt broker ip, mqtt port, mqtt username, mqtt password for RECEIVER board via USB-C cable.

config json command:
{
  "wifi_name":"KinCony",
  "wifi_psw":"a12345678",
  "mqtt_ip":"192.168.3.124",
  "mqtt_port":"1883",
  "mqtt_user":"mqtt",
  "mqtt_psw":"123"
}

   
serial port debug tool download:

.zip   UartAssist.zip (Size: 468.4 KB / Downloads: 472)

after config complete and reboot. you can see KinCony ALR board is showed on home assistant DEVICE list:
   

you can add these entities to home assistant dashboard.
   

Print this item

  KC868 A6 User Guide
Posted by: ivpl@optusnet.com.au - 09-05-2024, 12:02 AM - Forum: KC868-A series and Uair Smart Controller - Replies (11)

Hi, I Have just purchased a KC868 A6 unit and would like to see a user guide on how to connect to this device and upload a program to it from Arduino IDE.

I've tried searching but have not yet found a user guide for the A6.

Thank You

Print this item

  "KCS" v2.2.4 firmware BIN file download
Posted by: admin - 09-04-2024, 11:32 PM - Forum: "KCS" v2 firmware system - Replies (8)

Here is "KCS" firmware for KinCony KC868-A series (ESP32) board.
How to download and use, online guide: https://www.kincony.com/esp32-kcsv2-firmware.html

v2.2.4 improment:
1. replaced new DHT sensor's driver.
2. fixed MQTT protocol format bug.



Attached Files
.zip   KCS_KC868_AIO_V2.2.4.zip (Size: 805.72 KB / Downloads: 419)
.zip   KCS_KC868_AK_V2.2.4.zip (Size: 766.78 KB / Downloads: 399)
.zip   KCS_KC868_AM_V2.2.4.zip (Size: 781.63 KB / Downloads: 433)
.zip   KCS_KC868_AP_V2.2.4.zip (Size: 784.23 KB / Downloads: 384)
.zip   KCS_KC868_ASR_V2.2.4.zip (Size: 761.11 KB / Downloads: 405)
.zip   KCS_KC868_E16S_V2.2.4.zip (Size: 790.79 KB / Downloads: 427)
.zip   KCS_KC868_UAIR_V2.2.4.zip (Size: 767.67 KB / Downloads: 405)
.zip   KCS_KC868_A2_V2.2.4.zip (Size: 794.6 KB / Downloads: 403)
.zip   KCS_KC868_A4_V2.2.4.zip (Size: 781.71 KB / Downloads: 450)
.zip   KCS_KC868_A4S_V2.2.4.zip (Size: 805.34 KB / Downloads: 419)
.zip   KCS_KC868_A6_V2.2.4.zip (Size: 779.79 KB / Downloads: 524)
.zip   KCS_KC868_A8_V2.2.4.zip (Size: 788.5 KB / Downloads: 505)
.zip   KCS_KC868_A8M_V2.2.4.zip (Size: 804.71 KB / Downloads: 428)
.zip   KCS_KC868_A8S_V2.2.4.zip (Size: 806.39 KB / Downloads: 459)
.zip   KCS_KC868_A16_V2.2.4.zip (Size: 795.95 KB / Downloads: 614)
.zip   KCS_KC868_A16S_V2.2.4.zip (Size: 806.61 KB / Downloads: 441)
.zip   KCS_KC868_A32_V2.2.4.zip (Size: 786.12 KB / Downloads: 453)
.zip   KCS_KC868_A32M_V2.2.4.zip (Size: 804.14 KB / Downloads: 411)
.zip   KCS_KC868_A64_V2.2.4.zip (Size: 786.21 KB / Downloads: 399)
.zip   KCS_KC868_A128_V2.2.4.zip (Size: 786.33 KB / Downloads: 377)
.zip   KCS_KC868_AG_V2.2.4.zip (Size: 764.49 KB / Downloads: 435)
.zip   KCS_KC868_AI_V2.2.4.zip (Size: 788.72 KB / Downloads: 430)
Print this item

Lightbulb RS485 Temperature and Humidity Sensor Modbus RTU
Posted by: Trapasin - 09-04-2024, 11:18 AM - Forum: Extender module - Replies (17)

RS485 Temperature and Humidity Sensor Modbus RTU Use By SHT30
https://shop.kincony.com/products/rs485-...e-by-sht30

Please tell me the parameters of the Sensor to connect it to the controller via the MODBUS bus

1. Device address: What is the default address, how can it be changed?
2. Data transfer rate (Baud Rate)
3. Number of stop bits
4. Number of data bits
5. Parity
6. Transfer type: RTU or ASCII
7. Bus type: I use 4 wires: RS-485
8. Timeouts and delays: which are preferable for it?

Print this item

  Modbus
Posted by: charles.garand - 09-04-2024, 10:56 AM - Forum: Extender module - No Replies

Hi!

anybody had implement Modbus ?
I'm having hard time to get mine working.
I'm using esp32ModbusRTU library.

here is my code;

esp32ModbusRTU modbus(&Serial1, -1); 


void modbusTask(void *pvParameters) {
  Serial1.begin(4800, SERIAL_8N1, RX, TX); 
  printf("Serial1 initialized for Modbus\n");
  vTaskDelay(pdMS_TO_TICKS(1000)); 

    // callbacks  Modbus
    modbus.onData([](uint8_t serverAddress, esp32Modbus::FunctionCode fc, uint8_t* data, size_t length) {
        printf("Modbus Response Received - Server ID: 0x%02x, Function Code: 0x%02x, Length: %u\n", serverAddress, fc, length);
        for (size_t i = 0; i < length; ++i) {
            printf("%02x ", data[i]);
        }
        printf("\n");
    });

    modbus.onError([](esp32Modbus::Error error) {
        printf("Modbus Error: 0x%02x\n", static_cast<uint8_t>(error));
    });

   
    modbus.begin();
  vTaskDelay(pdMS_TO_TICKS(1000)); 

   
    while (true) {
        modbus.readHoldingRegisters(0x01, 0x0000, 4); 
        //vTaskDelay(pdMS_TO_TICKS(1000)); 
    }
}

extern "C" void app_main(void)
{
  vTaskDelay(6000 / portTICK_PERIOD_MS);
  printf("Hello world!\n");
 
    xTaskCreate(modbusTask, "modbusTask", 8192, NULL, 5, NULL);

    while (true) {
        std::cout << "In the while\n" << std::endl;
        //vTaskDelay(pdMS_TO_TICKS(1000));
    }

}

...
#include <esp32ModbusRTU.h>
#include "driver/uart.h"

// Declaration Modbus
esp32ModbusRTU modbus(&Serial1, 10); // 10 is arbitary GPIO because don't use RTS pin


void modbusTask(void *pvParameters) {
// Configurer la communication UART pour Modbus
Serial1.begin(4800, SERIAL_8N1, RX, TX); // Initialise Serial1
printf("Serial1 initialized for Modbus\n");
vTaskDelay(pdMS_TO_TICKS(1000)); // stabilisation time

// Configurer les callbacks de Modbus
modbus.onData([](uint8_t serverAddress, esp32Modbus::FunctionCode fc, uint8_t* data, size_t length) {

printf("Modbus Response Received - Server ID: 0x%02x, Function Code: 0x%02x, Length: %u\n", serverAddress, fc, length);

if (length % 2 != 0) {
printf("Invalid data length\n");
return;
}

for (size_t i = 0; i < length; i += 2) {
uint16_t value = (data[i] << 8) | data[i + 1];
if(i < 5)
value = value / 10;
printf("Register %zu: %u \n", i / 2, value);
}

printf("\n");
});

modbus.onError([](esp32Modbus::Error error) {
printf("Modbus Error: 0x%02x\n", static_cast<uint8_t>(error));
});

// start Modbus
modbus.begin();
vTaskDelay(pdMS_TO_TICKS(1000)); // wait 1 sec to stabilise

while (true) {
modbus.readHoldingRegisters(0x01, 0x0000, 5); // slave address: 0x01
vTaskDelay(pdMS_TO_TICKS(1000));
}
}

extern "C" void app_main(void)
{
xTaskCreate(modbusTask, "modbusTask", 8192, NULL, 5, NULL);

while (true) {
std::cout << "In the while\n" << std::endl;
vTaskDelay(pdMS_TO_TICKS(2000));
}

}

Print this item

Wink KC868-A16 Power Input Voltage 12V(24)?
Posted by: kisman - 09-02-2024, 05:01 PM - Forum: KC868-A16 - Replies (7)

Hello,
Is any reason why documentation explains that this board can be powered only with with 12V?.
I checked schematic view(LDO) and XL1509-5 can support 24V(input). Any other modules uses 5V or 3.3V.
Can I safely use 24V DC Power Supply instead of 12V? (I assume, that input logic will change from 12V to 24V). Is it safe or maybe I'm missing something?.
The input/output 24V logic is very popular in Europe Wink.

Print this item

  PZEM-004T With A6 on Serial
Posted by: Techno - 09-02-2024, 01:56 PM - Forum: KC868-A6 - Replies (11)

Howdy!

Thanks for the A6 Board, im using the second one already and i enjoy it.
I encountered a problem, connected PZEM-004T to Serial on A6 (GPIO12, 13)

When i power the board, it doesnt boot. I plug out the PZEM-004T from A6, it boots. I plug pzem back in. It works normaly, and i receive all the needed data.
What is the problem i have on boot?

pastebin code:
https://pastebin.com/Rbujh2R1

code:

Code:
esphome:
name: kotela6
friendly_name: KotelA6
libraries:
- "Wire"
- "ArduinoJson"

 
esp32:
board: esp32dev
framework:
type: arduino
 
 
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
 
 
 
logger:
 
api:
encryption:
key:
 
captive_portal:
 
ota:
password: "
 
#########################
 
uart:
- id: ubus1
tx_pin: GPIO13
rx_pin: GPIO12
baud_rate: 9600
stop_bits: 1
 
 
 
 
 
i2c:
sda: GPIO4
scl: GPIO15 # Change SCL to GPIO22 to avoid issues with GPIO15
scan: true
 
 
 
##########################
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x24
- id: 'pcf8574_hub_in_1' # for input channel 9-16
address: 0x22
pcf8575: false
 
 
#####################
time:
- platform: ds1307
id: rtc_time
 
 
sensor:
 
#### PZEM-004T V3 ####
 
- platform: pzemac
address: 1
current:
name: "pMeter_current"
accuracy_decimals: 2
voltage:
name: "pMeter_voltage"
accuracy_decimals: 2
power:
name: "pMeter_power"
unit_of_measurement: W
accuracy_decimals: 2
id: pMeter_power
frequency:
name: "pMeter_frequency"
unit_of_measurement: Hz
accuracy_decimals: 2
power_factor:
name: "pMeter_power_factor"
accuracy_decimals: 2
id: pMeter_power_factor
energy:
name: "pMeter_energy"
unit_of_measurement: Wh
accuracy_decimals: 1
id: pMeter_energy
update_interval: 5s
 
 
- platform: template
name: "pMeter_cumulative power"
unit_of_measurement: "kWh"
accuracy_decimals: 1
update_interval: 5s
icon: mdi:power
lambda: return (( (id(pMeter_energy).state)/1000.0));
 
- platform: total_daily_energy
name: "pMeter_of_day"
power_id: pMeter_power
unit_of_measurement: "kWh"
accuracy_decimals: 2
id: pMeter_power_of_day
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
icon: mdi:counter
 
- platform: template
name: "pMeter_veille"
id: template_pMeter_veille
unit_of_measurement: "kwh"
accuracy_decimals: 2
icon: mdi:power
update_interval: 10s
 
- platform: template
name: "pMeter_power_apparente"
id: pMeter_power_apparente
unit_of_measurement: "VA"
accuracy_decimals: 2
update_interval: 10s
icon: mdi:power
lambda: return ( (id(pMeter_power).state/id(pMeter_power_factor).state));
 
- platform: template
name: "pMeter_power_reactive"
id: pMeter_power_reactive
unit_of_measurement: "VAr"
accuracy_decimals: 2
update_interval: 10s
icon: mdi:power
lambda: return ( ( sqrt( (id(pMeter_power_apparente).state)*(id(pMeter_power_apparente).state) - (id(pMeter_power).state)*(id(pMeter_power).state) ) ) );
 
- platform: wifi_signal
name: "WiFi power_pMeter"
update_interval: 10s
 
- platform: uptime
name: "up"
id: uptime_sec
 
 
 
 
 
 
 
text_sensor:
- platform: template
name: pMeter_uptime
lambda: |-
int seconds = (id(uptime_sec).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
icon: mdi:clock-start
update_interval: 113s
 
################################################# SENSOR
binary_sensor:
 
 
- platform: status
name: "pMeter_status"
- platform: gpio
name: "flood_elling"
icon: mdi:home-flood
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true
 
- platform: gpio
name: "flood_pool"
icon: mdi:home-flood
pin:
pcf8574: pcf8574_hub_in_1
number: 1
mode: INPUT
inverted: true
- platform: gpio
name: "flood_pump"
icon: mdi:home-flood
pin:
pcf8574: pcf8574_hub_in_1
number: 2
mode: INPUT
inverted: true
- platform: gpio
name: "KC868-A6-IN-4"
pin:
pcf8574: pcf8574_hub_in_1
number: 3
mode: INPUT
inverted: true
- platform: gpio
name: "KC868-A6-IN-5"
pin:
pcf8574: pcf8574_hub_in_1
number: 4
mode: INPUT
inverted: true
- platform: gpio
name: "KC868-A6-IN-6"
pin:
pcf8574: pcf8574_hub_in_1
number: 5
mode: INPUT
inverted: true
 
 
################################################# RELAYS
switch:
 
- platform: restart
name: "pMeter_restart"
 
### KINCONY 1
- platform: gpio
name: "Boiler ten"
id: relay_1
icon: mdi:fan
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true
 
 
- platform: gpio
name: "free"
id: relay_2
pin:
pcf8574: pcf8574_hub_out_1
number: 1
mode: OUTPUT
inverted: true
 
########################### ######### BOILER PUMP
- platform: gpio
name: "Boiler Pump"
icon: mdi:pump
id: relay_3
pin:
pcf8574: pcf8574_hub_out_1
number: 2
mode: OUTPUT
inverted: true
 
 
################################## #RECIRCULATE
 
 
- platform: gpio
name: "Recirculate Pump"
icon: mdi:pump
id: relay_4
pin:
pcf8574: pcf8574_hub_out_1
number: 3
mode: OUTPUT
inverted: true
 
######################## INTERLOCK WATER STOP ###########################
- platform: gpio
name: "HouseWater OFF"
icon: mdi:water-off-outline
 
id: relay_5
pin:
pcf8574: pcf8574_hub_out_1
number: 4
mode: OUTPUT
inverted: true
interlock: [relay_6] # Interlock with Grow Pump_6
 
- platform: gpio
name: "HouseWater ON"
icon: mdi:water
id: relay_6
pin:
pcf8574: pcf8574_hub_out_1
number: 5
mode: OUTPUT
inverted: true
interlock: [relay_5]
restore_mode: ALWAYS_ON
 



Attached Files Thumbnail(s)
   
Print this item

  ATF Arduino source code - Save DS18B20 Temperature Data on a micro SD Card by Excel
Posted by: admin - 09-02-2024, 03:41 AM - Forum: Extender module - No Replies

/*
  KinCony Company - https://www.kincony.com
  -----------------------------------------------------
  This program logs temperature data from a DS18B20 sensor
  to an SD card, including the current date and time.
  The date and time can be set via serial commands.
 
  Serial Command to Set Date and Time:
  ------------------------------------
  DYYYY-MM-DDTHH:MM:SS  (Example: D2024-09-01T20:00:00)
  - Sets the date to September 1, 2024, and the time to 20:00:00.
 
  Serial Command to Get Current Date and Time:
  --------------------------------------------
  current time
  - Returns the current date and time in the format:
    Current Date: YYYY-MM-DD
    Current Time: HH:MM:SS
*/



Code:
/*
  KinCony Company - https://www.kincony.com
  -----------------------------------------------------
  This program logs temperature data from a DS18B20 sensor
  to an SD card, including the current date and time.
  The date and time can be set via serial commands.
 
  Serial Command to Set Date and Time:
  ------------------------------------
  DYYYY-MM-DDTHH:MM:SS  (Example: D2024-09-01T20:00:00)
  - Sets the date to September 1, 2024, and the time to 20:00:00.
 
  Serial Command to Get Current Date and Time:
  --------------------------------------------
  current time
  - Returns the current date and time in the format:
    Current Date: YYYY-MM-DD
    Current Time: HH:MM:SS
*/

#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SD.h>
#include <SPI.h>
#include <TimeLib.h>

// Pin assignments
#define ONE_WIRE_BUS 26
#define SD_CS_PIN 5

// DS18B20 sensor setup
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

// SD card setup
File dataFile;

void setup() {
  // Start serial communication
  Serial.begin(115200);
 
  // Start the DS18B20 sensor
  sensors.begin();
 
  // Start the SD card
  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("SD card initialization failed!");
    return;
  }

  // Open the file for writing
  dataFile = SD.open("/temperature_log.csv", FILE_WRITE);
  if (dataFile) {
    // Write the header
    dataFile.println("Date,Time,Temperature (°C)");
    dataFile.close();
  } else {
    Serial.println("Error opening file for writing");
  }

  // Initialize the time to a default value
  setTime(0, 0, 0, 1, 1, 2020); // Default to Jan 1, 2020 00:00:00
}

void loop() {
  // Check for serial input
  if (Serial.available()) {
    String input = Serial.readStringUntil('\n');
   
    // Set the time if the input starts with 'D'
    if (input.startsWith("D")) {
      int year = input.substring(1, 5).toInt();
      int month = input.substring(6, 8).toInt();
      int day = input.substring(9, 11).toInt();
      int hour = input.substring(12, 14).toInt();
      int minute = input.substring(15, 17).toInt();
      int second = input.substring(18, 20).toInt();
     
      setTime(hour, minute, second, day, month, year);
      Serial.println("Time updated successfully!");
    }

    // Return the current time if the input is "current time"
    else if (input == "current time") {
      String currentDate = String(year()) + "-" + String(month()) + "-" + String(day());
      String currentTime = String(hour()) + ":" + String(minute()) + ":" + String(second());
      Serial.print("Current Date: ");
      Serial.println(currentDate);
      Serial.print("Current Time: ");
      Serial.println(currentTime);
    }
  }

  // Get the current date and time
  String formattedDate = String(year()) + "-" + String(month()) + "-" + String(day());
  String formattedTime = String(hour()) + ":" + String(minute()) + ":" + String(second());

  // Request temperature measurement
  sensors.requestTemperatures();
  float temperatureC = sensors.getTempCByIndex(0);

  // Open the file for appending
  dataFile = SD.open("/temperature_log.csv", FILE_APPEND);
  if (dataFile) {
    // Write the data as a new line
    dataFile.print(formattedDate);
    dataFile.print(",");
    dataFile.print(formattedTime);
    dataFile.print(",");
    dataFile.println(temperatureC, 2); // 2 decimal places for temperature
    dataFile.close();
   
    // Print to the Serial Monitor as well
    Serial.print(formattedDate);
    Serial.print(",");
    Serial.print(formattedTime);
    Serial.print(",");
    Serial.println(temperatureC, 2);
  } else {
    Serial.println("Error opening file for appending");
  }
 
  // Wait for 5 seconds before the next measurement
  delay(5000);
}
   
   
   

Print this item

  Analog current input
Posted by: Linnalahti - 09-01-2024, 11:36 AM - Forum: KC868-A16 - Replies (4)

How to use 0-20mA signal to analog input?

Admin did not anservered the qustion?
How to use 0-20mA signal insted off 4-20mA

Print this item