1 Introduction

Wireless communication is the transmission of information or data between devices using electromagnetic waves, rather than physical wires. Wi-Fi operates at the physical and link layers, serving as an interface for wireless communication. Within the wireless communication framework, UDP/Internet Protocol (IP) plays a crucial role as one of the layers associated with the physical and data link layers. UDP is a transport layer protocol that enables the exchange of datagrams between devices over an IP network. UDP is often utilized in scenarios where real-time data transmission is critical, such as video streaming, voice over IP (VoIP), and online gaming. In response to the growing demand for grid technology and high-performance computing, novel UDP-based protocols have emerged to cater to the requirements of high bandwidth and large delay networks in recent years [1]. These UDP-based protocols use a hybrid approach that combines the reliability of Transmission Control Protocol (TCP) with the speed of UDP. This approach has several advantages, including improved reliability, reduced overhead, and increased bandwidth utilization [2]. This protocol operates in a connectionless manner, allowing data to be transmitted without the need to establish a prior connection between the transmitter and receiver. Data packets, known as datagrams, are instead transferred from the sender to the recipient without any assurance of delivery or order according to the “fire-and-forget” approach. UDP operates without establishing an end-to-end connection with the remote UDP module. Instead, it transmits datagrams directly into the network and accepts incoming datagrams from the network without requiring any prior connection setup [3]. It reduces transmission delay by avoiding away with the requirement for connection establishment, recognition, and repetition procedures [25] discussed the benefits of using UDP in IoT applications, highlighting its low overhead, low latency, and suitability for real-time data transmission. Their work emphasized the advantages of UDP in scenarios where occasional data loss is acceptable, making it a suitable choice for applications with time-sensitive data such as temperature monitoring and sensor data transmission. Bourdeau et al. [26] presented a wireless sensor network-based thermal imaging system for building energy management. Their study focused on utilizing thermal sensors and wireless communication to monitor and analyze thermal patterns in buildings. Adu-Kankam et al. [27] proposed a framework for integrating displays into IoT environments. Their research highlighted the importance of visualizing data in real-time to facilitate decision-making. Tahir et al. [28] explored the applications of ESP8266 microcontrollers in IoT-based systems. Their work discussed the capabilities and advantages of ESP8266 in terms of low power consumption, Wi-Fi connectivity, and compatibility with various sensors. While their study did not specifically focus on thermal imaging or UDP protocol, it provided valuable insights into the use of ESP8266 in IoT contexts. Gayathri [29] proposed a real-time thermal imaging system using ESP8266 for industrial applications. Their work demonstrated the integration of ESP8266 microcontrollers with thermal sensors and the UDP protocol. Tran et al. [30] presented a wireless thermal imaging system for smart agriculture using ESP8266 and the UDP protocol. The research aimed to monitor and analyze temperature distribution in agricultural fields. This work emphasized the application of ESP8266-to-ESP8266 thermal data transfer and display integration in the context of smart agriculture. The research literature demonstrated innovations in thermal data transfer between ESP8266 devices using the UDP protocol. The studies illustrated that many sectors, such as industrial monitoring, indoor temperature monitoring, smart agriculture, and remote temperature monitoring, achieved successful implementation. The results of this research aid in the comprehension and real-world application of ESP8266-based temperature monitoring systems and offer insightful information for additional research and expansion in this area.

3 Materials and methods with models

A method for implementing a thermal imaging system using an ESP8266 microcontroller system is designed to measure thermal pixel values and transmit the pixel data to another ESP8266 module. The receiving ESP8266 module processes the received pixel data and displays it on a TFT display in real time.

3.1 Materials

The following are the primary materials we used to do the research and create the system:

  • Two ESP8266 development boards as central units of transmitting and receiving devices.

  • AMG8833 thermal camera for image capturing of diverse objects.

  • TFT display for image visualization.

  • 5 V DC power supply units to provide power to the transmitting and receiving modules.

  • Connecting wires for interconnection among the devices of transmitting and receiving modules.

  • Arduino Integrated Development Environment (IDE) for embedded programming.

  • Arduino serial monitor for data visualization.

3.2 Block diagram

The block diagram of the system is presented in Fig. 1. The proposed system consists of two main components: the thermal camera and the display module but the Microcontrollers are the heart of the proposed system. The thermal camera module incorporates a thermal sensor, such as the AMG8833, to capture the temperature distribution and convert it into thermal pixel data, and two power supply units are used to activate these devices.

Fig. 1
figure 1

Block diagram of the system

The thermal camera, which has a 64-pixel (8 × 8 matrix) resolution, is connected to the Microcontroller-1 (ESP8266) using the I2C bus. The I2C bus is a synchronous serial communication protocol that is commonly used to connect peripherals to microcontrollers. In this case, the I2C bus will be used to transfer the thermal pixel data from the camera to the ESP8266. The ESP8266 is responsible for reading the pixel data from the thermal sensor and establishing a wireless connection with another ESP8266 module. Once the thermal pixel data is acquired by the ESP8266, it is encapsulated into UDP packets for efficient transmission. The Microcontroller-1(ESP8266) module acts as a UDP client that connects to the Microcontroller-2(ESP8266) module, which acts as a UDP server. The client module sends the pixel data packets over the wireless network using the UDP protocol. The server module receives the packets and reconstructs the pixel data for further processing. The server module processes the received pixel data and uses the SPI protocol to interface with a TFT display that has a resolution of 240 × 320 dots (RGB) to visualize the thermal image.

