8 Kanal I2C Optokoppler Modul
16 Kanal PRO,  8 Kanal Trigger Modul,  EI-OT 8 Kanal Pro,  Rules

PCF8574 Input Trigger Modul und 8 Kanal Relais PRO konfigurieren

EI-OT 8 Channel Relays PRO Module Basic Setup Step by Step
Basis – Konfiguration

Mittels der ESP-OS Firmware erfolgt zunächst die Basiskonfiguration des EI-OT ESP8266 8 Kanal PRO Relais Moduls innerhalb von Sekunden. Die Basiskonfiguration bezieht sich im Detail auf den ESP8266 in Kombination mit dem PCF8574 im Detail die Konfiguration des I2C Bus.

Die Basis Konfiguration des ESP8266 Schritt für Schritt:

  1. klicke auf Einstellungen um das ESP-OS Konfigurationsmenü zu öffnen
  2. klicke im ESP-OS Konfigurationsmenü auf Gerät konfigurieren
  3. wähle im Drop Down Gerätetyp EI-OT 8CH Relay PRO (5) aus
  4. klicke auf Speichern 
  5. ESP-OS speichert die Konfiguration und führt einen Neustart des EI-OT ESP8266 aus
  6. Nach erfolgreichem Neustart aktualisiert ESP-OS die Benutzeroberfläche

Der ESP8266 wurde erfolgreich konfiguriert, die ESP-OS Standardkonfiguration Generic wurde auf EI-OT 8CH Relay PRO geändert.

Auch der I2C Bus wurde bereits erfolgreich vorkonfiguriert, zu erkennen am ESP-OS Status Fenster und den dort aufgelisteten PCF8574-1 D0 bis D7 sowie dem zweiten PCF8574-2 D0 bis D7

Der PCF8574 ist ein typischer I/O Expander, zu Deutsch eine Ein- / Ausgang- Erweiterung. Aktuell sind alle Kanäle (D0 bis D7) beider PCF8574 als Eingang konfiguriert.

Basic Configuration

With the ESP-OS Webinterface the Basic Configuration of the EI-OT ESP8266 8 Channel PRO Relays Module takes only view seconds. The Basic Configuration its based on the ESP8266 in combination with the PCF8574, in detail configuration of the I2C Bus.

Basic Configuration of the ESP8266 Step by Step:

  1. click on Configuration
  2. in the ESP-OS Configuration Menu click on Configure Module
  3. in Drop Down List Module type of Module Parameters select EI-OT 8CH Relay PRO (5)
  4. click on Save
  5. soon as Parameters saved, ESP-OS initiate a reboot
  6. after reboot ESP-OS reloads the Webinterface, the Module Type its changed from Generic to EI-OT 8CH Relay PRO.

Also the I2C Bus is ready configured. According ESP-OS Status Window the PCF8574-1 Channels from D0 up to D7, also the second PCF8574-2 from D0 to D7.

The PCF8574 is an I/O (INput / OUTput) Expander, actual I/O channels are set as Input.

EI-OT 8 Channel Relays PRO Module Output Input configuration
PCF8574 Konfiguration

Abschliessend müssen nun

  • 8 Kanäle eines PCF8574 als Ausgänge zum Schalten der Relais
  • 8 Kanäle eines PCF8574 als Eingänge

konfiguriert werden.

Zunächst gilt es den jeweiligen PCF8574 zu identifizieren. ESP-OS listet die PCF8574 aufsteigend anhand der I2C Adresse auf. Der PCF8574 des 8 Kanal Relais Moduls hat die Adresse 0x39, wurde dem PCF8574 Input Trigger Modul die I2C 0x38 Adresse zugewiesen, ist Device 1 = der PCF8574 des Input Trigger Moduls, andernfalls ist die Device 2 = der PCF8574 des Input Trigger Moduls.

Im hier dargestellten Beispiel wurde dem Input Trigger Modul die I2C Adresse 0x3A zugewiesen, dementsprechend

  • Gerät (PCF8574) 1, schaltet die Relais
  • Gerät (PCF8574) 2, erfasst die Signale der Benutzereingaben

