Remote and precisely controlled activation of the brain is a fundamental challenge in the development of brain–machine interfaces for neurological treatments. Low-frequency ultrasound stimulation can be used to modulate neuronal activity deep in the brain, especially after expressing ultrasound-sensitive proteins. But so far, no study has described an ultrasound-mediated activation strategy whose spatiotemporal resolution and acoustic intensity are compatible with the mandatory needs of brain–machine interfaces, particularly for visual restoration. Here we combined the expression of large-conductance mechanosensitive ion channels with uncustomary high-frequency ultrasonic stimulation to activate retinal or cortical neurons over millisecond durations at a spatiotemporal resolution and acoustic energy deposit compatible with vision restoration. The in vivo sonogenetic activation of the visual cortex generated a behaviour associated with light perception. Our findings demonstrate that sonogenetics can deliver millisecond pattern presentations via an approach less invasive than current brain–machine interfaces for visual restoration.