There are lots of songs with spinning wheels in them. I think this is the one you have in mind. THE SPINNING WHEEL
I can't find an earlier thread on its origins. McColl says: A version of this fine song is to be found in the 'Tea-Table Miscellany' but, as with many of the wongs reworked by Ramsey, it has a somewhat artificial flavour. The version given here was learned from Betsy Henry of Auchterarder."