Unravelling the logic of neural circuits underlying behavior requires precise control of sensory inputs based on the animal's behavior. This article presents Raspberry Pi Virtual Reality (PiVR) as an affordable tool designed to enable both academic labs and citizen-science projects to conduct such functional analysis by immersing freely-moving animals in virtual realities.