Commandé avant 14h00 un jour ouvrable = expédié le jour même 30 jours de délai de rétractation Garantie d’un an
← Retour à l’aperçu

Schéma de câblage et exemple de code

Voici comment connecter le Module relais à temporisation réglable 12 V à un Arduino UNO ou à un ESP32, avec un exemple de sketch que tu peux téléverser directement.

Déclencheur de relais à temporisation réglable

Ce projet montre comment déclencher un module relais à temporisation réglable à l’aide d’un Arduino Uno. L’Arduino envoie une courte impulsion depuis la broche numérique 4 vers la broche de déclenchement IN, activant le cycle de temporisation intégré du module. Réglez le potentiomètre sur le module relais pour modifier la durée d’activation du relais.

Schéma de câblage : Module relais à temporisation réglable 12 V sur un Arduino UNO
Schéma de câblage · Cliquez pour agrandir
Tableau de câblage : Module relais à temporisation réglable 12 V sur un Arduino UNO
Tableau de câblage · Cliquez pour agrandir
Adjustable_Timer_Delay_Relay_Trigger.ino · compilé et testé
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Adjustable Timer Delay Relay Trigger
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : DC 12V adjustable timer delay, time delay relay turn off switch module time relay time switch 0~25sec for smart home, automatic control
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Timer Delay Relay Module Demo
// Sends a trigger pulse to start the module's countdown delay.

const int triggerPin = 4;

void setup() {
  pinMode(triggerPin, OUTPUT);
  digitalWrite(triggerPin, LOW);

  Serial.begin(115200);
  Serial.println(F("Timer Delay Relay Demo Initialized."));
}

void loop() {
  Serial.println(F("Triggering relay delay cycle..."));
  
  // Send a 200 ms HIGH pulse to trigger the module
  digitalWrite(triggerPin, HIGH);
  delay(200);
  digitalWrite(triggerPin, LOW);
  
  Serial.println(F("Trigger sent. Waiting for delay cycle to complete..."));
  
  // Wait 10 seconds before triggering the next cycle
  delay(10000);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Relais temporisé réglable 12V à déclenchement

Ce projet montre comment déclencher un module de relais temporisé 12V réglable à l’aide d’un ESP32. L’ESP32 envoie une brève impulsion de déclenchement pour lancer le compte à rebours, et le relais reste alimenté pendant la durée réglée par le potentiomètre intégré (0 à 25 seconds).

Schéma de câblage : Module relais à temporisation réglable 12 V sur un ESP32 DevKit V1
Schéma de câblage · Cliquez pour agrandir
Tableau de câblage : Module relais à temporisation réglable 12 V sur un ESP32 DevKit V1
Tableau de câblage · Cliquez pour agrandir
Trigger_12V_Adjustable_Timer_Delay_Relay.ino · compilé et testé
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Trigger 12V Adjustable Timer Delay Relay
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : DC 12V adjustable timer delay, time delay relay turn off switch module time relay time switch 0~25sec for smart home, automatic control
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Pin connected to the IN trigger pin of the timer relay module
const int TRIGGER_PIN = 4;

void setup() {
  Serial.begin(115200);
  pinMode(TRIGGER_PIN, OUTPUT);
  digitalWrite(TRIGGER_PIN, LOW);
  
  Serial.println("ESP32 12V Timer Delay Relay Module Initialized");
  delay(1000);
}

void loop() {
  Serial.println("Sending trigger pulse...");
  
  // Send a 200 ms pulse to activate the timer
  digitalWrite(TRIGGER_PIN, HIGH);
  delay(200);
  digitalWrite(TRIGGER_PIN, LOW);
  
  Serial.println("Triggered! The relay will remain active for the duration set by the potentiometer.");
  
  // Wait 15 seconds before triggering the next cycle
  delay(15000);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Récemment consultés

Support de batterie 3x 18650 avec borne commutable

Support de batterie 3x 18650 avec borne commutable

€ 0,70
Support de batterie 2x AA (3V)

Support de batterie 2x AA (3V)

€ 1,00
Refroidisseur actif Raspberry Pi pour Raspberry Pi 5

Refroidisseur actif Raspberry Pi pour Raspberry Pi 5

€ 7,00
Voir
Télécommande séparée avec 2 boutons 433Mhz

Télécommande séparée avec 2 boutons 433Mhz

€ 4,00
Accouplement pour roue 30 mm / 6 mm

Accouplement pour roue 30 mm / 6 mm

€ 2,00
Électroaimant DC12V 3 kg

Électroaimant DC12V 3 kg

€ 4,85