# Sending sensor data to cloud server using Arduino Uno and ESP8266

**URL:** <https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030>\
**Category:** General Guidance\
**Created:** [June 18, 2021, 2:51pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030 "2021-06-18T14:51:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 2:51pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/1 "2021-06-18T14:51:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 18, 2021, 2:55pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/2 "2021-06-18T14:55:00Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 3:12pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/3 "2021-06-18T15:12:19Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/8/c/4/8c4411f24e8ce7ed39fd4735fac026752f51f18a.png)

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

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 18, 2021, 3:24pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/4 "2021-06-18T15:24:06Z")

</div>

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](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code)

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 3:38pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/5 "2021-06-18T15:38:07Z")

</div>

I have taken DHT11 code from [here] ([https://create.arduino.cc/projecthub/pibots555/how-to-connect-dht11-sensor-with-arduino-uno-f4d239](https://create.arduino.cc/projecthub/pibots555/how-to-connect-dht11-sensor-with-arduino-uno-f4d239)) and HC-SR04 code from [here](https://create.arduino.cc/projecthub/abdularbi17/ultrasonic-sensor-hc-sr04-with-arduino-tutorial-327ff6). 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.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 18, 2021, 3:40pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/6 "2021-06-18T15:40:54Z")

</div>

> [@crimsonday](#):
>
> RX pin of ESP--\>RX pin of Arduino  
> TX pin of ESP--\>TX pin of Arduino

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

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 3:55pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/7 "2021-06-18T15:55:48Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/e/b/a/eba3400e80caba523f2fd386806b561573cfd370.png)  
I switched RX and TX. Now it's getting stuck here. It can not even upload an empty sketch.

---

<div class="post-metadata">

**Author:** ![wildbill](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wildbill/32/1126438_2.png) [@wildbill](https://forum.arduino.cc/u/wildbill)\
**Post date:** [June 18, 2021, 4:00pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/8 "2021-06-18T16:00:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 4:02pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/9 "2021-06-18T16:02:07Z")

</div>

What do you mean by serial wires?

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 18, 2021, 4:04pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/10 "2021-06-18T16:04:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 4:09pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/11 "2021-06-18T16:09:32Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/1/a/a/1aa29de2259c1aeb38c6091d60f6d6910ad5560a.png)  
The upload was successful this time, however I still can't get the reply OK to AT command.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 18, 2021, 4:11pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/12 "2021-06-18T16:11:32Z")

</div>

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](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code)

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [June 18, 2021, 4:17pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/13 "2021-06-18T16:17:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 4:24pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/14 "2021-06-18T16:24:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [June 18, 2021, 6:08pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/15 "2021-06-18T18:08:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 6:25pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/16 "2021-06-18T18:25:57Z")

</div>

No sir.

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [June 18, 2021, 6:57pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/17 "2021-06-18T18:57:39Z")

</div>

upload to Uno a sketch without Serial.begin

---

<div class="post-metadata">

**Author:** ![crimsonday](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@crimsonday](https://forum.arduino.cc/u/crimsonday)\
**Post date:** [June 18, 2021, 7:14pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/18 "2021-06-18T19:14:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [June 18, 2021, 7:25pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/19 "2021-06-18T19:25:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 16, 2021, 7:26pm UTC](https://forum.arduino.cc/t/sending-sensor-data-to-cloud-server-using-arduino-uno-and-esp8266/876030/20 "2021-10-16T19:26:03Z")

</div>

Closed on October 16, 2021, 7:26pm UTC

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