FEW parents who have tidied up yet another a pile of Lego - or stood on a stray piece in bare feet - would ever imagine their child's obsession could make a spectator sport.

But in the coming weeks, teams of school-age Lego fanatics in Scotland will pit their wits and their talents against each other in the second annual Lego league - and if the 150-strong crowd that turned up to watch last year's inaugural event in Edinburgh is anything to go by, interest will be intense.

The First Lego League is a US-based international organisation that challenges teams of children to build and programme robots using Lego's specialist Mindstorms sets.

The competition has been running in England for more than a decade and made its debut north of the Border in an event at Edinburgh University in 2013 in which eight teams took part. It was won by a team from Calderwood Primary School in Rutherglen.

For the 2014 event, organiser Laura Meikle is rolling out the Lego League to Glasgow and Aberdeen, and hopes a Scottish team can go on to emulate the success of their English counterparts, who have won the world final in Louisiana for the last two years.

Ms Meikle, who is based in the Borders, runs Lambda Jam, a non-profit organisation that aims to turn on children to the delights of computer technology. She is running the Lego League event in Scotland in collaboration with the Royal Society of Edinburgh's Young Academy.

"The Lego League is a robotics-based competition to get kids developing their skills in all the STEM subjects - science, technology, engineering and mathematics," said Ms Meikle. "But more importantly, from my point of view, it gets them passionate about those subjects. It gets them being innovative and creative."

Ms Meikle's aim is to see the Lego League built into the school curriculum, rather than being offered as a lunchtime activity or after-school club as is currently the case.

"I'd like to encourage those who might not ever think of trying it but who might give it a go and discover that they like it and are good at it - especially girls. They are the minority.

"It's about trying to open the doors for more females to try it at a younger age before they get these preconceptions of what a girl does."

This year, 28 teams of between two and 10 pupils - about 250 children in all - will compete at the three regional heats.

The first takes place at Edinburgh's Dynamic Earth on Saturday, with the Glasgow and Aberdeen events following on December 2 at the Glasgow Science Centre and December 10 at Aberdeen's Satrosphere Science Centre. The three Scottish winners will then travel to the UK final at Loughborough University in April.

Calderwood Primary will be defending their title at the Glasgow event. Made up of seven boys and one girl from primaries six and seven, they are coached by Malachy Devlin, who has run his own tech-based companies and whose 11-year-old son Callum is part of the team.

"It's all about team-building and their approach to problem solving," said Mr Devlin. "It's a well-rounded event. You might have some people who are stronger on the technical side, or on the project itself or who have the presentational skills. Having worked in business, that's what you have to do when you're bringing a new product to market."

So let battle commence. And, though all involved say it is the taking part that counts, may the best bot win.