Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delay Relay F8
#1
Pin Definitions:
Subject: Request: Sequential 8-relay example for F8 (ESP32-S3), 1.5s step, reverse on shutdown


Message:
Hello KinCony team,

I am using the KinCony F8 (ESP32-S3) board with the PCF8575 I/O expander to control 8 relays. I would like to have an Arduino example that performs the following:
  •  Sequential ON: Relay1 → Relay8, with 1.5 seconds delay between each relay.
  •  Sequential OFF: Relay8 → Relay1, with the same 1.5 seconds delay.
  •  Arduino IDE, using I2C with SDA = GPIO8, SCL = GPIO18, and PCF8575 address = 0x24 (please confirm).

My questions are:
1. What is the exact GPIO mapping for each relay on the F8 hardware revision?
2. Do you have an official Arduino example implementing this sequence?
3. If there is a recommended library or header file for this board, could you please share the link?

Here is a sample code I tested so far (for reference):
// I2C pins
#define SDA 8
#define SCL 18
#include <Wire.h>
#include <PCF8575.h>

#define I2C_SDA 8
#define I2C_SCL 18
#define PCF8575_ADDR 0x24

PCF8575 pcf(PCF8575_ADDR);
const uint8_t RELAY_PINS[8] = {P0, P1, P2, P3, P4, P5, P6, P7};

void setup() {
  Serial.begin(115200);
  if (!pcf.begin(I2C_SDA, I2C_SCL)) {
    Serial.println("PCF8575 not found!");
    while (1);
  }
  for (int i = 0; i < 8; i++) {
    pcf.write(RELAY_PINS[i], HIGH);  // OFF at start
  }
}

void loop() {
  // Sequential ON
  for (int i = 0; i < 8; i++) {
    Serial.print("Relay ON: "); Serial.println(i+1);
    pcf.write(RELAY_PINS[i], LOW);
    delay(1500);
  }

  // Sequential OFF
  for (int i = 7; i >= 0; i--) {
    Serial.print("Relay OFF: "); Serial.println(i+1);
    pcf.write(RELAY_PINS[i], HIGH);
    delay(1500);
  }
}
Reply
#2
this F8 relay arduino demo code: https://www.kincony.com/forum/showthread.php?tid=7985
just need install PCF8575 arduino library firstly.

this code line "pcf8575_R1.write(i, LOW);" just change i value, you can control any relay of F8.
Reply
#3
(09-24-2025, 10:50 AM)admin Wrote: this F8 relay arduino demo code: https://www.kincony.com/forum/showthread.php?tid=7985
just need install PCF8575 arduino library firstly.

this code line  "pcf8575_R1.write(i, LOW);"    just change i value, you can control any relay of F8.

hi 
After we upload the code, the F8 turns ON /OFF and displays " no more shows details and we can't control F8
Reply
#4
you should modify the code according to your requirements.
Reply
#5
(09-24-2025, 11:52 PM)admin Wrote: you should modify the code according to your requirements.

How to modify the code, which software should I use
Reply
#6
arduino ide
Reply
#7
I can modify the pin numbers in the code you provided, and it will work, but the problem is that we will lose connection with Tuya, and we will not be able to control the system from the phone. So I have questions.
What I want is for when I turn all relays ON from the app, all the relays go ON with a delay of seconds between each relay.

1. Can I perform this thing via your Kincony web?
2. Do I have to upload Tuya firmware to the ESP if I want to control from the APP?
3. Do you recommend any other firmware?
Reply
#8
that need set by IFTTT. so that tuya app also can use.
Reply
#9
do you want when power on , do:
• Sequential ON: Relay1 → Relay8, with 1.5 seconds delay between each relay.
• Sequential OFF: Relay8 → Relay1, with the same 1.5 seconds delay.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)