# Non-Real-Time Wireless System for Lightning Effect Measurements
## 4 Prototype  
Taking into account all aspects of the above discussion, a measurement system based on an 8-bit microprocessor (AVR ATmega 1284) working with a system clock with a frequency of 16 MHz (20 MHz in the final version) was proposed. The maximum writing speed of the 2-byte data system itself is 2 MHz (measured), which is insufficient for the assumptions made. It was decided to use the system clock signal to directly trigger both A/D converters and external RAM. This solution allowed to perform sampling with a frequency of 16 MHz. The external integrated circuit type 4040, which is a 12-bit counter, is responsible for addressing the memory cells. Two 8-bit AD9280 converters were used for analog-to-digital conversion, separately for positive and negative signals in relation to the ground. This solution allowed to obtain a resolution of 16 bits, which in combination with 16 MSps ensures good signal mapping (16 samples per 1 \(\upmu\)s). For typical surges related to lightning with 6.4 us rise time, the system records 102 measurement samples, allowing the observation of the wavefront in detail. The presented parameters, compared to a traditional oscilloscope, are not impressive, however, it should be noted that the prototype measuring probe has the dimensions (including battery power for the entire day of testing) \(8\times 5\times 5\) cm (length/width/height). The dimensions include the housing and batteries, which are not shown in the photo. The close-up shows the integrated circuits and the control microprocessor. The prototype was made on a single-layer board. In the final device, these dimensions can be reduced by twice. Small dimensions and weight allow connecting the measuring probe in any (hard-to-reach) place, without the need to connect the measuring cables. Moreover, this avoids breakdown between different elements through which the partial lightning current flows. A comparison of five different lightning recording systems is presented in Table 1.  
In the developed prototype (Figure 3), the microprocessor is responsible for super-vising the ADC module and RAM work, by setting the direction of information flow on the data bus, and also sets the beginning of the addressing performed by the counter. It does not take part in sampling the signal and saving data to memory. This process, after switching on the \"record\" mode by the operator, continues cyclically, without interruption. The data is stored in a loop, which allows the signal to be recorded before the onset of the lightning current. The processor records the value of the analog signal at the input and compares it with the predetermined trigger threshold. It indicates when the impulse occurred. From this point on, the microprocessor controls the further sampling time and stops sampling when the memory buffer is full. This solution allows registering data both before and after the impulse. The range of both buffers is configurable before starting the measurements. Data are read from RAM and then transmitted via the radio system to the recorder (Figure 4). This is possible by scaling the system clock signal (full speed for writing, slow speed for reading). Adjusting the reading speed to the transmission allows reducing interference and no need to buffer data in the microprocessor memory.