{"id":88682,"date":"2021-09-09T08:00:14","date_gmt":"2021-09-09T06:00:14","guid":{"rendered":"https:\/\/botland.com.pl\/blog\/esp32-podlaczenie-przekaznika-i-oswietlenie-led\/"},"modified":"2024-09-09T11:52:51","modified_gmt":"2024-09-09T09:52:51","slug":"esp32-relaisanschluss-und-led-beleuchtung","status":"publish","type":"post","link":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/","title":{"rendered":"ESP32 &#8211; Relaisanschluss und LED-Beleuchtung"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Lesezeit<\/span> <span class=\"rt-time\"> 2<\/span> <span class=\"rt-label rt-postfix\">min.<\/span><\/span>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"88682\" class=\"elementor elementor-88682 elementor-28573\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-074b3c8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"074b3c8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f713fcd\" data-id=\"f713fcd\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1dab25d elementor-widget elementor-widget-text-editor\" data-id=\"1dab25d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In diesem Artikel werden wir ein Relais an ein ESP32-Modul anschlie\u00dfen und ein Beleuchtungssteuerungssystem mit einer LED erstellen. Sie k\u00f6nnen auch eine normale 230-V-Gl\u00fchbirne verwenden, aber dabei ist Vorsicht geboten. <\/p>\n<p><span style=\"font-size: 1rem;\">Im <a href=\"https:\/\/botland.com.pl\/blog\/esp32-polaczenie-z-czujnikiem-temperatury-ds18b20\/\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\">ersten Artikel<\/a> dieser Serie haben wir eine Anleitung zur Programmierung des ESP32 in der Arduino IDE gegeben.<\/span><\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5cbd241 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5cbd241\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-008c99b\" data-id=\"008c99b\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d4ab211 elementor-widget elementor-widget-heading\" data-id=\"d4ab211\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><section data-id=\"eb3d212\" data-element_type=\"section\" style=\"font-family: Roboto, sans-serif;font-size: 16px;font-weight: 400;white-space: normal\"><div><div style=\"width: 900px\"><div data-id=\"4a51aef\" data-element_type=\"column\" style=\"width: 900px\"><div style=\"width: 900px\"><div style=\"width: 880px\"><div data-id=\"4eb095d\" data-element_type=\"widget\" data-widget_type=\"heading.default\" style=\"width: 880px\"><div><h2 style=\"font-family: var( --e-global-typography-primary-font-family ), Sans-serif;font-weight: var( --e-global-typography-primary-font-weight )\">&nbsp;Was ben\u00f6tigen wir f\u00fcr die Durchf\u00fchrung des Projekts?<\/h2><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5529f70 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5529f70\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e41a4ec\" data-id=\"e41a4ec\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-10af8f4 elementor-widget elementor-widget-text-editor\" data-id=\"10af8f4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>F\u00fcr das Lichtsteuerungsprojekt ben\u00f6tigen wir ein ESP32-Modul, ein Relaismodul und eine LED oder Gl\u00fchbirne. Wir empfehlen unser vorbereitetes <a href=\"https:\/\/botland.de\/wifi-und-bt-module-esp32\/19291-esp32-starter-kit-starter-kit-mit-esp32-wifi-modul-5903351242950.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\">ESP32-Kit<\/a>, das alle notwendigen Komponenten f\u00fcr dieses und fr\u00fchere Projekte enth\u00e4lt. <\/p>\n<p>Eine vollst\u00e4ndige Liste der Produkte finden Sie unten:<\/p>\n<ul>\n<li><a href=\"https:\/\/botland.de\/wifi-und-bt-module-esp32\/8893-esp32-wifi-bt-42-plattform-mit-esp-wroom-32-modul-kompatibel-mit-esp32-devkit-5904422337438.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\">ESP32-Modul<\/a><\/li>\n<li><a href=\"https:\/\/botland.de\/relais-arduino-relais\/1997-relaismodul-1-kanal-mit-optoisolation-10a-250vac-kontakte-5v-spule-5904422359096.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"><a href=\"https:\/\/botland.de\/relais-arduino-relais\/1997-relaismodul-1-kanal-mit-optoisolation-10a-250vac-kontakte-5v-spule-5904422359096.html\">Relaismodul<\/a><\/a><\/li>\n<li><a href=\"https:\/\/botland.de\/led-dioden\/19985-ein-satz-5mm-leds-justpi-30st-5904422329259.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\">LED<\/a> (oder Gl\u00fchbirne)<\/li>\n<li><a href=\"https:\/\/botland.de\/eingestellte-produkte\/4544-kohle-tht-widerstand-cf-1-4w-330-30st-5904422305352.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"><a href=\"https:\/\/botland.de\/eingestellte-produkte\/4544-kohle-tht-widerstand-cf-1-4w-330-30st-5904422305352.html\">330 \u03a9 Widerstand<\/a><\/a><\/li>\n<li><a href=\"https:\/\/botland.de\/taktschalter\/377-taktschalter-6x6mm-43mm-tht-5st-5904422307622.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"><a href=\"https:\/\/botland.de\/taktschalter\/377-taktschalter-6x6mm-43mm-tht-5st-5904422307622.html\">tact-switch Taste<\/a><\/a><\/li>\n<li><a href=\"https:\/\/botland.de\/eingestellte-produkte\/1022-stecker-stecker-verbindungskabel-65-stk-5904422304409.html\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\">Verbindungskabel m\u00e4nnlich zu m\u00e4nnlich<\/a> und<a href=\"https:\/\/botland.de\/82-verbindungskabel\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"> weiblich zu weiblich<\/a><\/li>\n<li><a href=\"https:\/\/botland.de\/476-microusb-20-kabel\" target=\"_blank\" rel=\"noopener\" data-wpel-link=\"internal\"><a href=\"https:\/\/botland.de\/476-microusb-20-kabel\">MicroUSB-Kabel<\/a><\/a><\/li>\n<\/ul>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-276849a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"276849a\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d1c1cbc\" data-id=\"d1c1cbc\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f16ce60 elementor-widget elementor-widget-heading\" data-id=\"f16ce60\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Verbindung von Komponenten<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5f8ec2f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5f8ec2f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-81a02e5\" data-id=\"81a02e5\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4228813 elementor-widget elementor-widget-text-editor\" data-id=\"4228813\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Das Relais kann, wie der PIR-Bewegungssensor, nicht an die Kontaktplatine angeschlossen werden. Das Modul wurde mit Hilfe von Verbindungsleitungen an den ESP32 angeschlossen. Die Relaisspule wird mit <b>5 V<\/b> versorgt, also wurde der <b>VCC-Pin <\/b>mit dem <b>VIN-Pin<\/b> des ESP32 verbunden. Um die Relaisspule aus dem ESP32-Bausatz aus anzusteuern, muss der IN-Pin auf einen<b> niedrigen Wert<\/b> gebracht werden, wir verwenden <b>Pin 5<\/b> des ESP32-Moduls. Das Ger\u00e4t, das durch das Relais mit Strom versorgt werden soll, muss an die Schraubklemmen angeschlossen werden. In unserem Fall ist es eine LED, deren Spannung an die Pins COM und NO angeschlossen wird. Die Spule des Relais wird eingeschaltet, wenn die an <b>Pin 15<\/b> des ESP32-Moduls angeschlossene Taste gedr\u00fcckt wird. Einen detaillierten Schaltplan finden Sie unten.      <\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-099fbdb elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"099fbdb\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-93ecec7\" data-id=\"93ecec7\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8ae7ae6 elementor-widget elementor-widget-image\" data-id=\"8ae7ae6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"473\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_button-1024x606.jpg\" class=\"attachment-large size-large wp-image-48730\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_button-1024x606.jpg 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_button-300x178.jpg 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_button-768x455.jpg 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_button-1536x909.jpg 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_button.jpg 1860w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-bd4b0b7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bd4b0b7\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-712df84\" data-id=\"712df84\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5b2aff2 elementor-widget elementor-widget-heading\" data-id=\"5b2aff2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Programm f\u00fcr ESP32<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e312317 elementor-widget elementor-widget-code-highlight\" data-id=\"e312317\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard word-wrap\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-less line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-less\">\n\t\t\t\t\t<xmp>    \/\/ definiujemy piny, gdzie pod\u0142\u0105czyli\u015bmy przeka\u017anik oraz__przycisk\r\nint relay_pin = 5;  \r\nint button_pin = 15;\r\n\r\nvoid setup() {\r\n  Serial.begin(115200);\r\n  pinMode(relay_pin, OUTPUT);   \/\/ ustawiamy pin przeka\u017anika jako OUTPUT \r\n  pinMode(button_pin, INPUT_PULLUP);    \/\/ ustawiamy pin przycisku jako INPUT_PULLUP\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ definiujemy aby stan przycisku odczytywany by\u0142 cyforowo: wysoki \/ niski\r\n  int buttonState = digitalRead(button_pin);\r\n  \/\/ definiujemy zale\u017cno\u015b\u0107: \r\n  if (buttonState == LOW) { \/\/ je\u017celi przycisk przejdzie w stan niski\r\n    Serial.println(\"Przycisk zosta\u0142 wci\u015bni\u0119ty\");\r\n    digitalWrite(relay_pin, LOW);   \/\/ przeka\u017anik za\u0142\u0105czy si\u0119\r\n  }\r\n  else if (buttonState == HIGH) {\r\n    Serial.println(\"Przycisk zosta\u0142 puszczony\");\r\n    digitalWrite(relay_pin, HIGH);\r\n  }\r\n} <\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f532ff9 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f532ff9\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-32bb523\" data-id=\"32bb523\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-55d62d2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"55d62d2\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-2c007a9\" data-id=\"2c007a9\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-71a595b elementor-widget elementor-widget-image\" data-id=\"71a595b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/botland.com.pl\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-scaled.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"IMG-2494\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6NDg3MzEsInVybCI6Imh0dHBzOlwvXC9ib3RsYW5kLmRlXC9ibG9nXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDIxXC8wOFwvSU1HLTI0OTQtc2NhbGVkLmpwZyJ9\" data-wpel-link=\"internal\">\n\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-1024x768.jpg\" class=\"attachment-large size-large wp-image-48731\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-1024x768.jpg 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-300x225.jpg 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-768x576.jpg 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-1536x1152.jpg 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2494-2048x1536.jpg 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-820da5f\" data-id=\"820da5f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c7d37e2 elementor-widget elementor-widget-image\" data-id=\"c7d37e2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/botland.com.pl\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-scaled.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"IMG-2495\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6NDg3MzIsInVybCI6Imh0dHBzOlwvXC9ib3RsYW5kLmRlXC9ibG9nXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDIxXC8wOFwvSU1HLTI0OTUtc2NhbGVkLmpwZyJ9\" data-wpel-link=\"internal\">\n\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-1024x768.jpg\" class=\"attachment-large size-large wp-image-48732\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-1024x768.jpg 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-300x225.jpg 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-768x576.jpg 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-1536x1152.jpg 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2495-2048x1536.jpg 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6d69350 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6d69350\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-64cb23a\" data-id=\"64cb23a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-fe90dde elementor-widget elementor-widget-heading\" data-id=\"fe90dde\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Fernsteuerung des Relais<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b074aa5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b074aa5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5b802a2\" data-id=\"5b802a2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2347b79 elementor-widget elementor-widget-text-editor\" data-id=\"2347b79\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Der ESP32 Webserver kann verwendet werden, um die Beleuchtung mit Relais fernzusteuern. [NUM_RELAYS] Im folgenden Programm kann eine beliebige Anzahl von Relais verwendet werden, indem Sie die in der Zeile #define NUM_RELAYS angegebene Anzahl \u00e4ndern und die entsprechenden Pins, an die die Relais angeschlossen sind, in int relayGPIOs = { }; angeben. <\/p>\n<p>Sobald das Programm geladen ist, wird die lokale IP-Adresse, unter der der Server erstellt wurde, im seriellen Monitor angezeigt. <\/p>\n<pre><i>https:\/\/randomnerdtutorials.com\/esp32-esp8266-relay-web-server\/<\/i><\/pre>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-856bbd1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"856bbd1\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5385cfd\" data-id=\"5385cfd\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-804020a elementor-widget elementor-widget-image\" data-id=\"804020a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"473\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_bb-1024x606.jpg\" class=\"attachment-large size-large wp-image-48738\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_bb-1024x606.jpg 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_bb-300x178.jpg 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_bb-768x455.jpg 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_bb-1536x909.jpg 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/ESP32_relay_bb.jpg 1860w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9abe9bc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9abe9bc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b98e380\" data-id=\"b98e380\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-937f5b6 elementor-widget elementor-widget-code-highlight\" data-id=\"937f5b6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>#include <WiFi.h>\r\n#include <AsyncTCP.h>\r\n#include <ESPAsyncWebServer.h>\r\n\r\n\/\/Ustaw warto\u015b\u0107 true, aby zdefiniowa\u0107 przeka\u017anik jako normalnie otwarty (NO)\r\n#define RELAY_NO    true\r\n\r\n\/\/Ustaw liczb\u0119 przeka\u017anik\u00f3w\r\n#define NUM_RELAYS  1\r\n\r\n\/\/Przyporz\u0105dkuj ka\u017cde GPIO do przeka\u017anika\r\nint relayGPIOs[NUM_RELAYS] = {5};\r\n\r\nconst char* ssid = \"Twoje_SSID\";\r\nconst char* password = \"Twoje_haslo\";\r\n\r\nconst char* PARAM_INPUT_1 = \"relay\";\r\nconst char* PARAM_INPUT_2 = \"state\";\r\n\r\n\/\/Tworzenie obiektu AsyncWebServer na porcie 80\r\nAsyncWebServer server(80);\r\n\r\nconst char index_html[] PROGMEM = R\"rawliteral(\r\n<!DOCTYPE HTML><html>\r\n<head>\r\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n  <style>\r\n    html {font-family: Arial; display: inline-block; text-align: center;}\r\n    h2 {font-size: 3.0rem;}\r\n    p {font-size: 3.0rem;}\r\n    body {max-width: 600px; margin:0px auto; padding-bottom: 25px;}\r\n    .switch {position: relative; display: inline-block; width: 120px; height: 68px} \r\n    .switch input {display: none}\r\n    .slider {position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 34px}\r\n    .slider:before {position: absolute; content: \"\"; height: 52px; width: 52px; left: 8px; bottom: 8px; background-color: #fff; -webkit-transition: .4s; transition: .4s; border-radius: 68px}\r\n    input:checked+.slider {background-color: #2196F3}\r\n    input:checked+.slider:before {-webkit-transform: translateX(52px); -ms-transform: translateX(52px); transform: translateX(52px)}\r\n  <\/style>\r\n<\/head>\r\n<body>\r\n  <h2>Oswietlenie<\/h2>\r\n  %BUTTONPLACEHOLDER%\r\n<script>function toggleCheckbox(element) {\r\n  var xhr = new XMLHttpRequest();\r\n  if(element.checked){ xhr.open(\"GET\", \"\/update?relay=\"+element.id+\"&state=1\", true); }\r\n  else { xhr.open(\"GET\", \"\/update?relay=\"+element.id+\"&state=0\", true); }\r\n  xhr.send();\r\n}<\/script>\r\n<\/body>\r\n<\/html>\r\n)rawliteral\";\r\n\r\n\/\/Zast\u0119puje placeholder sekcj\u0105 przycisku na twojej stronie internetowej\r\nString processor(const String& var){\r\n  \/\/Serial.println(var);\r\n  if(var == \"BUTTONPLACEHOLDER\"){\r\n    String buttons =\"\";\r\n    for(int i=1; i<=NUM_RELAYS; i++){\r\n      String relayStateValue = relayState(i);\r\n      buttons+= \"<h4>Przekaznik #\" + String(i) + \" - GPIO \" + relayGPIOs[i-1] + \"<\/h4><label class=\\\"switch\\\"><input type=\\\"checkbox\\\" onchange=\\\"toggleCheckbox(this)\\\" id=\\\"\" + String(i) + \"\\\" \"+ relayStateValue +\"><span class=\\\"slider\\\"><\/span><\/label>\";\r\n    }\r\n    return buttons;\r\n  }\r\n  return String();\r\n}\r\n\r\nString relayState(int numRelay){\r\n  if(RELAY_NO){\r\n    if(digitalRead(relayGPIOs[numRelay-1])){\r\n      return \"\";\r\n    }\r\n    else {\r\n      return \"checked\";\r\n    }\r\n  }\r\n  else {\r\n    if(digitalRead(relayGPIOs[numRelay-1])){\r\n      return \"checked\";\r\n    }\r\n    else {\r\n      return \"\";\r\n    }\r\n  }\r\n  return \"\";\r\n}\r\n\r\nvoid setup(){\r\n  Serial.begin(115200);\r\n\r\n    \/\/ Ustaw wszystkie przeka\u017aniki na wy\u0142\u0105czenie przy starcie programu - je\u015bli ustawione na Normally Open (NO), przeka\u017anik jest wy\u0142\u0105czony, gdy ustawisz przeka\u017anik na HIGH\r\n  for(int i=1; i<=NUM_RELAYS; i++){\r\n    pinMode(relayGPIOs[i-1], OUTPUT);\r\n    if(RELAY_NO){\r\n      digitalWrite(relayGPIOs[i-1], HIGH);\r\n    }\r\n    else{\r\n      digitalWrite(relayGPIOs[i-1], LOW);\r\n    }\r\n  }\r\n  \r\n  \/\/Po\u0142\u0105cz z WiFi\r\n  WiFi.begin(ssid, password);\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(1000);\r\n    Serial.println(\"\u0141\u0105czenie z WiFi..\");\r\n  }\r\n\r\n  \/\/Wy\u015bwietl lokalne IP\r\n  Serial.println(WiFi.localIP());\r\n\r\n  \/\/ Route dla root \/ web page\r\n  server.on(\"\/\", HTTP_GET, [](AsyncWebServerRequest *request){\r\n    request->send_P(200, \"text\/html\", index_html, processor);\r\n  });\r\n\r\n  \/\/Wy\u015blij \u017c\u0105danie GET do <ESP_IP>\/update?relay=<inputMessage>&state=<inputMessage2>.\r\n  server.on(\"\/update\", HTTP_GET, [] (AsyncWebServerRequest *request) {\r\n    String inputMessage;\r\n    String inputParam;\r\n    String inputMessage2;\r\n    String inputParam2;\r\n    \/\/GET input1 value on <ESP_IP>\/update?relay=<inputMessage>\r\n    if (request->hasParam(PARAM_INPUT_1) & request->hasParam(PARAM_INPUT_2)) {\r\n      inputMessage = request->getParam(PARAM_INPUT_1)->value();\r\n      inputParam = PARAM_INPUT_1;\r\n      inputMessage2 = request->getParam(PARAM_INPUT_2)->value();\r\n      inputParam2 = PARAM_INPUT_2;\r\n      if(RELAY_NO){\r\n        Serial.print(\"NO \");\r\n        digitalWrite(relayGPIOs[inputMessage.toInt()-1], !inputMessage2.toInt());\r\n      }\r\n      else{\r\n        Serial.print(\"NC \");\r\n        digitalWrite(relayGPIOs[inputMessage.toInt()-1], inputMessage2.toInt());\r\n      }\r\n    }\r\n    else {\r\n      inputMessage = \"No message sent\";\r\n      inputParam = \"none\";\r\n    }\r\n    Serial.println(inputMessage + inputMessage2);\r\n    request->send(200, \"text\/plain\", \"OK\");\r\n  });\r\n  \/\/ Start server\r\n  server.begin();\r\n}\r\n  \r\nvoid loop() {\r\n\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b22aece elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b22aece\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1ca9f24\" data-id=\"1ca9f24\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-edcd928 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"edcd928\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-366b2f8\" data-id=\"366b2f8\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e997561 elementor-widget elementor-widget-image\" data-id=\"e997561\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"391\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_xWmCfm4aiU-1024x500.png\" class=\"attachment-large size-large wp-image-48736\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_xWmCfm4aiU-1024x500.png 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_xWmCfm4aiU-300x146.png 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_xWmCfm4aiU-768x375.png 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_xWmCfm4aiU-1536x750.png 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_xWmCfm4aiU.png 1920w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-d5732c1\" data-id=\"d5732c1\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1b86464 elementor-widget elementor-widget-image\" data-id=\"1b86464\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2502-1024x768.jpg\" class=\"attachment-large size-large wp-image-48734\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2502-1024x768.jpg 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2502-300x225.jpg 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2502-768x576.jpg 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2502-1536x1152.jpg 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2502-2048x1536.jpg 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7dd1ee8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7dd1ee8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f187f9a\" data-id=\"f187f9a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-5815efa elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5815efa\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-8b9fe84\" data-id=\"8b9fe84\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9115224 elementor-widget elementor-widget-image\" data-id=\"9115224\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"391\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_yQNSSnIlAn-1024x500.png\" class=\"attachment-large size-large wp-image-48737\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_yQNSSnIlAn-1024x500.png 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_yQNSSnIlAn-300x146.png 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_yQNSSnIlAn-768x375.png 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_yQNSSnIlAn-1536x750.png 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/chrome_yQNSSnIlAn.png 1920w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-3b1b05d\" data-id=\"3b1b05d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b959a10 elementor-widget elementor-widget-image\" data-id=\"b959a10\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2503-1024x768.jpg\" class=\"attachment-large size-large wp-image-48735\" alt=\"\" srcset=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2503-1024x768.jpg 1024w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2503-300x225.jpg 300w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2503-768x576.jpg 768w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2503-1536x1152.jpg 1536w, https:\/\/botland.de\/blog\/wp-content\/uploads\/2021\/08\/IMG-2503-2048x1536.jpg 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.<\/p>\n","protected":false},"author":5,"featured_media":62359,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[465,475],"tags":[],"class_list":["post-88682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-elektronik","category-tipps"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ESP32 - Relaisanschluss und LED-Beleuchtung - Botland<\/title>\n<meta name=\"description\" content=\"Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ESP32 - Relaisanschluss und LED-Beleuchtung - Botland\" \/>\n<meta property=\"og:description\" content=\"Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/\" \/>\n<meta property=\"og:site_name\" content=\"Botland\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/Botland\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-09T06:00:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-09T09:52:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/botland.de\/blog\/wp-content\/uploads\/2023\/05\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1510\" \/>\n\t<meta property=\"og:image:height\" content=\"755\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Grzegorz Galuba\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Grzegorz Galuba\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/\"},\"author\":{\"name\":\"Grzegorz Galuba\",\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#\\\/schema\\\/person\\\/320f225a4bee757f7d030c49aea2a072\"},\"headline\":\"ESP32 &#8211; Relaisanschluss und LED-Beleuchtung\",\"datePublished\":\"2021-09-09T06:00:14+00:00\",\"dateModified\":\"2024-09-09T09:52:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/\"},\"wordCount\":337,\"publisher\":{\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg\",\"articleSection\":[\"Elektronik\",\"Tipps\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/\",\"url\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/\",\"name\":\"ESP32 - Relaisanschluss und LED-Beleuchtung - Botland\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg\",\"datePublished\":\"2021-09-09T06:00:14+00:00\",\"dateModified\":\"2024-09-09T09:52:51+00:00\",\"description\":\"Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#primaryimage\",\"url\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg\",\"contentUrl\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg\",\"width\":1510,\"height\":755},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/esp32-relaisanschluss-und-led-beleuchtung\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\\\/\\\/botland.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ESP32 &#8211; Relaisanschluss und LED-Beleuchtung\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/botland.store\\\/blog\\\/\",\"name\":\"Botland\",\"description\":\"Blog Raspberry Pi, Arduino, elektronika i robotyka - Botland\",\"publisher\":{\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/botland.store\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#organization\",\"name\":\"Botland\",\"url\":\"https:\\\/\\\/botland.store\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/botland.store\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/logo_kolor_WP_2-1.png\",\"contentUrl\":\"https:\\\/\\\/botland.store\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/logo_kolor_WP_2-1.png\",\"width\":250,\"height\":57,\"caption\":\"Botland\"},\"image\":{\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/facebook.com\\\/Botland\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/botland.store\\\/blog\\\/#\\\/schema\\\/person\\\/320f225a4bee757f7d030c49aea2a072\",\"name\":\"Grzegorz Galuba\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/logo_kolor_WP_3-1-150x150.png\",\"url\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/logo_kolor_WP_3-1-150x150.png\",\"contentUrl\":\"https:\\\/\\\/botland.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/logo_kolor_WP_3-1-150x150.png\",\"caption\":\"Grzegorz Galuba\"},\"description\":\"GG nie ma czasu na gadu-gadu - jest zawsze na bie\u017c\u0105co z nowo\u015bciami z oferty, wybiera tylko najlepsze i dba, aby pojawia\u0142y si\u0119 na czas. Jego rozleg\u0142a wiedza o specyfikacjach technicznych produkt\u00f3w to nieocenione wsparcie dla ca\u0142ej ekipy. Do pracy przyje\u017cd\u017ca rowerem i ju\u017c najwy\u017csza pora, aby wszyscy zacz\u0119li bra\u0107 z niego przyk\u0142ad. Oaza spokoju.\",\"url\":\"https:\\\/\\\/botland.de\\\/blog\\\/author\\\/grzegorz\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ESP32 - Relaisanschluss und LED-Beleuchtung - Botland","description":"Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/","og_locale":"de_DE","og_type":"article","og_title":"ESP32 - Relaisanschluss und LED-Beleuchtung - Botland","og_description":"Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.","og_url":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/","og_site_name":"Botland","article_publisher":"https:\/\/facebook.com\/Botland\/","article_published_time":"2021-09-09T06:00:14+00:00","article_modified_time":"2024-09-09T09:52:51+00:00","og_image":[{"width":1510,"height":755,"url":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2023\/05\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg","type":"image\/jpeg"}],"author":"Grzegorz Galuba","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Grzegorz Galuba","Gesch\u00e4tzte Lesezeit":"4\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#article","isPartOf":{"@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/"},"author":{"name":"Grzegorz Galuba","@id":"https:\/\/botland.store\/blog\/#\/schema\/person\/320f225a4bee757f7d030c49aea2a072"},"headline":"ESP32 &#8211; Relaisanschluss und LED-Beleuchtung","datePublished":"2021-09-09T06:00:14+00:00","dateModified":"2024-09-09T09:52:51+00:00","mainEntityOfPage":{"@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/"},"wordCount":337,"publisher":{"@id":"https:\/\/botland.store\/blog\/#organization"},"image":{"@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#primaryimage"},"thumbnailUrl":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2023\/05\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg","articleSection":["Elektronik","Tipps"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/","url":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/","name":"ESP32 - Relaisanschluss und LED-Beleuchtung - Botland","isPartOf":{"@id":"https:\/\/botland.store\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#primaryimage"},"image":{"@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#primaryimage"},"thumbnailUrl":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2023\/05\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg","datePublished":"2021-09-09T06:00:14+00:00","dateModified":"2024-09-09T09:52:51+00:00","description":"Eine Schritt-f\u00fcr-Schritt-Anleitung zum Anschluss eines Relais an ein ESP32-Modul und zur Erstellung eines Beleuchtungssteuerungssystems mit einer LED.","breadcrumb":{"@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#primaryimage","url":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2023\/05\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg","contentUrl":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2023\/05\/new2023-zestaw-esp32_okladka-nr5-przekaznik-4.jpg","width":1510,"height":755},{"@type":"BreadcrumbList","@id":"https:\/\/botland.de\/blog\/esp32-relaisanschluss-und-led-beleuchtung\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/botland.de\/blog\/"},{"@type":"ListItem","position":2,"name":"ESP32 &#8211; Relaisanschluss und LED-Beleuchtung"}]},{"@type":"WebSite","@id":"https:\/\/botland.store\/blog\/#website","url":"https:\/\/botland.store\/blog\/","name":"Botland","description":"Blog Raspberry Pi, Arduino, elektronika i robotyka - Botland","publisher":{"@id":"https:\/\/botland.store\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/botland.store\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/botland.store\/blog\/#organization","name":"Botland","url":"https:\/\/botland.store\/blog\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/botland.store\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/botland.store\/blog\/wp-content\/uploads\/2018\/04\/logo_kolor_WP_2-1.png","contentUrl":"https:\/\/botland.store\/blog\/wp-content\/uploads\/2018\/04\/logo_kolor_WP_2-1.png","width":250,"height":57,"caption":"Botland"},"image":{"@id":"https:\/\/botland.store\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/Botland\/"]},{"@type":"Person","@id":"https:\/\/botland.store\/blog\/#\/schema\/person\/320f225a4bee757f7d030c49aea2a072","name":"Grzegorz Galuba","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2019\/03\/logo_kolor_WP_3-1-150x150.png","url":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2019\/03\/logo_kolor_WP_3-1-150x150.png","contentUrl":"https:\/\/botland.de\/blog\/wp-content\/uploads\/2019\/03\/logo_kolor_WP_3-1-150x150.png","caption":"Grzegorz Galuba"},"description":"GG nie ma czasu na gadu-gadu - jest zawsze na bie\u017c\u0105co z nowo\u015bciami z oferty, wybiera tylko najlepsze i dba, aby pojawia\u0142y si\u0119 na czas. Jego rozleg\u0142a wiedza o specyfikacjach technicznych produkt\u00f3w to nieocenione wsparcie dla ca\u0142ej ekipy. Do pracy przyje\u017cd\u017ca rowerem i ju\u017c najwy\u017csza pora, aby wszyscy zacz\u0119li bra\u0107 z niego przyk\u0142ad. Oaza spokoju.","url":"https:\/\/botland.de\/blog\/author\/grzegorz\/"}]}},"_links":{"self":[{"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/posts\/88682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/comments?post=88682"}],"version-history":[{"count":0,"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/posts\/88682\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/media\/62359"}],"wp:attachment":[{"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/media?parent=88682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/categories?post=88682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/botland.de\/blog\/wp-json\/wp\/v2\/tags?post=88682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}