---
title: "Arduino Mega + Ethernet Shield integration with HA via MQTT"
url: "https://maker.wiznet.io/taylor/projects/arduino-mega-ethernet-shield-integration-with-ha-via-mqtt/"
markdown_url: "https://maker.wiznet.io/taylor/projects/arduino-mega-ethernet-shield-integration-with-ha-via-mqtt/md"
type: "UCC: User Created Content"
author: "Iron"
author_url: "https://ai-speaker.discourse.group/t/integracja-arduino-mega-ethernet-shield-z-ha-przez-mqtt/212/158"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Iron"
original_url: "https://ai-speaker.discourse.group/t/integracja-arduino-mega-ethernet-shield-z-ha-przez-mqtt/212/158"
published: "2022-08-31"
language: "en"
tags: ["Home Automation", "Sensors"]
hardware: ["Arduino Mega 2560", "Arduino Ethernet Shield"]
likes: 3
views: 10931
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Arduino Mega + Ethernet Shield integration with HA via MQTT

> Arduino Mega + Ethernet Shield integration with HA via MQTT.

Original author: Iron (source: https://ai-speaker.discourse.group/t/integracja-arduino-mega-ethernet-shield-z-ha-przez-mqtt/212/158)

## Components

- **Arduino Mega 2560** x 1 ([docs](https://www.farnell.com/datasheets/1674878.pdf?_ga=2.12759806.871556650.1519619484-654667508.1508905608&_gac=1.209399078.1518779130.EAIaIQobChMI97my66Sq2QIV77ftCh01kgA_EAMYASAAEgKPyvD_BwE))
- **Arduino Ethernet Shield** x 1: W5100 ([docs](https://docs.arduino.cc/retired/shields/arduino-ethernet-shield-without-poe-module))
- Software: **Arduino IDE** ([docs](https://www.arduino.cc/en/software))
- Software: **AI Speaker**

## Documents and links

- [Arduino-to-Home-Assistant-MQTT-multisensor](https://github.com/ironek69/Arduino-to-Home-Assistant-MQTT-multisensor) (code)

## Article

Original :

<https://ai-speaker.discourse.group/t/integracja-arduino-mega-ethernet-shield-z-ha-przez-mqtt/212>

<https://github.com/ironek69/Arduino-to-Home-Assistant-MQTT-multisensor>

What a multisensor can do:

- Room temperature reading; ( [BME 280 sensor: temperature, humidity, pressure, altitude 2](https://allegro.pl/oferta/bme280-czujnik-temperatury-wilgotnosci-cisnienia-7954651090?utm_feed=aa34192d-eee2-4419-9a9a-de66b9dfae24&utm_source=google&utm_medium=cpc&utm_campaign=_DIO_pla_dom_wyposazenie_besty-top&ev_adgr=Wyposa%C5%BCenie+Top+oferty&gclid=EAIaIQobChMI3-7Yhqau6AIVxYeyCh1B6AIpEAQYAiABEgJY9_D_BwE))

- Indoor Humidity Reading;

- Room pressure reading;

- Reading the light intensity in the room; ( [Analog sensor) 2](https://botland.com.pl/pl/czujniki-swiatla-i-koloru/11885-fotorezystor-analogowy-iduino-se012-5903351241151.html?search_query=czujnik+swiatla&results=74)

- Displaying the above parameters on the display; [(OLED Display 0.91) 3](http://propix.com.pl/pl/p/LCD-OLED-0.91-128x32-I2C-White/1701)

- Flame / fire sensor and reporting to HA; ( [https://botland.com.pl/pl/czujniki-temperatury/4461-czujnik-awodieni-760-1100nm-analogowy.html 9](https://botland.com.pl/pl/czujniki-temperatury/4461-czujnik-plomieni-760-1100nm-analogowy.html))

- When flames are detected, lighting, diode and [buzzer](http://propix.com.pl/pl/p/Buzzer-z-generatorem-5V-12-mm/655) are turned on ;

- Room lighting - 433MHz remote control;

- Control of communication with the control panel on the Arduino Mega - in the absence of communication, the red LED flashes;

- Room temperature and [lighting](https://pl.gearbest.com/led-flashlights/pp_453059.html) control with [a 433MHz remote control](https://allegro.pl/oferta/pilot-samokopiujacy-uniwersalny-bramy-alarmu-mhz-8859942470?utm_feed=aa34192d-eee2-4419-9a9a-de66b9dfae24&utm_source=google&utm_medium=cpc&utm_campaign=_ELKTRK_PLA_RTV+i+AGD+_top_&ev_adgr=Piloty&gclid=EAIaIQobChMInKrzw6mu6AIVyawYCh01AglvEAQYByABEgLQ9PD_BwE)

- Turning off the fire alarm / [red led](https://botland.com.pl/pl/diody-led/3314-dioda-led-5mm-czerwona-migajaca-10szt.html?search_query=led+migajaca&results=6) + [buzzer](http://propix.com.pl/pl/p/Buzzer-z-generatorem-5V-12-mm/655) by means of [a 433MHz remote control](https://allegro.pl/oferta/pilot-samokopiujacy-uniwersalny-bramy-alarmu-mhz-8859942470?utm_feed=aa34192d-eee2-4419-9a9a-de66b9dfae24&utm_source=google&utm_medium=cpc&utm_campaign=_ELKTRK_PLA_RTV+i+AGD+_top_&ev_adgr=Piloty&gclid=EAIaIQobChMInKrzw6mu6AIVyawYCh01AglvEAQYByABEgLQ9PD_BwE)

- Receiving RF codes 433; ( [RF receiver 433 MHz 1](https://abc-rc.pl/product-pol-6140-Modul-radiowy-RF-433MHz-Arduino-nadajnik-i-odbiornik-Arduino.html))

- [Communication with Arduino Mega 2560 via RS 485. 9](https://botland.com.pl/pl/czujniki-temperatury/4461-czujnik-plomieni-760-1100nm-analogowy.html)

- In addition to Arduino nano, I used [Grove - Base Shield for Arduino Nano 1](https://botland.com.pl/pl/arduino-shield-ekspandery-wyprowadzen/14994-grove-base-shield-dla-arduino-nano.html)and [wires with connectors for Grove that I cut in half and soldered to the sensors 2](https://botland.com.pl/pl/grove-przewody-polaczeniowe/4400-grove-zestaw-5-przewodow-zensko-zenskich-4-pin-2mm-20cm-z-zatrzaskiem.html?results=1120&search_query=przewod)

- [I stuffed everything into the housing.](https://allegro.pl/oferta/obudowa-wodoodporna-hermetyczna-ip66-sonoff-th-r2-9060977315?utm_feed=aa34192d-eee2-4419-9a9a-de66b9dfae24&utm_source=google&utm_medium=cpc&utm_campaign=_DIO_pla_dom_wyposazenie&ev_adgr=Inteligentny+dom&gclid=EAIaIQobChMI1tjhv66u6AIVzKSaCh0qhQArEAYYAiABEgK6APD_BwE)

(Links to individual modules used in the project after hovering the mouse over)

A video of how the flame detection and LED lighting control works:

[Embedded media](https://www.youtube.com/embed/Lqxv7Xg-VnI)

---

Source: https://maker.wiznet.io/taylor/projects/arduino-mega-ethernet-shield-integration-with-ha-via-mqtt/
