This XBee project receives an analog sample over a radio link and prints a temperature estimate in Celsius and Fahrenheit. One recording shows the hardware and another shows the Serial Monitor, connecting the physical experiment to the bytes received by the sketch.
How the project works
At 9600 baud, the sketch waits for at least 21 serial bytes and looks for the 0x7E start delimiter. It discards the following 18 bytes, then combines two bytes as an analog sample. That fixed offset assumes one particular XBee API frame layout.
The saved conversion is (sample / 1024.0) × 125 × 1.02 − 50, followed by the Celsius-to-Fahrenheit conversion. The intermediate quantity printed as volts is only the normalized ADC fraction in this sketch. The supplied TMP35/TMP36/TMP37 datasheet helps distinguish the sensor’s transfer function from the radio’s ADC reference.
Hardware and configuration
| Item | In the supplied code |
|---|---|
| Serial interface | 9600 baud |
| Frame delimiter | 0x7E |
| Sample assembly | LSB + 256 × MSB |
| Reference document | TMP35 / TMP36 / TMP37 datasheet |
Working with the supplied code
Confirm the radio model, API mode, enabled analog channel and frame type before trusting the byte positions. A reusable receiver should parse the frame length and channel masks and validate the checksum instead of skipping a fixed number of bytes.
Compare a known temperature against the reported value before using the conversion elsewhere. The Screenium composition includes an internal movie as well as the finished screen-recording export; the finished demonstration is already available on the YouTube channel.
Video demonstrations
Source code and project files
Browse this project on GitHub. The files below are useful starting points for the sketches and references discussed in this post.
Download the used libraries (ZIP, 14.7 MB).
These notes describe the archived source and project media. The sketches have not been rebuilt or tested on hardware for this article.


