This article proposes a novel method for detecting coronavirus disease 2019 (COVID-19) in an underground channel using visible light communication (VLC) and machine learning (ML). We present mathematical models of COVID-19 Deoxyribose Nucleic Acid (DNA) gene transfer in regular square constellations using a CSK/QAM-based VLC system. ML algorithms are used to classify the bands present in each electrophoresis sample according to whether the band corresponds to a positive, negative, or ladder sample during the search for the optimal model. Complexity studies reveal that the square constellationN=22i×22i,(i=3)yields a greater profit. Performance studies indicate that, for BER =10−3, there are gains of −10 [dB], −3 [dB], 3 [dB], and 5 [dB] forN=22i×22i,(i=0,1,2,3), respectively. Based on a total of 630 COVID-19 samples, the best model is shown to be XGBoots, which demonstrated an accuracy of96.03%, greater than that of the other models, and arecallof99%for positive values.