RX pin of ESP8266

Hi, a very noob question but bare with me I am really new to this. I am connecting my Xbee transceiver directly to my ESP8266 module. This Xbee will be sending analog values to my ESP8266 through RX pin. I just want to know if: 1) RX pin can read these analog values or the values can be converted to digital or no need? 2) How will the ESP 8266 be able to read any new arrived data by Xbee? Can I use serial.read? Note that I will be displaying these values on my web page (HTML).

The Rx pin, or more strictly the Serial interface, can only read bytes. How you interpret them is up to your program. Is the data being sent in binary, ie you receive the actual value in a byte (unlikely) or as ASCII characters (more likely) ?

Well, I am receiving analog values from my sensors, then RX pin will not be able to read them, right? Then what should I do to be able to view these data? Do I convert them to digital values? and then? Thank you so much in advance.

Take a look at Serial.parseInt()

parseInt()

I really doubt that a Xbee transceiver sends analog values.

please post a more detailed description how everything is connected.
an anlog-signal means if you measure voltage between sensor-output and ground you get different voltage-levels between 0,00V and 5V with any value inbetween

examples 0,1V, 0,1002V 0,765V, 0,766V, 3,40V, 3,41V. Really all values between 0,0V and 5V.

That’s an analog signal. I hghly doubt that your zigbee can handle this kind of signal.

What a zigbee sends on his output is a digital signal. The voltage jumps only between 0V and 5,0V maybe 0V and 3,3V
but no values inbetween.

An ESP8266 has an analog-input itself.
Please describe your whole project I guess there are at least two other ways to achive what you want to do in the end.

best regards Stefan

What a zigbee sends on his output is a digital signal. The voltage jumps only between 0V and 5,0V maybe 0V and 3,3V but no values inbetween.

Are you saying that a Zigbee cannot transmit a string representing an analogue value ?

Please provide links to the actual units that need to communicate. What ESP, and what Xbee, whatever that is.

StefanL38: please post a more detailed description how everything is connected. an anlog-signal means if you measure voltage between sensor-output and ground you get different voltage-levels between 0,00V and 5V with any value inbetween

examples 0,1V, 0,1002V 0,765V, 0,766V, 3,40V, 3,41V. Really all values between 0,0V and 5V.

That's an analog signal. I hghly doubt that your zigbee can handle this kind of signal.

What a zigbee sends on his output is a digital signal. The voltage jumps only between 0V and 5,0V maybe 0V and 3,3V but no values inbetween.

An ESP8266 has an analog-input itself. Please describe your whole project I guess there are at least two other ways to achive what you want to do in the end.

best regards Stefan

I will be having 2 Xbee S2C modules communicating. The first xbeeS2c will be connected to Arduino Uno and an analog temperature sensor (regardless of the exact connection in this part). This Xbee S2c will take the sensor readings (assuming that we have not used ADC in Arduino Uno) and will send it wirelessly to the other Xbee S2C that is un serial communication(Rx to Tx and Tx to Rx) with ESP8266-01. This ESP8266 must take this data through its RX and send it and display it on a web page. Again I just want you to know that I really have very little experience and I am a little new to this so tell me if, for example I used the ADC in Arduino Uno, will Xbee S2C be able to send the digital data? If yes, will ESP8266-01 be able to read this digital data from its RX pin? Or shall I change the connection between the Xbee S2C and ESP8266-01? Thank you so much for replying and thank you in advance

ill Xbee S2C be able to send the digital data? If yes, will ESP8266-01 be able to read this digital data from its RX pin?

Google says it can. both questions answered yes. Actually even though an ESP does have an ADC, on an ESP-01 the pin is not exposed, so communicating through it is not practical, if it was anyway. So yeah, if you manage to make the BAUD rates match you should manage just fine.

OK I looked up what xbee S2C are and found this link https://www.mouser.de/new/digi-international/digi-xbee-s2c-rf-modules/

a xbee S2C has analog IO-pins. This means a sensor with analog output could be connected to the xbee.

As you wrote that you have very little experience I would like to know what the whole project is. I guess that a much easier solution to all this can be found.

As you haven't written anything about the physical circumstances I make some assumptions about that:

Distance between Sensor (transmitter) and receiver (ESP8266) 20 m both transmitter and receiver can be powered by a wallplug permantly:

Solution: using three NodeMCU ESP32 modules. They can be programmend using the Arduino-IDE. So exact the same programming as with an Arduino.

To NodeMCU-ESP32-module 1 the sensor is connected to an analog input of the nodeMCU NodeMCU-ESP32-module 1 sends the sensor-data using the ESP-NOW-protocol to

NodeMCU-ESP32-module 2 which receives the sensor-data via the ESP-NOW-protocol and is connected to

NodeMCU-ESP32-module 3 which is connected to NodeMCU-ESP32-module 2 over a serial-connection Tx-Rx Rx-Tx

NodeMCU-ESP32-module 3 is connected to your WLAN to act as the webserver providing the website.

This NodeMCU-ESP32-module 3 is nescessary because ESP32 (and ESP8266) can't communicate to a WLAN and ESP-NOW-protocol at the same time. It could be done by restarting the module some time connected to the WLAN some time connected to the ESP-NOW. But it is easer to have a third one that is connected via serial-interface.

So this solution means only one type of device for all. programmend with the Arduino-IDE output-power of the ESP32 200mW bridging a distance of 20-30m inside buildings 80-100 m outside buildings.

Sensor--wired---ESP32------ESP-NOW----2,4GHz------ESP32-------wired-Serial-----ESP32-----WLAN

compared to

Sensor---wired-----XBee1-----RF 2,4GHz--------XBee2------ESP8266-01---WLAN

additional xBee1-----Arduino for what purpose is this parallel-connection of the XBee1??

connecting the Sensor to the xbee means you have to program the xbee to do the sensor-readings and send them via RF. How much effort does it take to make a xbee read on an analog input and to send it via RF? Does there exist an easy to use configuration-software for configuring the xbee or does it requiere a second IDE programming in which language?

With that low knowledge-level just grasping the first ideas that came to your mind is not a good strategy to design such a system

So if you could provide detailed information about the whole thing what kind of sensor how many sensor-readings per time-unit what distance to bridge by RF what kind of power-supply for both devices (battery or wallplug

integrating your devices into a ZIGbee mesh yes or no

a good suited solution can be suggested.

best regards Stefan

laab: Well, I am receiving analog values from my sensors...

What do you mean with analog values?

  • A variable voltage?
  • An ASCII number?
  • A byte?
  • An integer?