Distracted driving remains a serious risk to motorists in the US and worldwide. Over 3,000 people were killed in 2013 in the US because of distracted driving; and over 420,000 people were injured. A system that can accurately detect distracted driving would potentially be able to alert drivers, bringing their attention back to the primary driving task and potentially saving lives. This paper documents an effort to develop an algorithm that can detect visual distraction using vehicle-based sensor signals such as steering wheel inputs and lane position. Additionally, the vehicle-based algorithm is compared with a version that includes driving-based signals in the form of head tracking data. The algorithms were developed using machine learning techniques and combine a Random Forest model for instantaneous detection with a Hidden Markov model for time series predictions. The AttenD distraction algorithm, based on eye gaze location, was utilized to generate the ground truth for the algorithm development. The data collection at the National Advanced Driving Simulator is summarized, results are presented, and the paper concludes with discussion on the algorithms. This work falls within a program of research on Driver Monitoring of Inattention and Impairment Using Vehicle Equipment (DrIIVE) and is sponsored by NHTSA.