Dementsprechend müssen die 8 Kanäle des Gerät 1 als Ausgang zum Schalten der 8 Relais konfiguriert werden

  1. klicke auf Einstellungen um das ESP-OS Konfigurationsmenü zu öffnen
  2. klicke im ESP-OS Konfigurationsmenü auf Konfiguriere PCF8574
  3. wähle im Drop Down von Port 0 bis Port 7 Ausgang / Output für Gerät 1 aus
  4. wenn alle Ports des PCF8574 (Gerät 1)  auf Output gesetzt wurden klicke auf Speichern 
  5. ESP-OS speichert die Konfiguration und führt einen Neustart des EI-OT ESP8266 aus
  6. Nach erfolgreichem Neustart aktualisiert ESP-OS die Benutzeroberfläche

Das EI-OT ESP8266 8 Kanal Relais Modul  wurde erfolgreich konfiguriert.

Das Statusfenster zeigt nun die 8 Eingänge des PCF8574 Input Trigger Moduls. Sobald eine Benutzereingabe erfolgt, wechselt der Eingang seinen Status von 1 auf 0.

Die Buttons 1 bis 8 stellen die 8 Relais dar. Durch einen Klick auf das jeweilige Relais lassen sich nun die 8 Relais mittels der ESP-OS Benutzeroberfläche schalten.

Die Basiskonfiguration des EI-OT ESP8266 8 Kanal PRO Relais ist abgeschlossen.

PCF8574 Configuration

To Finish the Configuration

  • 8 channels must be configured as output / switching relays
  • 8 channels must be configured as input / user input detection

Most important step is recognizing each PCF8574. ESP-OS is listing PCF8574 devices based on I2C address. I2C Address of the 8 Channel Relays Module is set to 0x39. If PCF8574 Input Trigger Module has I2C address 0x38, Device 1 = PCF8574 Input Trigger Module, otherwise PCF8574 Input Trigger Module = Device 2.

In our example the PCF8574 Input Trigger Modules I2C is set to 0x3A, so Device 2 is Input Trigger Module.

Based on that the 8 Output Channels for switching Relays must be configured as follows

  1. click on Configuration
  2. in the ESP-OS Configuration Menu click on Configure PCF8574
  3. select in Drop Down List from Port 0 to Port 7 of Device 1 Output
  4. soon as all 8 PCF8574 Device 1 Ports are configured click on Save
  5. soon as PCF8574 Parameters saved, ESP-OS initiate a reboot
  6. after reboot ESP-OS reloads the Webinterface

After rebooting, the ESP-OS status window shows the 8 input channels of the PCF8574-2 Device. Soon as a input signal appears, channel status change from 1 to 0.

The ESP-OS Interface indicates Buttons 1 to 8. Each button represent one of the 8 Relays. To toggle a Relay just click on the button.

The Basic Configuration of the EI-OT ESP8266 8 Channel PRO Relays Module is finished.

EI-OT 8 Channel Relays PRO Module Output Input configuration
Regel Rule Konfiguration

Typischerweise verwendet man Eingangssignale Taster zur direkten Interaktion mit Relais

  • wenn Taster 1 gedrückt schalte Relais 1 um
  • wenn Taster 2 gedrückt schalte Relais 2 um

Hierzu bedient man sich einer einfacher Regel (Rule), im Detail hier nachzulesen.

Eine einfache Regel um alle 8 Relais bei Betätigung des jeweiligen Tasters umzuschalten lautet

Rule1 ON PCF8574-2_INP#D0=0 DO Power1 TOGGLE ENDON ON PCF8574-2_INP#D1=0 DO Power2 TOGGLE ENDON ON PCF8574-2_INP#D2=0 DO Power3 TOGGLE ENDON ON PCF8574-2_INP#D3=0 DO Power4 TOGGLE ENDON ON PCF8574-2_INP#D4=0 DO Power5 TOGGLE ENDON ON PCF8574-2_INP#D6=0 DO Power7 TOGGLE ENDON ON PCF8574-2_INP#D7=0 DO Power8 TOGGLE ENDON

