Abstract. Optogenetic methods enable an experimental dialogue with biological systems composed of many different cell types—in particular, with neural circuits in the brain. These methods are called “optogenetic” because they use light-responsive proteins (“opto-“) encoded in DNA (“-genetic”). Optogenetic devices can be introduced into tissues or whole organisms by genetic manipulation and be expressed in anatomically or functionally defined groups of cells. In a decade and a half, optogenetic control of neuronal activity has developed from a far-fetched idea to a widely used technique for probing the neural substrates of behavior. My talk will recount how this happened, drawing on the earliest and latest results from my lab. To illustrate what is now possible, I will present recent work on the homeostatic regulation of sleep. Optogenetics has allowed us to pinpoint neurons whose sleep-inducing activity switches on as sleep deficits accrue, understand how this activity switch works, and map some of the efferent connections that impose sleep on the rest of the brain.