A microscope imaging system to open black boxes in brains is presented. The system is capable of simultaneously recording behaviors and neural activities of a freely moving organism with high temporal resolution. A high-speed camera is used to estimate the locations of the target and keep it inside visual field. A high-sensitivity camera records the response of the interested neuron in the brain. Optogenetics techniques are of special importance to analyze the functionality of the neuron, i.e., an element in the black box. The talk will present our trial to use robotics with optogenetics for estimating the structure of stimulus-behavior systems in organisms.