An aptamer-based machine is used for the amplified detection of the low-molecular-weight analyte, cocaine. The aptamer sequence recognizing cocaine, 1, is blocked to an inactive structure through its hybridization with 1a. In the presence of cocaine, 2, the blocked aptamer is folded to form the cocaine-aptamer complex 3, while releasing 1a. In the presence of the nucleotide mixture, dNTPs, polymerase, and the nicking enzyme Nt.BbvC I, a polymerization-nicking and strand displacement is initiated on the cocaine-aptamer complex that acts as "track". The displaced strand 4 hybridizes with a hairpin nucleic structure 5 that is functionalized at the two ends of the "stem" by a dye (FAM)/quencher (TAMRA) couple. The fluorescence of the dye is quenched by TAMRA in the "hairpin" structure. The opening of the "hairpin" structure through hybridization with 4 restores the fluorescence of the dye (λex = 480 nm; λem = 520 nm). The resulting fluorescence signal provides a readout signal for the operation of the aptamer-based machine and for the detection of cocaine. The system enabled the analysis of cocaine with a detection limit that corresponded to 5 × 10-6 M.