The interpolation method implemented in the code was bicubic interpolation, which was used to upscale data from an 8 × 8 pixel grid obtained from the AMG8833 thermal camera to a higher-resolution 24 × 32 pixel grid for display on the Adafruit_ILI9341 TFT screen (240 × 320 pixels). Bicubic interpolation involved several steps: first, it calculated scaling factors (mu_x and mu_y) based on the source and destination grid dimensions. Then, it iterated through the destination grid, determined the corresponding coordinates in the source grid, and retrieved a 4 × 4 matrix of adjacent data points using get_adjacents_2d. Next, it calculated fractional coordinates within this 4 × 4 matrix (frac_x and frac_y) to estimate the value at the desired position. This was done by applying cubic interpolation both horizontally and vertically using cubic-Interpolate and bicubic-Interpolate, resulting in the final interpolated value. This process was repeated for each pixel in the destination grid, effectively enhancing the thermal image’s resolution for a smoother and more detailed display on the TFT screen.

After the pixel data has been successfully interpolated, it is further translated into corresponding color intensities or temperature values. These values are then mapped onto the individual pixels of the TFT display. The display module, which is connected to the ESP8266 server, performs real-time updates to the TFT display. This ensures that the thermal image is continuously refreshed, providing immediate and dynamic visual feedback to the viewer.

3.3 System flowchart

The flowchart illustrates the process of capturing thermal images using thermal camera module, transmitting the pixel data to the ESP8266 microcontroller, and visualizing it on a TFT display.

The UDP Protocol’s main attributes are discussed by the flowchart in Fig. 2. The protocol begins by addressing the data to be sent. Then, the sender binds the socket to a specific port. After that, the data is packaged and prepared for transmission. The sender encapsulates the data into a UDP datagram, including source and destination port numbers, and sends it to the intended receiver’s IP address. UDP is a connectionless protocol, which means that there is no guarantee that the data will be delivered successfully. Consequently, when a UDP packet is re-sent, the data is not re-packed. If the data does not get delivered, the sender will simply keep trying to send it until it succeeds or until it gives up. The receiver continuously extracts and processes the data from the sender UDP datagrams that has received. To avoid endless loops, the sender implements a timeout mechanism, which stops sending after a certain period without acknowledgment. The timeout value is carefully chosen to balance delivery chances and endless loop prevention. The sender can also implement an exponential back off algorithm to reduce the chances of getting stuck in an endless loop. This means that the sender will not wait for a longer and longer period between attempts to send the packet if the previous attempt failed. This helps to reduce the chances of the sender getting stuck in an endless loop.

Fig. 2
figure 2

Flowchart of UDP protocol

The flowchart in Fig. 3 explains the main functionality of the client program in the ESP8266 microcontroller. The program first connects to a Wi-Fi network. The application reads the object temperature from a thermal camera as pixel data after the connection has been established. The pixel data is then converted into packet data, which is a series of bytes that can be easily transmitted over a network. The packet data is then sent to another microcontroller using UDP protocol over Wi-Fi.

Fig. 3
figure 3

Client flowchart of the system

The flowchart depicted in Fig. 4 provides a comprehensive overview of the primary operations executed by the Server program on another ESP8266 microcontroller. The program initiates by creating a Wi-Fi network and establishing a connection with the client microcontroller. Whenever the connection is established effectively, the program proceeds to receive packet data transmitted by the client microcontroller. The received packet data is then processed and converted back into pixel data, which corresponds to temperature information. Subsequently, the pixel data undergoes further processing and manipulation to generate a visual representation known as Thermal Imaging.

Fig. 4
figure 4

Server flowchart of the system

3.4 Software design

The ESP8266 board is programmed in embedded C++ to interface sensors and modules. The Arduino IDE is free and open-source platform that can be used to write and debug the program. After being uploaded the program, the microcontroller automatically collects thermal values from the thermal camera at regular intervals. The microcontroller then sends the thermal values to another microcontroller and displays the thermal values as numerical values in the form of thermal imaging on the display.

3.5 Hardware implementation

Figure 5 indicates the interconnection of all the devices in the project. The block diagram shows that all of the system’s devices are connected and that they are all powered by a 12 V-2 A battery. Figure 5a shows a transmitting device as a client using a thermal camera to capture thermal images of an object. The camera converts the infrared radiation emitted by the scene into an electrical signal, which is then digitized and sent to the server. Conversely, Fig. 5b represents a receiving device as a server that receives and decodes the signals and also creates a thermal image of the scene.

Fig. 5
figure 5

Hardware implementation setup: a transmitting device, b receiving device

