Sending data from Arduino to ESP8266

All things pertaining to wireless and RF links

Moderator: phalanx

Post Reply
Posts: 2
Joined: Fri Sep 29, 2017 9:39 am

Sending data from Arduino to ESP8266

Post by 2slow4me » Thu Oct 05, 2017 7:44 pm

Hey guys, got a quick question. Now, i want to do the following: my Arduino collects sensor measurements (float Temperature, float Pressure, float Humidity), and i want to send them over UART to ESP8266 and receive them so that i can send them on dweet. Now, you might ask yourself "Why don't you just connect the sensor to the ESP?". Well, i'm planning on hooking an 16x2 LCD on the Arduino so i can relay the data there as well. Now, i've tried several codes for both the Arduino and the ESP, and all i keep getting on the ESP is junk ( 8 digit temperature in Celsius for example).

I tried:

1) Serial.print(temperature) on Arduino with on ESP = junk
2) Serial.write(temperature) on Arduino with Serial. read() on ESP = junk
3) Serial.write(lowbyte) +Serial.write(highbyte) with Serial.Read = junk

I assume there's something i'm doing wrong or missing, so i would need some help. I hope someone can provide some quick and easy code samples for me to try since i noticed ESP8266 (i have ESP-01 with the 8 pin in 4x2 layout version) are very common and a lot of people use them. Thanks in advance guys.

Support Volunteer
Posts: 987
Joined: Wed Mar 22, 2006 11:02 am

Re: Sending data from Arduino to ESP8266

Post by n1ist » Fri Oct 06, 2017 4:43 am

Cut the problem in half. Start by connecting the Arduino's serial port to a PC instead (with an FTDI cable or similar) and using a terminal program. That will tell you if the right data is being sent to the ESP. Likewise, connect the ESP to the PC and try sending the data manually.

Make sure you are using the same baud rate for both ends of the serial communions.

Post Reply