# Connection between Arduino Mega 2560 , ESP8266-12F , PCF8574

Another start for achieving something new ,

I want to connect ESP8266-12F , Arduino Mega 2560 Board And the PCF8574 I/O Expander (I can use MCP23017 also) together , Where ESP8266-12F will take commands using http (or probably other possible protocols) from user and will turn on the relayes connected to Arduino Output Pins or PCF8574 pins. I have done basic practical tests on esp8266-12f (like Turning Lights On/Off ) but i want to expand it for more functionalities. Also don't want to control the esp8266 using AT commands.

Power source i can manage to build.

Please Guide me so that i can complete this long run.

P.S. - I am not from electronics background, so need long runway than usual to take off.

• How are you going to integrate the Mega in all this? As an I2C slave of the ESP8266 ? The MCP23017 is generally preferable to the PCF8574 because the 8574 is low side only, but in any case, these expanders are easy to interface using existing libraries. If you have not already got so far, then a good place to start is with the web browser interface to your ESP8266 over a WLAN. – 6v6gt Feb 23 '17 at 9:48
• to me, the mega just complicates if you have enough IO from the ESP+expanders. you can hack together an http API from the wifi server examples, using server.arg("paramName") to write relay values... – dandavis Feb 23 '17 at 15:22
• i have completed the esp8266 over a WLAN . but i have no idea how to connect these three things. MCP23017 and PCF8574 gives me GPIO digital pins not analog. hence using Mega. where can i get to learn these things. – KarmaCoding Feb 23 '17 at 20:21