The son of Helen Whytt and the Rev Andrew Melville, minister of Monimail (d. 29 July 1736), Melvill was a student at the University of Glasgow. In 1749, with Alexander Wilson, his landlord and later the first professor of astronomy at the University, they made the first recorded use of kites in meteorology. They measured air temperature at various levels above the ground simultaneously with a train of kites.