The Official ESP32 Book
CHAPTER 11 • SEND TEMPERATURE AND HUMIDITY TO A MOBILE PHONE 11.1 Overview In the last Chapter we have seen the design and development of an interesting Wi-Fi application which controls two LEDs from an Android mobile phone. In this Chapter we will be developing another interesting application. Here, we will read the ambient temperature and humidity and then send this data to a mobile phone whenever a request is made. In this program data is exchanged using UDP packets. The data will be sent in the following format where T and H are the temperature and humidity readings:
T = nn H = nn
A request for data is made by the mobile phone when it sends the character S to the ESP32 DevKitC. This project uses two way UDP communications to receive and send data. 11.2 The Block Diagram The block diagram of the project is shown in Figure 11.1. Figure 5.12 shows the circuit diagram of the project where the DHT11 output (pin S) is connected to GPIO port 23 of the ESP32 DevKitC.
Figure 11.1 Block diagram of the system 11.3 Mobile Phone Application In this project an Android based mobile phone is used to receive the UDP packers from the ESP32 DevKitC. As in the project in Chapter 9, Android apps UDP RECEIVE and SEND by Wezzi Studios (version 4.0) is used in this project.
â—? 254
ESP32 UK 170828.indd 254
26-09-17 15:28