Context. The total mass of a cluster, which is the main parameter determining its ability to host more than one stellar generation, may constitute a threshold below which the cluster is able to form only a single stellar population. Aims. Our goal is to investigate the existence of star-to-star variations in CN and CH band strengths, which are related to the N and C abundances, respectively, among the stars in five open clusters (NGC 2158, NGC 2420, NGC 2682. These variations are observed in globular cluster stars and they are linked with the existence of multiple populations. Since these systems are less massive than globular clusters, our results may allow us to constrain the lowest mass necessary to form more than one stellar population. Methods. We measured the strength of the CN and CH bands, which correlate with the C and N abundances, using four molecular indices in low-resolution SDSS/SEGUE spectra. Results. For four of the open clusters (NGC 2158, NGC 2420, NGC 2682, and Berkeley 29) we found that all the stars studied in each of them have similar CN and CH band strengths within the uncertainties, since neither anomalous spreads nor bimodalities have been detected in their CN and CH distributions. In contrast, we found an anomalous spread in the strength of the CN molecular band at 3839 Å for NGC 7789, which is larger than the uncertainties. However, the small number of stars studied in this cluster implies that further analysis is needed to confirm the existence of chemical inhomogeneities in this cluster.