MQTT – Praktisches Beispiel

MQTT – Praktisches Beispiel

In diesem Praxisbeispiel haben wir zweimal denselben Aufbau. Einmal mit dem NodeMCU-ESP8266 und einmal mit dem NodeMCU-ESP32. An beide Mikrocontroller sind jeweils eine LED und ein Taster angebracht. Wenn ein Taster gedrückt wird, dann wird die LED über ein MQTT Topic am anderen Mikrocontroller eingeschaltet, solange der Taster gedrückt wird. An dem Taster ist jeweils ein Pull-up Widerstand verbaut mit einem Widerstandswert von 1 kΩ.

Die Grundlagen zu MQTT findet ihr hier:

https://edistechlab.com/mqtt-einfach-erklaert/

Anschluss Plan

Beispiel Material:

* https://amzn.to/3fzAe0M – Widerstand Set

* https://amzn.to/3oUZ14g – 300 Stk. Leuchtdioden Set 3 und 5 mm

* https://amzn.to/34ifkjS – 180 Stück Taktilen Drucktaster Sortiment

* https://amzn.to/2QQ7JSL – Breadboard Steckbrett mit 830 Kontakten oder

* https://amzn.to/35GcPIp – 3 Stk. Breadboard Steckbrett mit 400 Kontakten

* https://amzn.to/2xeKb2V – Set 3 x 40 STK. je 20 cm M2M/ F2M / F2F

https://amzn.to/2U7Urmn – NodeMCU ESP8266 ESP-12F

https://amzn.to/3erQVKq – ESP32 Node-MCU Board

Node-MCU ESP8266 Board:

* https://amzn.to/2U7Urmn – NodeMCU ESP8266 ESP-12F

* https://amzn.to/2J5wLJ3 – 3er Set, ESP8266 ESP-12F

* https://amzn.to/3belvGd – 5er Set, ESP8266 ESP-12F

Relais:

* https://amzn.to/3a5yUjQ – 1 Stk. Relais 5V KY-019 Modul – 10A

* https://amzn.to/2xi4Kvq – 3 Stk. Relais 5V KY-019 Modul – 10A

* https://amzn.to/2U9ZqmL – 5 Stk. Relais 5V KY-019 Modul – 10A

Netzteile:

* https://amzn.to/3beWY3V – 2er-Pack USB Ladegerät 5V/2A

* https://amzn.to/398WzP9 – Raspberry Pi 4 Netzteil, USB-C, 5.1V, 3A

* https://amzn.to/2wsS8Bh  – HomeSpot Netzteil 3A/5V inkl. 1,5M Micro USB Kabel 

Jumper Wire:

* https://amzn.to/2WxKwIl Female to Female F2F 40 STK. je 20 cm

* https://amzn.to/2xeKb2V – Set 3 x 40 STK. je 20 cm M2M/ F2M / F2F

►Breadboard:

* https://amzn.to/2QQ7JSL – Breadboard Steckbrett mit 830 Kontakten

USB Kabel:

* https://amzn.to/2y01THNUSB A auf Micro USB  Kabel 0.5m

* https://amzn.to/2xkgqgQ – USB auf Mini USB Kabel 0.5m

* https://amzn.to/2QBxCp7 – USB A zu USB B Kabel 0.5m

Alle Links mit “*” sind Amazon Affiliate Links. Ich bekomme bei einer Bestellung einen kleinen Teil vom Umsatz, ohne das euch dafür Mehrkosten entstehen.

Source Code

Zum Video

★☆★ Wenn ihr den Kanal unterstützen wollt über ★☆★

oder über

Twint Spenden Code