esp32s3 with relays and optocouplers done properly well

This commit is contained in:
Priec
2026-04-04 23:23:06 +02:00
parent 8b2b95bfd6
commit 7e9d113395
10 changed files with 8673 additions and 538 deletions

View File

@@ -31,3 +31,7 @@ https://www.tme.eu/sk/details/tbd62083afwg/drivery-integrovane-obvody/toshiba/
ESP32S3:
https://documentation.espressif.com/esp32-s3_datasheet_en.pdf
Relay:
https://www.tme.eu/sk/details/az943-1ch-24de/elektromagneticke-rele-miniaturne/zettler/
https://www.tme.eu/sk/katalog/rele_40/?queryPhrase=relay&onlyInStock=1&assortmentType=internal&params=938:1457360,1457447,1457667,1457797,1457507,1602368,1458755,1493876,1459217,1458012,1458050,1458036,1522827,1498499,1522843,1458058,1458130,1968765,1525631,1737495,1498503,2084608,2001791,1586883,1757448,1845382,2076641,1536013;693:1452246,1453058,1452144,1452767;925:1457342&productListOrderBy=1000014&productListOrderDir=ASC

215
poznamky_plc.txt Normal file
View File

@@ -0,0 +1,215 @@
I now have the full official Schneider Electric datasheet. Here is **everything** you need to know about the **SR1 B201BD** (Zelio Logic Smart Relay) — inputs and outputs only, with discrete values, sourced from the official Schneider Electric File 8501 catalog document.
---
## 🔷 IDENTIFICATION
The **SR1 B201BD** is a **Zelio-Logic™ Smart Relay** by Schneider Electric (Telemecanique). It is a **24 Vdc powered** unit with **12 inputs / 8 outputs**, with a clock, **not** a blind version.
**Source:** Schneider Electric File 8501, Ordering Information table, page 13.
---
## 🔷 INPUTS — Full Breakdown
### 1. Number & Type of Inputs
The SR1B201BD has **12 discrete 24 Vdc inputs** labeled **I1 through IA** (i.e., I1, I2, I3, I4, I5, I6, I7, I8, I9, IA), plus **2 analog inputs** labeled **IB and IC**. These are connected via **screw terminals**.
**Source:** Ordering Information table + Wiring Diagram, pages 1315.
---
### 2. Discrete Inputs (I1 to IA) — Exact Electrical Specs
| Parameter | Value |
|---|---|
| **Nominal input voltage** | **24 Vdc** |
| **Nominal input current** | **3 mA** |
| **State 1 (ON) — Voltage threshold** | **≥ 15 V** |
| **State 1 (ON) — Current threshold** | **> 1.8 mA** |
| **State 0 (OFF) — Voltage threshold** | **< 5 V** |
| **State 0 (OFF) — Current threshold** | **< 0.5 mA** |
| **Input impedance at State 1** | **8 kΩ** |
| **Response time — State 0 → 1** | **0.3 ms (Fast) … 3 ms (Slow)** |
| **Response time — State 1 → 0** | **0.5 ms (Fast) … 5 ms (Slow)** |
| **Conformity** | IEC 1131-2, **Type 1** |
| **Sensor compatibility** | **3-wire PNP only** |
| **2-wire sensors** | **Not supported** |
| **Input type** | **Resistive** |
| **Isolation (supply to inputs)** | **None** |
| **Isolation (between inputs)** | **None** |
| **Maximum counting frequency** | **60 Hz** |
**Source:** "Discrete 24 Vdc Input Characteristics" table, page 9 — column SR1-ppppBD (inputs I1 to IA).
---
### 3. Analog Inputs (IB and IC) — Exact Specs
| Parameter | Value |
|---|---|
| **Number of analog channels** | **2** (IB and IC) |
| **Voltage range** | **010 Vdc** |
| **Input impedance** | **62.5 kΩ at 10 V** |
| **Maximum non-destructive voltage** | **±30 V** |
| **Resolution** | **8 bits** |
| **Conversion time** | **Relay cycle time** |
| **Precision @ 25°C** | **±1.6% of full range** |
| **Precision @ 60°C** | **±2.9% of full range** |
| **Repeat accuracy @ 55°C** | **< 0.1% of full range** |
| **Isolation (analog channel to supply)** | **None** |
| **Max wiring distance** | **10 m maximum with shielded cable** |
**Source:** "Integral Analog Input Characteristics" table, page 10 — column SR1-BpppBD.
---
### 4. Analog Input Logic Functions (IB/IC used as discrete triggers)
Seven comparison functions can be performed on the analog inputs IB and IC to generate discrete contact outputs A1:
- **Analog 1:** A1 closes when IB **≤ reference voltage**
- **Analog 2:** A1 closes when IB **≥ reference voltage**
- **Analog 3:** A1 closes when IC **≤ reference voltage**
- **Analog 4:** A1 closes when IC **≥ reference voltage**
- **Analog 5:** A1 closes when IB **≤ IC**
- **Analog 6:** A1 closes when IB **≥ IC**
- **Analog 7:** A1 closes when IB is **within the window ICH to IC+H** (hysteresis band)
**Source:** "Overview of Functions — Analog Inputs" section, page 6.
---
### 5. Front Panel Arrow Keys as Inputs
The 4 arrow keys on the front of the relay **can be used as inputs** (push buttons) in the program.
**Source:** "Overview of Functions," page 6.
---
## 🔷 OUTPUTS — Full Breakdown
### 1. Number & Type of Outputs
The SR1B201BD has **8 relay outputs** (labeled Q1Q8), **without common potential** between them. Contact type is **N.O. (Normally Open)**.
**Source:** "Relay Output Characteristics" table, page 10 — column SR1-p201BD.
---
### 2. Relay Output Electrical Specs
| Parameter | Value |
|---|---|
| **Number of outputs** | **8** (no common potential) |
| **Contact type** | **N.O. (Normally Open)** |
| **Operating voltage range** | **5150 Vdc or 24250 Vac** |
| **Thermal current (max load)** | **8 A** |
| **Min switching capacity** | **10 mA at 5 V minimum** |
| **Low power switching reliability** | **17 V / 5 mA; 1 failure per 100 million cycles** |
| **Maximum operating rate (no load)** | **10 Hz** |
| **Maximum operating rate (at rated current)** | **0.5 Hz** |
| **Mechanical life** | **10 million operating cycles** |
| **Rated impulse withstand voltage** | **2.5 kV (per IEC 60947-1)** |
| **Response time — Trip** | **10 ms** |
| **Response time — Reset** | **5 ms** |
| **Short-circuit protection** | **None** |
| **Overvoltage/overload protection** | **None** |
**Source:** "Relay Output Characteristics" table, page 10.
---
### 3. Output Electrical Durability (500,000 cycle ratings)
| Load Category | Conditions | Max Current |
|---|---|---|
| **DC-12** | Resistive / solid-state loads at 24 Vdc | **1.5 A** |
| **DC-13** | Inductive (electromagnets), L/R = 10 ms, 24 Vdc | **0.6 A** |
| **AC-12** | Resistive / solid-state loads at 230 Vac | **1.5 A** |
| **AC-15** | Inductive loads >72 VA at 230 Vac | **0.9 A** |
**Source:** "Relay Output Characteristics — Electrical Durability" table, page 10.
---
### 4. Output Terminal Wiring Specs
| Parameter | Value |
|---|---|
| **Screwdriver size** | Ø 3.5 mm |
| **Flex cable (1 conductor)** | 0.141.5 mm² (AWG26AWG16) |
| **Flex cable (2 conductors)** | 0.140.75 mm² (AWG26AWG18) |
| **Rigid/semi-rigid cable (1 conductor)** | 0.142.5 mm² (AWG26AWG14) |
| **Rigid cable (2 conductors)** | 0.141.5 mm² (AWG26AWG16) |
| **Tightening torque** | **0.6 N·m** |
**Source:** "Relay Output Characteristics — Connection" section, page 10.
---
## 🔷 PROCESSING / TIMING
| Parameter | SR1B201BD Value |
|---|---|
| **Control scheme lines (program size)** | **80 lines** |
| **Maximum cycle time** | **8 ms** |
| **Input-to-output response time** | **14 to 26 ms** |
| **Clock backup (power failure)** | **≥ 150 h at 40°C** |
| **Program memory** | **For life — internal EEPROM** |
| **Clock drift** | **≤ 6 seconds/month** |
| **Time delay accuracy** | **±12 ms or ±0.5% of time displayed** |
**Source:** "Processing Characteristics" table, page 11.
---
## 🔷 POWER SUPPLY (for context)
| Parameter | Value |
|---|---|
| **Nominal supply voltage** | **24 Vdc** |
| **Voltage limits** | **19.2 to 30 V (including ripple)** |
| **Nominal input current** | **130 mA** |
| **Heat dissipation** | **2.9 W** |
| **Hold-up time (power loss)** | **≤ 1 ms, repeated 20 times** |
| **Polarity inversion protection** | **Yes** |
**Source:** "Supply Characteristics Vdc" table, page 9 — column SR1-B201BD.
---
## 📄 Source Document
**Full citation:** Schneider Electric, *Zelio-Logic™ Relays SR1, File 8501*, catalog document, October 2003 (ref: 8501CT0001R1/03).
**URL:** `http://5.imimg.com/data5/SELLER/Doc/2024/3/402848026/VR/PZ/FO/64267321/schneider-sr1-b201bd-logic-relay.pdf`
**Relevant pages:** 9 (supply + discrete inputs), 10 (analog inputs + relay outputs), 11 (processing), 13 (ordering/ID), 1415 (wiring diagrams).

2695
projekt2/PLC2 GPI.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

1106
projekt2/PLC2.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

2747
projekt2/Relays.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -424,6 +424,18 @@
[
"afd25571-f7da-492c-bebb-d752e2b954c0",
"Optocouplers1"
],
[
"5b67250f-355a-4c65-ba9d-a43c60854ac8",
"PLC2 GPO"
],
[
"114a0c5b-b79e-4a9a-ba31-888f2d71abad",
"PLC2 GPI"
],
[
"2f0daa86-7bed-42d8-ac89-2ed7b6947d4f",
"Relays"
]
],
"text_variables": {}

File diff suppressed because it is too large Load Diff

BIN
vyber_rele.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB