Prior to entering politics, Barnhart worked as a psychologist and adjunct professor at the University of Oregon. He was elected to the Oregon House of Representatives in 2001 and assumed office in 2001. After serving one term, Barnhart's district was redrawn. He represented the 11th district from 2003 until his retirement in 2019.