A method for the optical recognition of capsules for hot beverages machines comprising the steps of: - marking a capsule with a recognition substance, said recognition substance arranged to emit an optical signal at a predetermined frequency B for a predetermined time frame K in response to an excitation by an optical signal at a predetermined frequency A and for a predetermined time frame H; - introducing said capsule in a hot beverages machine; - stimulating said capsule by an exciting optical signal emitted by a light source of said machine, said exciting optical signal being emitted at a predetermined frequency f1 = A and for a predetermined time frame t1 = H; - reading a feedback optical signal by an optical reader of said machine, said feedback optical signal being emitted by said capsule at a frequency f2 and for a time frame t2; - acquiring the values of said frequency f2 and/or of said time frame t2of said feedback optical signal; - evaluating the fulfillment of predetermined conditions on said values of said frequency f2 and/or of said time frame t2, said step of evaluating being carried out by a control unit of said hot beverages machine; - blocking the normal operation of said hot beverages machine in case that said step of evaluating is negative; - pursuing the normal operation of said hot beverages machine in case that said step of evaluating is positive; said method characterized in that said recognition substance is located inside said capsule ; and in that a production step of said capsule is provided, said step comprising the steps of: - prearranging a main body of said capsule ; - filling said main body with a predetermined food substance; - introducing said recognition substance, by means of a permeable support element , in said main body ; - sealing said main body by means of a sealing film . - marking a capsule with a recognition substance, said recognition substance arranged to emit an optical signal at a predetermined frequency B for a predetermined time frame K in response to an excitation by an optical signal at a predetermined frequency A and for a predetermined time frame H; - introducing said capsule in a hot beverages machine; - stimulating said capsule by an exciting optical signal emitted by a light source of said machine, said exciting optical signal being emitted at a predetermined frequency f1 = A and for a predetermined time frame t1 = H; - reading a feedback optical signal by an optical reader of said machine, said feedback optical signal being emitted by said capsule at a frequency f2 and for a time frame t2; - acquiring the values of said frequency f2 and/or of said time frame t2of said feedback optical signal; - evaluating the fulfillment of predetermined conditions on said values of said frequency f2 and/or of said time frame t2, said step of evaluating being carried out by a control unit of said hot beverages machine; - blocking the normal operation of said hot beverages machine in case that said step of evaluating is negative; - pursuing the normal operation of said hot beverages machine in case that said step of evaluating is positive; - prearranging a main body of said capsule ; - filling said main body with a predetermined food substance; - introducing said recognition substance, by means of a permeable support element , in said main body ; - sealing said main body by means of a sealing film . <EOS>