Sending sensor data to cloud server using Arduino Uno and ESP8266

Greetings everyone. I have an Arduino Uno R3 module, ESP8266-01 WiFi chip, a DHT11(Temperature-Humidity sensor) and an HC-SR04(ultrasonic distance sensor). I also have a distant cloud server. I want to collect the sensor data and send them to my cloud server using ESP8266 periodically. Is it possible with my current hardware? Using Arduino IDE, I was able to see my sensor data on serial console using the basic codes that are in the sensor manuals. The problem is I can not get my ESP working. I have tried various codes, connections and combinations. I can not even work the basic AT OK command. What I'm trying is much more complicated than connecting my ESP to an access point and I'm not even sure if that's possible with my current hardware. Can you please guide me?

P.S.: Recently, I also bought a NodeMCU V3 CP2102 module and it will arrive by saturday.

Start by posting a schematic of your project. A photo of a hand drawn circuit is good enough, but please don't post a photo of the project itself as they are seldom of any use.

How are you testing the AT commands ?

Hope that's enough. Please let me know if you need further information.

It's a start but I was hoping for some pin numbers on the devices and an indication of how they were powered

Please also post your code but read this first and follow the advice to use code tags when posting code How to get the best out of this forum

I have taken DHT11 code from [here] (https://create.arduino.cc/projecthub/pibots555/how-to-connect-dht11-sensor-with-arduino-uno-f4d239) and HC-SR04 code from here. I just changed the pin numbers and was able to combine them together. Now I should get my ESP working.
This is how I'm using it at the moment:

3V3 pin of ESP -->3V3 pin of Arduino
RX pin of ESP-->RX pin of Arduino
EN pin of ESP-->3V3 pin of Arduino
TX pin of ESP-->TX pin of Arduino
GND pin of ESP-->GND pin of Arduino

I have tried many different combinations as well. In Arduino IDE, I'm trying to upload an empty sketch but I'm not even sure if I set my ESP to programming mode. Because I believe that's what I should do as soon as I'm done with this AT->OK command. In short, I really don't know anything about ESP.

Surely Tx on one device should go to Rx on the other and vice versa


I switched RX and TX. Now it's getting stuck here. It can not even upload an empty sketch.

You will likely need to disconnect your Uno to ESP serial wires when you need to upload code.

What do you mean by serial wires?

You have the ESP connected to pins 0 and 1
The serial upload of code uses pins 0 and 1
Disconnect the ESP during the upload


The upload was successful this time, however I still can't get the reply OK to AT command.

Please stop posting pictures of code and errors. Follow the advice on using code tags given in How to get the best out of this forum

let's start simple.
if you wire RX to RX and TX to TX then you connected the esp8266 to the Uno's USB chip
RX to TX (because the USB chip is already wired RX to TX). so now the ATmega MCU on Uno is just a bystander and you can communicate with the AT firmware on esp8266 from Serial Monitor. Set 115200 baud and "Both" line ends and enter AT.

I did exactly as you said but still no response to my AT command.

is something printed to Serial Monitor if you reset the esp8266?

No sir.

upload to Uno a sketch without Serial.begin

I got an error saying "Timed out waiting for packet header" .

don't upload to esp8266. it will replace the AT firmware

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.