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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,185
» Latest member: HowardKent
» Forum threads: 4,089
» Forum posts: 20,505

Full Statistics

Online Users
There are currently 55 online users.
» 0 Member(s) | 41 Guest(s)
Amazonbot, Baidu, Bing, PetalBot, Semrush, bot

Latest Threads
"KCS" v3.25.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: brambilw
10 hours ago
» Replies: 8
» Views: 744
KC868-a6 2 analog output...
Forum: KC868-A6
Last Post: bikovalexand
11 hours ago
» Replies: 4
» Views: 30
[Arduino IDE demo source ...
Forum: KC868-A8S
Last Post: admin
Today, 06:16 AM
» Replies: 0
» Views: 10
Tiny Alarm board after fl...
Forum: TA
Last Post: admin
Yesterday, 11:19 AM
» Replies: 7
» Views: 28
Wiegand
Forum: KC868-A16
Last Post: admin
Yesterday, 01:13 AM
» Replies: 3
» Views: 52
Programmation kc868-A8 & ...
Forum: News
Last Post: admin
06-13-2026, 12:16 AM
» Replies: 1
» Views: 20
M16v2 and SCT013-050
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
06-12-2026, 06:28 AM
» Replies: 5
» Views: 57
[arduino code examples fo...
Forum: KC868-AGv3
Last Post: admin
06-11-2026, 08:44 PM
» Replies: 0
» Views: 40
[arduino code examples fo...
Forum: KC868-AGv3
Last Post: admin
06-11-2026, 08:42 PM
» Replies: 0
» Views: 17
[arduino code examples fo...
Forum: KC868-AGv3
Last Post: admin
06-11-2026, 08:41 PM
» Replies: 0
» Views: 23

  PIR Sensor A6
Posted by: BalcdLeo - 09-24-2024, 04:46 PM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

Hello, everyone!
I'm relatively new to using the models here, so I have a few questions:
I’m trying to connect some sensors for testing. The only one I’ve successfully used is the DHT22, and now I’m attempting to get the PIR Sensor (the cheap ones) to work, but I haven’t been able to do so. Do you know if there’s anything specific regarding the setup, or is it just how the sensor operates?
Regarding the setup, I powered the PIR using both the 12V input of the A6 (the sensor operates from 5V to 20V) and an external power supply. I can see a reading of P0 indicating it’s connected to P0 or P1, P2... Pn. However, when I try to display the data obtained from the sensor, it doesn’t print in the Arduino IDE Serial monitor.
Do you know if these sensors work with the A6? I’m looking to use basic components for future automation projects.
Thank you all!


Here is my code:

#include <Wire.h>
#include "PCF8574.h"

#define SDA 4
#define SCL 15
#define PIR_SENSOR_PIN P0  // P0 pin on PCF8574 for the PIR sensor

PCF8574 pcf8574(0x22, SDA, SCL);  // I2C address 0x22, SDA GPIO4, SCL GPIO15

unsigned long timeElapsed;  // Variable to measure time
int warm_up = 1;  // Variable to control PIR warm-up

void setup() {
  Serial.begin(115200);  // Initialize serial communication
  Serial.println(__FILE__);
  delay(2000);

  Serial.println("System ready!");
  delay(2000);

  pcf8574.pinMode(PIR_SENSOR_PIN, INPUT);  // Set P0 pin as input for the PIR
  Serial.println("Init pcf8574...");
  if (pcf8574.begin()){
      Serial.println("OK");
  } else {
      Serial.println("KO");
  }
}

void loop() {
  // Read the value of the PIR connected to P0 of the PCF8574
  uint8_t sensor_output = pcf8574.digitalRead(PIR_SENSOR_PIN);

  // Check if the PIR detected motion
  if (sensor_output == LOW) {
    Serial.println("PIR ACTIVATED (Nothing detected)");
  } else {
    Serial.println("PIR DETECTED (Motion)");
  }

  delay(200);  // Delay to avoid excessive readings
}

Print this item

  how to check PCF8574/PCF8575 i2c address
Posted by: admin - 09-24-2024, 10:43 AM - Forum: KC868-A series and Uair Smart Controller - No Replies

   

Print this item

  Pulse Counter Sensor
Posted by: remiasz - 09-23-2024, 10:19 PM - Forum: KC868-A series and Uair Smart Controller - No Replies

ESPHome has Pulse Counter Sensor.
In yaml I can set count_mode to increment or decrement.
Can I change count_mode in runtime
My yaml file:

Code:
sensor:
  - platform: pulse_counter
    name: "impulse_counter"
    id: motor_pulse_counter
    pin:
      ...
    update_interval: 1s
    total:
      name: "Total"

binary_sensor:
  - platform: gpio
    name: "input01"
    id: opening
    pin: ...
    on_press:
      then:
        - lambda: |
            id(motor_pulse_counter).set_rising_edge_mode(esphome::pulse_counter::PulseCounterCountMode::PULSE_COUNTER_INCREMENT);

  - platform: gpio
    name: "input02"
    id: closing
    pin: ...
    on_press:
      then:
        - lambda: |
            id(motor_pulse_counter).set_rising_edge_mode(esphome::pulse_counter::PulseCounterCountMode::PULSE_COUNTER_DECREMENT);

I want add precise position to "Feedback Cover" by counting impulses from motor sensor.
But this konfiguration always count up in opening and closing cover.

Print this item

  Power supply
Posted by: salvolivigni - 09-23-2024, 03:38 PM - Forum: KC868-E16S/E16P - Replies (1)

Hi, how many watts does the 12VDC power supply need to have, to power with all 16 relays turned on?

Print this item

  KC868-A16 & ds18b20
Posted by: Wickfut - 09-23-2024, 01:48 PM - Forum: KC868-A series and Uair Smart Controller - Replies (11)

Can someone help me with a connection and code for a ds18b20 to a KC868-A16

Thank you,

Chris

Print this item

  UDP,TCP Server,TCP Client means in network setting
Posted by: dorishuntt - 09-23-2024, 07:04 AM - Forum: KC868-HxB series Smart Controller - No Replies

UDP: Controller power on will auto connect to KinCony's cloud server. This is use for "KinCony Smart Home" phone app. work need internet.
TCP Server: Controller is a server running on local network . This is use for "KBOX" phone app. work without internet.

Print this item

  how to turn on relay by SIM7600E 4G module voice call in ESPHome
Posted by: admin - 09-23-2024, 02:08 AM - Forum: Getting Started with ESPHome and Home Assistant - Replies (12)

   
   

Code:
esphome:
  name: a2

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "YnmQggQsfd7jvFefoMqNCpBtb63RXtotS+mSBQVIhY8="

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

switch:
  - platform: gpio
    name: "a2-light1"
    pin: 15
    inverted: False
    id: relay_1  # Assign ID to relay 1

  - platform: gpio
    name: "a2-light2"
    pin: 2
    inverted: False

binary_sensor:
  - platform: gpio
    name: "a2-input1"
    pin:
      number: 36
      inverted: true

  - platform: gpio
    name: "a2-input2"
    pin:
      number: 39
      inverted: true

web_server:
  port: 80

# UART configuration for SIM7600E
uart:
  id: uart_2
  tx_pin: GPIO5
  rx_pin: GPIO13
  baud_rate: 115200

interval:
  - interval: 200ms  # Shorten the interval to reduce blocking time
    then:
      - lambda: |-
          static std::string uart_buffer;
          uint8_t c;
          int count = 0;
          const int max_reads = 10;  // Limit the number of bytes read per interval

          while (id(uart_2).available() && count < max_reads) {
            if (id(uart_2).read_byte(&c)) {
              uart_buffer += (char)c;
              count++;

              // Log each received character (optional for debugging)
              ESP_LOGD("UART", "Received: %c", (char)c);

              // Check if we have received the "RING" signal
              if (uart_buffer.find("RING") != std::string::npos) {
                ESP_LOGI("SIM7600", "Incoming call detected, turning on relay 1.");
                id(relay_1).turn_on();  // Turn on relay 1
                uart_buffer.clear();  // Clear the buffer after processing
              }

              // Clear the buffer if it gets too large
              if (uart_buffer.length() > 100) {
                uart_buffer.clear();
              }
            }
          }
ESPHome yaml file for KC868-A2 board download: 
.txt   A2-yaml-sim7600-call-relay.txt (Size: 2.02 KB / Downloads: 436)

Print this item

  rs232 problem
Posted by: alex989 - 09-22-2024, 04:08 PM - Forum: KC868-A6 - Replies (22)

Hi,
I'm trying to use the rs232 port of the board but I'm some trouble.
to test it i have done a bridge from pin 2 and 3 of dsub connector and seems that the bytes that send doesn't been received.
i attach an other rs232 module in the same pin and with this module the bytes that send also been received.
seems that is the rs232 module of the board that have some problem

Print this item

  "KCS" v2.4.10 firmware for M30 AC Energy Meter
Posted by: admin - 09-22-2024, 05:29 AM - Forum: "KCS" v2 firmware system - No Replies

2.4.10 improment:
support multi M30 boards work in home assistant by MQTT auto discovery.
   
ESP32 firmware download:
.zip   KCS_M30_V2.4.10.zip (Size: 735 KB / Downloads: 704)

Print this item

  [arduino code examples for A32 Pro]-12 How to use DHT11 temperature humidity sensor
Posted by: admin - 09-20-2024, 05:12 AM - Forum: KC868-A32/A32 Pro - No Replies

Code:
/*
*  Made by KinCony IoT: https://www.kincony.com

*  This program reads temperature and humidity values from a DHT11 sensor
*  connected to GPIO2 of an ESP32 board, and prints the readings to the serial monitor.

*  The DHT11 sensor measures the relative humidity and temperature in the environment.
*  This data is then read by the ESP32 and displayed in the serial monitor.
*
*  Requirements:
*  - ESP32 microcontroller
*  - DHT11 temperature and humidity sensor
*  - DHT sensor library by Adafruit (Install in Arduino IDE)
*
*  Connections:
*  - DHT11 Data Pin -> GPIO2 on ESP32
*  - DHT11 VCC Pin -> 3.3V on ESP32
*  - DHT11 GND Pin -> GND on ESP32
*/

#include <DHT.h>  // Import the DHT library

// Define the GPIO pin where the DHT11 sensor is connected
#define DHTPIN 2       // DHT11 data pin is connected to GPIO2 on ESP32

// Define the type of DHT sensor being used (DHT11)
#define DHTTYPE DHT11  // DHT11 sensor type

// Create a DHT object to read temperature and humidity
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  // Initialize serial communication for debugging at a baud rate of 115200
  Serial.begin(115200);
  Serial.println("DHT11 Sensor Test - Made by KinCony IoT: https://www.kincony.com");

  // Initialize the DHT sensor
  dht.begin();
}

void loop() {
  // Wait for 2 seconds between each reading to ensure stable data
  delay(2000);

  // Read humidity value from the DHT11 sensor
  float humidity = dht.readHumidity();
 
  // Read temperature value from the DHT11 sensor in Celsius
  float temperature = dht.readTemperature();

  // Check if there was an error reading the data
  if (isnan(humidity) || isnan(temperature)) {
    // Print error message if the sensor reading failed
    Serial.println("Failed to read from DHT11 sensor!");
    return;  // Exit loop iteration and try again after delay
  }

  // Print the humidity value to the serial monitor
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print("%");

  // Print the temperature value to the serial monitor
  Serial.print("  Temperature: ");
  Serial.print(temperature);
  Serial.println("°C");
}

arduino ino file download: 
.zip   12-DHT11-temperature-humidity.zip (Size: 1.05 KB / Downloads: 535)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 
.zip   12-DHT11-temperature-humidity.ino.merged.zip (Size: 180.83 KB / Downloads: 557)
   

Print this item