A semi-automatic method for detecting the tops of the mixed layer in day time and the stable and residual layers in night time is presented. Automatic algorithms to detect gradients in the ceilometer data are utilized, in combination with a stability criteria, provided by an eddy covariance system as well as manual layer detection and quality control. The observations were carried out at Welgegund, a regional background site on the South African savannah. One year of observations was analysed, and the method is shown to work well considering existing knowledge of the continental boundary layer structure and previous observations in southern Africa. Despite having some limitations, the method provided notably high data coverage. The frequency at which each layer was detected showed an annual cycle being lowest in the summer and highest in the winter for all the three layers studied, combined with a diurnal cycle with day time providing lower coverage. A clear diurnal cycle of the boundary layer evolution was observed, however the average heights of the tops of different types of layers showed modest or non-existing annual variation. The day-to-day variation was profound. The strongest seasonal characteristic was present in the summer, when occasional deep convective layers were observed increasing the variability of the mixed layer top compared with other seasons. The effects of conditional sampling were tested by separating the observations in five data sets based on weather conditions and the applicability of the method, and various reasons with potential of causing bias in the results are discussed. The result underlines the need for representative observations of all conditions wished to be included in the study. Some examples of the implications of boundary layer structure on particle concentration are considered in explaining phenomena observed in particle number distribution measurements.