Hello guys. I would like some advice from those who have some experience in ESP and Xbee field.
I am working on a home automation project as such:
https://electrosome.com/home-automation-arduino-esp8266/
I have a few questions:
1. Is it possible to add Xbee S2 to the project below?
The reason why I would like to add an Xbee is to get rid of the wiring from digital pins of the Arduino to devices. My idea was to have an ESP connected to arduino as such, which would allow me to trigger arduino digital pins with a mobile phone app ( such as blynk). Arduino would connect to coordinator Xbee which would be reading the same pin that ESP have triggered. When Xbee receives a signal that the digital pin of arduino has been triggered, the signal would then be sent to a router Xbee device which would turn ON/OFF the device.
So first of all, is it possible to have a digital pin to act both as an input and output? Because the same digital pin would act as an output to ESP but input to Xbee?
Secondly, I would need 3 RX and 3TX pins: 1 for programming the arduino, second one for communication with Xbee, and third one for communication with ESP. Arduino UNO does not have that many pins so I would assume that I would have to use Arduino mega.
Also, I was just curious, whether it would be possible to use Nodemcu development board such as:
Maybe I would be able to use this board which has built in ESP8266 module together with Xbee instead? I would save a lot of component save and I would not need an arduino at all!
Any advice is appreciated! Thank you