The prototype of a wireless measurement card

This publication contains the description of the prototype of wireless measurement card that share measurement data via global Internet network. The created measurement card aims to improving the process of obtaining measurement results by enabling remote measurement and sharing results via the Internet. At the beginning of the article, discussed issues are generally presented, which solution is presented device. In the next sections presented the main functional assumptions, describe the most important components included in the prototype and present the algorithm of the main loop of the device program.


Introduction
The development of technology in recent times has made the wireless technologies become more and more important in industry and everyday life. They enable data transmission in systems whose components are far away from each other, are located in hard-to-reach places or move. In addition to the possibility of wireless communication of devices in the system, an important issue in the case of distributed systems is the possibility of remote, global access to data measured by these devices. Wide access to data is possible through the use of a global Internet network. Providing measurement data to an external server located on the Internet enables the end user to easily access this data. The requirement is access to the Internet.
The paper presents the proposed solution of a measuring card that uses wireless transmission to share measurement results via the Internet. The prototype includes nowadays expectations for measuring cards (e.g., speed data processing [1], resolution [2], remote measurement [3]).

Design assumptions
The main functional assumptions of the presented measurement card: -ability to measure AC (signal raised to positive values)/DC voltage simultaneously from all card inputs using the built-in ADC, -ability to generate voltage signals simultaneously on all card outputs using the built-in DAC, -possibility of wireless transmission of measurement data simultaneously from all card inputs in real time, -ability to send measurement data to a remote web server (necessary access to the Internet), -ability to communicate with a remote web server using the TCP/IP and http protocol.

Hardware
In order to meet the design assumptions of the device being implemented, an appropriate microcontroller was selected, which made it possible to measure signals with appropriate frequency and resolution. The presented prototype of the measurement card was built using the Core407Z development board, on which the STM32F407 [4] microcontroller is located. This microcontroller was selected for card implementation due to the availability of 12-bit ADC and DAC converters, relatively large RAM (1024 kB) and high clock speed (160 MHz). Thanks to the appropriate microcontroller's peripherals, it was possible to perform initial data processing and implement data buffers necessary for effective real-time data transmission. The main blocks of the presented measuring card were presented in a block diagram - Figure 1. Another important element of the system is the wireless transmission module. WiFi interface has been chosen as the wireless medium due to its relatively high data transfer rate and coverage with respect to other shortdistance standards. An important aspect of the WiFi interface is also the simultaneous possibility of wireless communication and access to the global Internet network (via LAN). To implement communication via WiFi, the ESP8266 module was used in the project. In addition, this module has a number of properties that were necessary to meet the functional assumptions, i.a. support for TCP/IP, http and WiFi standards -802.11 b/g/n. The last significant block of the presented measurement card is a set of low-pass RC filters and protection diodes. The function of the filters is to suppress frequencies above 500 Hz (limit frequency of the measured signal selected experimentally during tests).

Software
The microcontroller software was created using the C language and the HAL [6] library dedicated to STM32 microcontrollers. This is the most important part of the software on the presented measuring card. The main program loop algorithm is shown in Figure 2. The initialization of the main loop is preceded by calling the configuration functions of the microcontroller's peripherals circuits and the ESP module. The most important blocks of the presented algorithm are Prepare data and http request and Send data to server. The first block converts the measured values using the ADC converter to the character string. Prepared data in the JSON (JavaScript Object Notation) format is saved in the body of the http request, which is then sent to the remote server.
The presented measurement card can also receive data sent via a web server. To enable this, the measurement card sends every 500 ms request to the server for its settings. This enables remote control of the measuring card, including in the scope of switch on/switch off the control diode and turn on the generation of a given signal on the device outputs. The half-second time interval has been chosen so as not to overload the server with excessive requests.
The next programmable module used in the project is the WiFi module. It has been programmed using strictly defined AT commands [7]. The configuration functions of the ESP module have been implemented in the microcontroller code. An example of the ESP_Send_Command function that allows sending a string to the WiFi module is as follows: ESP_Send_Command("AT+CWAUTOCONN=0"); ESP_Send_Command("AT+CWMODE=1"); ESP_Send_Command("AT+CWDHCP=1,1"); ESP_Send_Command("AT+CWJAP=\"{ssid}\",\"{pass}\""); ESP_Send_Command("AT+CIPMODE=1"); The ESP_Send_Command function sends text data to the module via the UART interface. The argument of the function is the AT command written as a string. The most important of the AT instructions are: -AT+CWMODE=1: set module mode as a client, -AT+CWJAP=\"{ssid}\",\"{pass}\": attempt to connect to the local network, -AT+CIPMODE=1: define the mode of receiving data by the module.

Summary
The presented prototype of a wireless measuring card enables remote voltage measurement thanks to the use of wireless data transmission. Wireless transmission extends the possibility of card application, i.a. for measuring objects that move and are located in hard-toreach places. The WiFi module used in the project enables not only wireless communication, but also gives the possibility of connecting the card with the WLAN, thanks to which the device has the possibility to share measurement results in real time via the global Internet network. Measurement data sent to a remote server connected to the Internet is easily accessible to the enduser. The measurement card has been programmed in such a way that communication between the user and the device can take place bi-directionally. The user has not only access to measurements, but also has the ability to control the card and its configuration.