In this paper, the development and implementation of the clustering algorithm (CA) developed for an instrument to detect lightning phenomena (Lightning Imager) is presented. The aim of the Lightning Imager (LI) instrument is to provide information relevant to the localization and the radiance of lightning events with respect to terrestrial systems. A CMOS sensor with $1170 \times 1000$ resolution and 1000 fps frame-rate is used on the instrument, making the LI able to identify smaller lightning in terms of dimension (minimum diameter 10 km) and temporal pulse duration (minimum 0, 6ms). The amount of acquired data is very large, but only a small subset of pixels contains useful lightning information, thus information clustering is fundamental for downlink data-rate reduction. Raw sensor data are processed by application-specific integrated circuits (ASIC) in order to extract pixels coordinates belonging to lightning flashes (detected transients), which are then directly sent to the CA implemented in a field-programmable gate array (FPGA). Detected transients must be processed as they come to the CA due to high throughput requirement. The CA objective is to define rectangular windows that enclose more detected transients (DTs) in order to send more compact information to Earth. The design presented in this paper was carried out through the development of a high-level model in order to verify algorithm functionality and compliance with performance requirements. A lightning event generator was developed to simulate the DTs coming from the ASIC part.The hardware architecture was conceived and a bit-true model was developed to evaluate the implementation loss.