The issue of developing an algorithm for operating the hardware module of the departmental petrol station automa-tion system is considered. The paper gives the development features related to the system hardware implementation, which accounts and controls fuel consumption, analyses fuel level in the tank, provides service only to the authorised users, and also allows controlling the system remotely. The hardware part is implemented as a control terminal. The authors present the main stages of the algorithm development, including the system structure examination, the criteria development, the control scheme determination, the algorithm for operating the petrol station terminal, regulated by the operating mode cycle, taking into account the functional state of the system parameters. When developing the al-gorithm, the structural implementation features of the hardware module are taken into account, the parameters for using the GSM network, the freeRTOS operating system are determined, and the online payment card structure in the MIFARE card format is developed. A development peculiarity is that the developed algorithm for the terminal opera-tion can be adapted to the structure of any automated filling system without modifications.