© 2023 World Scientific Publishing Company.The aim of this work is to examine the influence of the type and concentration of an electrolyte solution on the optical characteristics of CdS nanoparticles produced by the sonochemical approach. The optical characteristics of the samples were examined using an Ultraviolet-Visible (UV-Vis) spectrophotometer in order to calculate the bandgap value. Acquired samples were examined on how to change the bandgap at various concentrations within various electrolyte solutions in order to ascertain the effects of various ambiences. Cadmium nitrate tetrahydrate (Cd (NO3)2 4H2O), cadmium acetate dihydrate (Cd(CH3COO)2 2H2O) and sodium chloride (NaCl) water solutions were utilized as electrolytes in three different environments. When the sample was exposed to a different environment, its energy spectrum changed. Measurements show that raising the concentration of various electrolyte solutions decreased the bandgap values of the samples.