I would like to create a home automation project running on a Raspberry Pi (with HomeAssistant) and implementing MQTT.
For my project I need opening detectors (Hall effect sensors), brightness detectors, temperature sensors, a power failure sensor and possibly cameras (although they can either be completely independent or managed by the Raspberry).
Given the number of sensors and the constraints of the building, I was thinking of using one or two Arduino Uno boards per floor (5 floors), as I want a hard-wired installation.
I'm a real beginner in hardware management and I'm discovering with the assemblies that I manage to make as I go along. On the other hand, I have no problems with the software.
Do you think the use of Arduino boards is relevant?
Is it better to use Uno boards, or would others be more appropriate (Nano or Mega, for example)?
How do you ensure the power supply to the various boards (the board that will manage power failure detection will obviously be on an inverter)?
Last but not least, how do you physically connect the cards so that they can communicate with the MQTT broker? RJ45 is all very well, but shields are very expensive. I've heard of 1-wire, which could be pretty good, but there are surely other systems out there ...
Boards with an ESP8266 or ESP32 (Wifi based) might be cheaper. I would just implement Webservers on each board and let Home Assistant connect to the boards with the RESTful integration or command_line
if you are looking at Ethernet there is the ethernet-shield-fur-arduino-nano cost about £10 in UK plus nano about £5
the ESP32 is about £6 in UK on EBAY
to connect to the Raspberry pi the simplest way is to plug the microcontroller USB cable into a RPi USB socket
it creates a virtual serial port, e.g. dev/ttyUSB0, which can be accessed from application programs
otherwise if using a WiFi enabled microcontroller such as ESP32 connect via WiFi using TCP or UDP
I agree with the recomendation of ESP32.
But since you already talk about MQTT I would definitly directly let the ESP connect to the broker. MQTT with ESP32 is quite simple and stait foreward.
Question of power supply potentially solved and optional
battery buffered operation already included:
"- Li-Po battery gets automatically charged with about 100mA when external power supply is present.
When the LiPo battery is attached and external power supply is missing internal DCDC step-up converter
and switching circuit automatically powers ESP32-POE from the battery. 1400mAh battery will provide
about 8 hours of stand alone operation"
have a look at the wt32-eth01 module which has ESP32 and Ethernet on board giving you a choice of wired and WiFi solutions on a single PCB
note the board does not have a USB onboard programmer - see Programming section in above link, e.g. using EBAY enter ESP32 programmer typical cost about £7 in UK, e.g.