SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By 2slow4me
#196427
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 Serial.read() 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.
By n1ist
#196430
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.
/mike