Animals need to switch between motivated behaviours, like drinking, feeding or social interaction, to meet environmental availability, internal needs and more complex ethological needs such as hiding future actions from competitors. Inflexible, repetitive behaviours are a hallmark of many neuropsychiatric disorders. However, how the brain orchestrates switching between the neural mechanisms controlling motivated behaviours, or drives, is unknown. This is partly due to a lack appropriate measurement systems. We designed an automated extended home-cage, the Switchmaze, using open source hardware and software. In this study, we use it to establish a behavioural assay of motivational switching, measured as the ratio of single probe entries to continuous exploitation runs. Behavioural transition analysis is used to further dissect altered motivational switching. As proof-of-concept, we show environmental manipulation, and targeted brain manipulation experiments which altered motivational switching without effect on traditional behavioural parameters. Chemogenetic inhibition of the prefrontal-hypothalamic axis increased the rate of motivation switching, highlighting the involvement of this pathway in drive switching. This work demonstrates the utility of open-design in understanding animal behaviour and its neural correlates.