The copper tubing, like everything else in the world, is made of atoms that are constantly vibrating. The higher the temperature, the faster the atoms vibrate. When you pour hot water into the tubing, heat flows from the water to the copper, giving energy to the copper atoms, which vibrate faster. This increase in vibration causes the atoms to collide with each other more often and more violently, so the space between the atoms increases. As a result, the whole tube gets longer and thicker. The needle turns as the tube expands.
When you pour cold water into the tube, the copper atoms give up some of their heat energy to the water, vibrate less violently, and move closer together. The tube shrinks and the needle turns in the opposite direction as the tube contracts.
The copper tube expands by 1.7 × 10–5 of its length for every 1.8 degrees Fahrenheit (1 degree Celsius) of temperature increase. So, a copper tube that is 3.3 ft (1 m) long will expand by 5.6 × 10–3 ft (1.7 × 10–3 m) over a 180-degree Fahrenheit (100-degree Celsius) temperature change, lengthening by almost 0.06 inch (1.7 mm).
As the copper tube expands, it will make the needle roll over this distance of 0.06 in (1.7 mm). When an average-sized needle rolls 0.06 in (1.7 mm), it makes more than two complete revolutions. The toothpick in the eye of the needle dramatically amplifies the motion of the expanding or contracting rod.