Visual organs perceive environmental stimuli required for rapid initiation of behaviors and can also entrain the circadian clock. The larval eye of Drosophila is capable of both functions. Each eye contains only 12 photoreceptors (PRs), which can be subdivided into two subtypes. Four PRs express blue-sensitive rhodopsin5 (rh5) and eight express green-sensitive rhodopsin6 (rh6). We found that either PR-subtype is sufficient to entrain the molecular clock by light, while only the Rh5-PR subtype is essential for light avoidance. Acetylcholine released from PRs confers both functions. Both subtypes of larval PRs innervate the main circadian pacemaker neurons of the larva, the neuropeptide PDF (pigment-dispersing factor)-expressing lateral neurons (LNs), providing sensory input to control circadian rhythms. However, we show that PDF-expressing LNs are dispensable for light avoidance, and a distinct set of three clock neurons is required. Thus we have identified distinct sensory and central circuitry regulating light avoidance behavior and clock entrainment. Our findings provide insights into the coding of sensory information for distinct behavioral functions and the underlying molecular and neuronal circuitry.