FIELD: food industry.SUBSTANCE: group of inventions relates to coffee industry. Device (100; 400) comprises sampling module (102, 402) configured to take as samples first batch of coffee beans and a second batch of coffee beans from coffee beans during roasting, grinding module (103; 403) connected to a sampling module and configured to grind a second batch of coffee beans, determination module (104; 404) which is mechanically connected to a sampling module and a grinding module, configured to determine the colour of the surface of the coffee beans of the first batch and determining colour of powder of coffee beans of the second batch after grinding, respectively, control module (105; 405), which is electrically connected to the determining module, configured to control the roasting process at least partially based on the installed colour of the surface of the first batch of coffee beans and installed powder colour of the second batch of coffee beans. Control module (105; 405) comprises an analytical module which is electrically connected to the determining module, and a controller which is electrically connected to the analytical module. Controller is configured to control the roasting process based on the specified degree of roasting coffee beans. Analytical module is configured to determine the degree of roasting coffee beans based on the installed colour of the surface of coffee beans of the first batch and the colour of powder of coffee beans of the second batch. Sampling module is configured to repeatedly take samples at a given frequency during the entire frying process, which is different at different roasting phases. Also disclosed are a method of controlling a process of roasting coffee beans using the disclosed device, and a coffee machine for preparing cooked coffee, comprising the disclosed device.EFFECT: group of inventions provides control over roasting process of coffee beans, at which roasting profile is adjusted based on state of coffee beans durin