Today, semiconductor nanoparticles are very important from the industrial application point of view. They have unique properties, such as fine particle size, high specific surface area, photoluminescence, and light absorption. The specific surface area of the particles is a function of the particle size and dispersion. However, nanoparticles accumulate rapidly after the formation due to the overcoming of gravitational forces between particles. The stabilization of semiconductor nanoparticles on stabilizers reduces their accumulation and increases the contact surface and increases their efficiency. In this study, cadmium sulfide nanoparticles were produced via a new biological method using Bacillus licheniformis . Then the semiconducting nanoparticles were stabilized on diatomite powder as a stabilizer. FESEM images showed that the cadmium sulfide nanoparticles were successfully fixed on diatomite using diallyl dimethyl ammonium chloride polymer as an adhesive. According to the Atomic Absorption Analysis, the number of nanoparticles fixed on the diatomite powder was 19.64 mg/g nanoparticles on the 0.5 g diatomite, and 11.89 mg/g on 0.75 g diatomite, 10.25 mg/g on 1 g diatomite, and 9.26 mg/g on 1.25 g diatomite. Therefore, the highest number of nanoparticles was fixed on 0.5 g diatomite. To investigate the photocatalytic effect, methylene blue color absorption was investigated by the produced nanocomposite in either dark conditions and in the presence of UVA light with a wavelength of 360-400 nm in different conditions. The results of the experiments showed that when the nanocomposite was 1 g, and the concentration of color was 10 mg/l at pH=9, the highest removal percentage was achieved (27.74%). Moreover, the kinetics of dye removal was studied. The pseudo-second-order kinetic model showed the best correlation between the experimental and computational results. The best condition was also used to investigate the photocatalytic activity of the composite on Cr (VI) conversion into Cr (III). The results showed that by increasing chromium concentration, the percentage of Cr (VI) removal decreased. Also, it was shown that the process obeyed the pseudo-second-order kinetic model.