Four hundred feet below ground at Prestongrange there was once a great seam of coal, the compressed relic of long-gone life. Miners knew it was there and they wanted it. But it wasn't easy to get at. So in 1874 the Prestongrange Coal and Iron Company bought a steam-powered Cornish beam engine to pump water from the depths so the miners would not drown.
Today the great machine towers over visitors to Prestongrange, now one of East Lothian's museums. It is the only beam engine from the age of coal still standing at its original site in Scotland - and very impressive it is, say senior pupils at Macmerry and Pencaitland primaries, who first visited the museum for inspiration, then unleashed their own inventiveness on more modern problems.
The impetus for the joint project that culminated in a Glow Meet between the schools came from East Lothian Museums education officer Sarah Cowie. "We got funding from the Creative Learning Networks for Glow Meets and knowledge transfer," she says. "I had the idea of using Prestongrange, so I invited our primary schools to take part."
Kirsty Greenwood, a teacher at Mac-merry, and Emma Kerr, from Pencaitland, responded and the project got under way with a whole-day visit and guided tour.
"It was a great chance for my P67 class to work with outside experts," says Mrs Greenwood. "It was also a nice transition opportunity, since Pencaitland and our pupils will go to the same high school."
The project was a timely one for Mrs Kerr's P6 class. "We had a cross- curricular project on invention planned, so this would let the children see physics in action," she says.
The teachers wanted the project to be enquiry-based and pupil-led, says Mrs Greenwood. "So Sarah produced a nice DVD of herself at Prestongrange, in which she presented the problems the miners faced - flooding, gases, transport - and asked the children, `What ideas do you have to solve these problems?'"
It was a good way to convey that the starting point for invention is a problem, and it laid a solid foundation for the next stage, in which groups of pupils at both schools devised their own inventions.
"We first made posters about inventions through time," says Claire Robertson (P7). "I like arts and crafts so I really liked making our own invention."
She chuckles at the memory. "It was a two-headed umbrella, so people could walk side by side and not get wet."
Devising inventions and making proto-types was also the most enjoyable part for Cameron Renwick (P7). "We came up with the desk buddy, which is useful in schools and the workplace. It was the winner in both competitions."
Being pupil-led meant that activities in the schools varied, with a Dragons' Den competition at Macmerry and a Patent Office examination at Pencaitland.
The Glow Meet that followed, in which pupils showed promotional videos of their product to the other school - who voted for their favourite - brought everyone together in an effective climax of the project.
But to get there, teachers had first to translate the statement "classes come up with inventions" in their initial plan into reality. This wasn't hard, they say, as the kids loved getting the chance to be inventive.
"We looked at how inventions come from existing things that are improved or modified," says Mrs Greenwood. "They studied modern products and thought about making them better."
Comparing those they saw at Prestongrange with modern inventions stimulated her pupils' thinking, says Mrs Kerr. "We talked about the real need for invention in those days, while today it's about making life more comfortable. So my pupils came up with modifying a household item or making a product more eco-friendly."
The Macmerry pupils took everyday problems as their starting point, says Mrs Greenwood. "That led to practical stuff, such as the two-headed umbrella, heels on shoes that you lower if your feet get sore, and techno-chic jewellery, where the charms on a bracelet are computer memory sticks."
It was, however, the imaginative input of Sarah Cowie and the East Lothian museums, and the link they provide to a past that still lives in people's minds, that pulled the project out of the ordinary, say the teachers and pupils.
"I really liked the beam engine at Prestongrange," says Jordan Smith (P6).
"When we're out together, my dad points things out to me and says, `This used to be that.' My grandad was a miner and so were loads of people that I know about. So I like learning all about mining."
Prestongrange is a site of major importance in the story of the Industrial Revolution. It was the location of a 16th-century harbour, a 17th-century glass works, 18th- and 19th-century potteries and a 1920th-century coalmine and brickworks. Remnants of these industries can still be seen, and many structures are intact, including the Hoffman kiln built in 1937 and the Cornish beam engine.