4 Result and discussion

In this section, we will first provide a latency bar chart for TCP and UDP. Then we show how to establish a connection between a server and a client, as well as how to send and receive data between them. Finally, we demonstrate how to identify cold and hot objects in front of a thermal camera.

Figure 6 illustrates the latency results for TCP and UDP. The TCP protocol exhibits a pixel data transmission time from the client to the server within the range of 2.358 to 2.513 s. In contrast, the UDP protocol achieves a significantly faster pixel data show time, taking only 0.598 to 0.922 s.

Fig. 6
figure 6

Latency for TCP and UDP

Figure 7, 8 and 9 demonstrate the serial monitor of the client, whereas Fig. 7 shows the communication link between a server and a client, showcasing the vital connection that enables data exchange between the two entities. The establishment of this connection is achieved within a range of 15 to 18 m, and the entire process typically takes around 30 s. However, if the distance between the server and client is more than 18.28 m, distortion occurs, that can lead to data transfer issues. The aforementioned UDP ports are specifically utilized for facilitating the transfer of the packets. Figure 8 illustrates the collection of thermal pixel data presented in degrees Celsius. The acquired data is then processed to get three distinct value sets: maximum, average and minimum and these processed values are expressed using Fahrenheit scale and four UDP packets are generated to send those pixel value, maximum value, average value and minimum value to the server through Wi-Fi which are conveyed in Fig. 9. Each packet is sent to a different port, which allows for the efficient transfer of data between the client and the server.

Fig. 7
figure 7

Client and server connection

Fig. 8
figure 8

Client pixel data

Fig. 9
figure 9

Client thermal data and packets

The server’s serial monitors are pictured in Figs. 1011 and 12 whereas Fig. 10 displays that using UDP in conjunction with four different ports offers a dependable and effective method of transferring data between the client and the server. According to Fig. 11, the client can transmit the related data (pixel value, maximum value, average value, and minimum value) to the server in 2.129–2.427 s. Figure 12 shows that data interpolation from the server to the display adds 114 − 116 milliseconds to the data conversion time from digital to visual format. The interpolation technique smooths the data and makes it appear more continuous.

Fig. 10
figure 10

Listening UDP port on server

Fig. 11
figure 11

Server pixel data

Fig. 12
figure 12

Server thermal data

The measurement of a cold object’s temperature is appeared in Fig. 13. The cold object is depicted in Fig. 13a, whereas in Fig. 13b, it appears as a blue area within the image. This is because the object is emitting less infrared radiation than the surrounding objects. The temperature of the object is displayed as 37.85 °F, which is a relatively cold temperature.

Fig. 13
figure 13

Measuring temperature: a cold object in front of thermal camera, b Detected cold object and displayed

Figure 14 expresses the measuring of a hot object’s temperature. Figure 14a reveals the hot object, and Fig. 14b reflects the hot object as a red region within the image. The object emits a higher level of infrared radiation compared to the surrounding objects, resulting in its distinctive coloration. The temperature of the object is displayed as 183.20 °F, indicating a relatively high temperature.

Fig. 14
figure 14

Measuring temperature a hot object in front of thermal camera, b detected hot object and displayed

Figure 15 represents the measurement of fingers temperature. In Fig. 15a, the fingers are visible, while Fig. 15b exposes a distinct blue region within the finger image. This blue hue signifies that the fingers were emitted less infrared radiation than their surrounding objects. The displayed temperature of the fingers was recorded at 24.00 °C, indicating a relatively low temperature.

Fig. 15
figure 15

Measuring temperature a fingers in front of thermal camera, b thermal imaging of fingers

5 Conclusion

In this study we developed a wireless client-server architecture to facilitate exchange of thermal pixel data. The server and client devices use UDP to transmit thermal pixel data with lower latency than TCP, which takes 0.598 to 0.922 s. The time discrepancy between the clients’ and servers’ all data (pixel value, maximum value, average value, and minimum value) is 2.129–2.427 s and a communication range of between 15 and 18 m. The data were processed to derive the maximum, average, and minimum temperatures, which were then converted to Fahrenheit and transmitted using a UDP packet over Wi-Fi connectivity. The server decoded and displayed the received values, enabling further analysis and processing. The system was successfully used to detect cold (37.85 °F) and hot (183.20 °F) objects in thermal images and also showed a thermal image of fingers with a recorded temperature of 24.00 °C. The color-coded representation accurately identified regions emitting lower or higher levels of infrared radiation compared to their surroundings. The corresponding temperature values provided valuable insights into the relative temperatures of the detected objects. The results of this study demonstrate the potential of the proposed system for real-time analysis and identification of temperature variations in thermal images. For instance, the system can detect hot spots in electrical equipment, monitor patient body temperature, and map heat distribution in buildings. Future research could focus on enhancing the system using machine learning algorithms for better temperature detection accuracy and exploring different data transmission protocols to improve performance in various environments. Overall, this study demonstrates the system’s potential for real-time analysis and temperature variation identification in thermal images, contributing significantly to the field of thermal imaging technology.