I am new here and this my question regarding my graduation project. I want to control the Arduino board from ESP32.

For example, a temperature sensor will be connected to the ESP32, when ESP32 read a certain temperature then will send information to the Arduino board. The Arduino board - connected to relay to switch the fan - will understand that is hot and turn the relay.

  • This should be asked on SE.Arduino, not here. I have flagged it for migration. Do not cross-post. If it doesn't end up being migrated, then delete this post and ask on SE.Arduino - although if you do that, then the answer provided below will be lost. Commented May 12, 2019 at 13:14
  • sorry I am new to this website. what is SE.Arduino? Commented May 12, 2019 at 13:22
  • arduino.stackexchange.com Commented May 12, 2019 at 13:23
  • Or, iot.stackexchange.com
    – Mawg
    Commented Sep 7, 2019 at 14:51

1 Answer 1


From what you have asked, It looks quite straightforward to me so I am assuming that you are new to controllers. Apologies otherwise. What you need to do is:

  1. Serially connect both devices (I2C/SPI).
  2. Program ESP32 to send a command/message serially to Arduino to switch on/off the fan relay based on your temperature thresholds.
  3. Program the Arduino to switch the fan relay on/off according to the received message.
  • Thank you for your explanation. Yes, I am new to controllers. I Did step 2 and 3. the only problem is with part 1, I searched for I2C connection and I did but there was a problem I do not know why. I did the setup like in this page create.arduino.cc/projecthub/jeffpar0721/… instead of ESP8266 I just used my ESP32. Commented May 12, 2019 at 12:26
  • In the link you provided, I don't see anything about I2C connection. Please see this link: (howtomechatronics.com/tutorials/arduino/…) and this link: (robot-electronics.co.uk/i2c-tutorial). Note that it may look complicated but it is rather simple.
    – Ahmed
    Commented May 13, 2019 at 7:18
  • What you need to make I2C connection setup is: Two I2C devices(You have them already), two Jumper cables for Connection and maybe two pullup Resistors. (See if I2C pins on Arduino and/or ESp controller are internally puled up. If yes, you don't need pullup resistors). Rest is just a sequence of commands that you can easily write for both controllers.
    – Ahmed
    Commented May 13, 2019 at 7:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.