1

I would like to know if this is possible.

I am using an ESP8266-ESP01, which only has 2 digital pins. I have a project that needs 3 digital pins so I have planned to use my Arduino, so I can use more digital pins. My plan is instead of plugging the sensor in the GPIO1 of the ESP8266, I could somehow plug it in the Arduino digital pins and the data would just be transferred to the ESP8266 and be uploaded to an online cloud.

I can read the sensor data in the Arduino but I don't know how to transfer the data to the ESP8266 so the wifi module would just receive it and send it to the online cloud.

If anyone can help me to get some idea specifically on sending the data from Arduino to the ESP and receiving the data from the Arduino.

Thank you.

3
  • 1
    There are numerous tutorials on how to use an Arduino with an ESP8266. What did you try and how it didn't work?
    – gre_gor
    Commented Sep 13, 2017 at 14:06
  • In order to attract the most useful answers it is best to lay out your solution, what you have tried (including code) and the pose a specific, clear question about where you got stuck, related to Arduino. Feel free to edit this question to include that and then we'll see what happens.
    – SDsolar
    Commented Sep 14, 2017 at 3:43
  • I did made a recent question with all what I did and codes and all but my question just got ignored so maybe if I make a simpler question people will answer. anyway this is what i have tried arduino.stackexchange.com/questions/44608/…
    – Duckbenok
    Commented Sep 14, 2017 at 8:56

3 Answers 3

4

DDA's answer is perfectly correct. Like he says you need to check the voltage and use a logic level shifter.

However looking at it from another angle there are a whole range of ESP that have an increasing number of digital pins. You could look at using an ESP-5, or an ESP-12E, these have different forms and increasing number of digital pins.

You could also look at the Wemos range, I believe there is an UNO form board and there is the Wemos D1-Mini, which has 10 digital and 1 analog.

Running on two boards is usually more of an issue than running on one board, god help you if you have synchronisation issues!

2

Use the ESP's two digital pins to talk to the Arduino using SoftwareSerial. Be careful however: your Arduino (possibly, probably) runs on 5V, the ESP on 3.3V. I have an Arduino clone that can be switched between 3.3V and 5V, which makes things easier.

After that all you need is to send the sensor readings to the ESP via SoftwareSerial.

0

I could somehow plug it in the Arduino digital pins and the data would just be transferred to the ESP8266

Easy:

  1. Program the Arduino as a master (I2C, or UART + interrupt) and the ESP as a slave. Connect the sensors to it. Once the data is read on the Arduino, it is sent to the ESP.

  2. Put an I2C IO expander IC on the ESP and you don't have to deal with the Arduino at all.

1
  • 1
    Using I2C is a good idea but on an ESP-01 because there are only two lines there is a possibility that an I2C device may put the ESP into "flash mode". If you are using an I2C device that write to the microprocessor then there is a higher chance of this happening. HOWEVER there is only a small chance of it happening, it will depend on you hardware and devices, etc (i.e. it probably won't happen, but...) Commented Sep 14, 2017 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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