Diese Regel muss nun mittels Konsole gesetzt und aktiviert werden, hierzu in der ESP-OS Benutzeroberfläche

  1. auf Konsolen klicken und in der Konsolenübersicht auf Konsole klicken, es öffnet sich das ESP-OS Konsolenfenster
  2. in die Kommandozeile die Regel1 einfügen also (oder kopieren und einfügen)
    Rule1 ON PCF8574-2_INP#D0=0 DO Power1 TOGGLE ENDON ON PCF8574-2_INP#D1=0 DO Power2 TOGGLE ENDON ON PCF8574-2_INP#D2=0 DO Power3 TOGGLE ENDON ON PCF8574-2_INP#D3=0 DO Power4 TOGGLE ENDON ON PCF8574-2_INP#D4=0 DO Power5 TOGGLE ENDON ON PCF8574-2_INP#D6=0 DO Power7 TOGGLE ENDON ON PCF8574-2_INP#D7=0 DO Power8 TOGGLE ENDON
  3. die Taste ENTER drücken um das Kommando auszuführen, die Konsole bestätigt die Übernahme der Regel
  4. muss die Regel 1 aktiviert werden durch Eingabe von
    Rule1 1
    und
  5. und erneut durch drücken der Taste ENTER das Kommando ausführen, die Eingabe wird erneut innerhalb der Konsole bestätigt

drückt man nun einen Taster wird gemäß der festgelegten Regel die jeweilige Routine ausgeführt, in Anlehnung an obiges Beispiel

  • sobald Taster 1 gedrückt wird schaltet das Relais 1 um
  • sobald Taster 2 gedrückt wird schaltet das Relais 2 um
  • sobald Taster 3 gedrückt wird schaltet das Relais 3 um
  • sobald Taster 4 gedrückt wird schaltet das Relais 4 um
  • ….

Möchten man die Regel deaktivieren muss lediglich Rule1 0 in die Kommandozeile eigegeben und durch Drücken der Taster Enter übertragen werden.

Rule Configuration

Normally an User Input should interacting with Relays

  • Button 1 active, toggle Relays 1
  • Button2 active, toggle Relays 2

So all we need are a simple rule, details aboutrules you could find here.

A simple Rule for toggle Relays soon as a button is active

Rule1 ON PCF8574-2_INP#D0=0 DO Power1 TOGGLE ENDON ON PCF8574-2_INP#D1=0 DO Power2 TOGGLE ENDON ON PCF8574-2_INP#D2=0 DO Power3 TOGGLE ENDON ON PCF8574-2_INP#D3=0 DO Power4 TOGGLE ENDON ON PCF8574-2_INP#D4=0 DO Power5 TOGGLE ENDON ON PCF8574-2_INP#D6=0 DO Power7 TOGGLE ENDON ON PCF8574-2_INP#D7=0 DO Power8 TOGGLE ENDON

This Rule must implemented thru Terminal / Console

  1. click on Button Consoles and in Consoles Overview on Console
  2. write Rule1 into command line (of course copy and paste will do it)
    Rule1 ON PCF8574-2_INP#D0=0 DO Power1 TOGGLE ENDON ON PCF8574-2_INP#D1=0 DO Power2 TOGGLE ENDON ON PCF8574-2_INP#D2=0 DO Power3 TOGGLE ENDON ON PCF8574-2_INP#D3=0 DO Power4 TOGGLE ENDON ON PCF8574-2_INP#D4=0 DO Power5 TOGGLE ENDON ON PCF8574-2_INP#D6=0 DO Power7 TOGGLE ENDON ON PCF8574-2_INP#D7=0 DO Power8 TOGGLE ENDON
  3. Press ENTER Key on Keyboard, in console screen Rule1 will be confirmed
  4. to finish Rule1 must be enabled just write
    Rule1 1
    in command line and
  5. press ENTER key, Rule1 status will be confirmed

The Module / PCF8574 Inputs are enabled, based on 4CH Pro Relays Example

  • ON Button 1 is active TOGGLE Relays 1
  • ON Button 2 is active TOGGLE Relays 2
  • ON Button 3 is active TOGGLE Relays 3
  • ON Button 4 is active TOGGLE Relays 4
  • ….

To disable Rule1 just write Rule1 0 into command line and press ENTER key.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert