With this regiment he arrived in Canada in 1776 to fight alongside British troops in the American Revolutionary War.
After being released on parole, he resigned from his office of chaplain and began to preach in Lancaster County, Pennsylvania.
His service exerted a strong influence on the German colonists of Pennsylvania, and his entomological interests were said to "furnish some of his parishioners with mild amusement".
His insect collection, inherited and increased by his second son Frederick Ernst Melsheimer and his son's friend Daniel Ziegler, was eventually purchased by Harvard University and formed the basis for what is now the largest university-owned collection of insects in the United States.
Melsheimer was also interested in mineralogy and astronomy, and served as Professor of Languages at the recently founded Franklin College in 1787.