A Lego Technic Cupcake Production Line

Article by Peter Swanson CEng FIChemE


In the third of a series about chemical engineers who are volunteering their skills to contribute to society, Peter Swanson shares his experiences of getting schoolchildren into chemical engineering

I’VE enjoyed a really interesting and varied career ranging from pharmaceutical quality control, chemical analysis and microbiology, through research and development in the aerospace industry, to software design and development and on to teaching, both at school and university. This is a story about how all that has come together to build a teaching tool designed to encourage schoolchildren into chemical and process engineering.

Those of you old enough to remember back to the mid-1980s might recall a certain furore in the UK Parliament caused by the Westland Affair. It basically revolved around whether the British helicopter industry should have continued to build American machines under licence, or be integrated more fully into Europe. Given the recent debate over Brexit, this seems to have a familiar ring about it.

At that time, I worked as a research engineer for the Westland Aircraft group, based in Yeovil, Somerset. The job initially involved working on helicopter simulations, then moved on to developing manufacturing processes, before ending up contemplating how the company might use biotechnology to evolve its environmental control systems for use in manned spacecraft applications.

The backlash from the Westland affair led to the closure of the Westland’s research division, so I found myself retraining to become a teacher, before embarking on a research degree in pharmaceutical quality control in the National Health Service. This in turn led to an Honorary Lectureship, and a position as a Research Group Leader in a university pharmacy department, looking into computer aided learning (CAL) techniques.

Learning by doing

I’ve always been a great believer in learning by doing. It is hard to beat working with real equipment to solve real-life problems. However, a convincing simulation or computer game can be a good substitute, especially if a suitable factory is not readily to hand. Simulations, virtual worlds and games don’t only teach by watching or playing them. They can also be very instructive to design and build.

Every year, as an honorary university lecturer, in collaboration with other subject specialists, I gave around ten fourth-year students the task of building a CAL package. The brief was to research a topic (this could range from hypertension, to the workings of a large tabletting machine); devise a test to find out what a sample group of second-year students already knew about the subject; design and build an effective CAL package; let the younger students study the package; retest them; and finally present the package and test results to assembled staff and students.

At times it was hard to get the project students to move on to the next module. They found the creative nature of writing CAL packages quite addictive, and would often want to add new ideas, such as extra animations or 3D drawings – even after the project had been submitted and marked. It was lovely to see such enthusiasm.

Sparking imagination

Around 2007, I became chairman of IChemE’s Chester and North Wales Members Group (MG). Running the MG has been a very rewarding experience. I have learnt so much about those chemical industries previously unfamiliar to me. Over the years our committee has endeavoured to seek out topics of interest to the members. Hence, we are always open to suggestions and offers of help. We also worked closely with the University of Chester as it established a brand-new faculty of science and engineering, including a department of chemical engineering, under Steve Wilkinson.

Lego, whilst it does have obvious limitations when it comes to handling fluids or elevated temperatures and pressures, is highly popular with both children and the general public

One of the tasks the MG needed to address was how to effectively promote the fascinating and diverse work of chemical and process engineers to schools across North Wales and West Cheshire. For my part, I was looking for something more engrossing than just standing in front of a class and regurgitating a standard careers talk. I wanted to be able to spark their imagination, set them a challenge, and provide them with a means to “learn by doing” – something that would hook them on process engineering. Anything I came up with also needed to be safe, and readily transportable to the schools, using my van.

Noticing that Lego Technic was being used in mechatronics classes at Chester prompted Steve Wilkinson and I to wonder if we could use Lego to illustrate chemical or process engineering to the schoolkids. There are more specialist tools available on the market, such as Festo. However, Lego, whilst it does have obvious limitations when it comes to handling fluids or elevated temperatures and pressures, is highly popular with both children and the general public. Examples of a few mostly non-functioning models of oil rigs or parts of refineries can be found online, and I did find an interesting example of some 3D-printed bricks designed to build a fluidics circuit. Nevertheless, a working model from some process sector seemed desirable.

Show & tell: promoting the range of products associated with chemical engineering

Food for thought

A chance conversation with Paul Meara and Phill Day at the Catalyst Science Discovery Centre in Widnes suggested a solution. Why not model a process from the food industry, where the ingredients are readily available and normally safe to handle? Cupcakes sprang to mind, as they regularly feature amongst children’s favourite foods. This gave us a process that might not only appeal to their sense of play, fun and creativity, but perhaps also indulge their bottomless stomachs (even if samples for consumption – ie further bribes, if needed – might actually require being shop-bought for safety).

The next step was to purchase some Lego and electronic components, and start experimenting. You can imagine that quite a lot of Lego was going to be needed to construct a complete cupcake production line. Such a build could include items such as silos for the raw materials, elevators, a mixer, a cake batter depositor, conveyors, a cooler and an enrober. The oven, though, if it were to function, would have to be built out of metal, and resemble a mini conveyor pizza oven.

Initially, I wasn’t sure what the Lego plant would look like, so I didn’t have a precise list of bricks to order. The easiest way round this was to buy a number of the largest kits I could lay my hands on. The bucket wheel excavator kit fitted the bill nicely. The excavator included a couple of conveyors, which could easily be customised, as well as a crawler base section surmounted by a slewing mechanism for the jib. The latter suggested a way to construct the bodies of the depositor, cooler and enrober.

Luckily, the University of Chester and Techniquest Glyndwr at the University in Wrexham (now Xplore Science Discovery Centre) were able to help with some of the funding, and over a few weeks I was able to put together a prototype of the cake depositor, some conveyors and a few other smaller items.

Equipment development: cupcake line p&ID; mk III depositor (opposite, top); cupcake enrober (opposite, bottom)


In North Wales we have a couple of organisations, Careers Wales and the Engineering Education Scheme Wales (EESW), who regularly organise careers fairs for the local schools. Both organisations, as well as Denbighshire County Council had invited me to promote chemical engineering at their meetings, and of course I was able to take my prototypes along to illustrate what I had to say. Alex Seton, a colleague on the Chester and North Wales committee also suggested taking along some empty packaging to emphasise the range of products associated with chemical engineering.

The Lego certainly acted as a big draw to the IChemE stand. I think I’ve only been upstaged once, and that was by a local petting zoo, who brought along a 10-foot long python. The little children, especially, took a shine to the snake, but were relieved to hear she had just been fed. I’m pleased to report, we lost no pupils that day under mysterious circumstances.

Meanwhile, back at the university, Steve Wilkinson and I also thought the project students could benefit from developing the cupcake production line. Two areas sprang to mind, namely control engineering and product formulation. For example, was it possible to produce a cake batter that is fluid enough to be pumped by Lego pumps, but still capable of being cooked into a satisfactory cupcake? Student Hannah Maloney kindly volunteered to look into these questions for her final-year project. She worked with the NoWFOOD centre of excellence at Chester University, which supports food businesses with problems ranging from product development to nutritional testing and market feedback. Whilst there she was able to experience a real food depositor in action. We also had help from Riggs AutoPack, the manufacturer of the NoWFOOD machine, to gain a better understanding of its construction.

The Lego project at Chester has also spawned two further outreach projects with the Faculty of Engineering and Technology at Liverpool John Moores University (LJMU), co-ordinated by Senior Research Engineer Dave Evans, for Liverpool City Region LCR 4.0 Holistic (Cross Sector Digital Supply Chains). The first project involves a bottle unscrambler, inspired by the production line of local glass bottle manufacturer Encirc. The second, a Lego model of the Liverpool Telescope, a 2 m Cassegrain reflector on the island of La Palma in the Canaries, commissioned by LJMU’s Astrophysics Research Institute.

During Covid and lockdown, I’ve been updating the design, using Lego BrickLink Studio software, and rebuilding the cupcake depositor and enrober, as well as constructing the telescope model. These models just need a few more bricks to finish off the mechanical parts, and I am now concentrating on the programming and control circuitry for the depositor. This will involve the use of a Raspberry Pi, some Arduino Nanos and various electronic chips such as motor controllers, PWM devices and sensors to measure the relative position between the depositing head and the cupcake moulds on the conveyor.

Where would I like to see this all going?

Overall, the object of the exercise is to build an engineering teaching tool, constructed from both physical and virtual elements, which links teaching to the current and future needs of the process industry. The starting point has been the Lego cupcake factory, but then should incorporate virtual process plant to describe the production of raw materials, that support the cake-making process. The design, building and use of deliverables are directly relevant to undergraduate teaching and research projects, but also have a significant relevance to STEM teaching across all ages.

The cupcake factory, from the point of view of students, be they on traditional undergraduate courses or degree apprenticeships, has the following aims and is designed to provide:

  • an element of learning by doing;
  • activities that parallel those found in a real factory;
  • the production of a real product, ie a teaching tool, and associated outreach services for schools and public, designed to foster understanding and uptake of STEM subjects;
  • encouragement of an interdisciplinary, systems, problem-solving, commercial approach to engineering;
  • a degree of creative thinking, design, construction, business acumen and social interaction to enhance student motivation; and
  • a platform for students to develop presentation skills.

From the research point of view, the aim is to use Lego, Meccano, VEX, Raspberry Pi-s, Arduinos, VR/AR simulation of process plant, placement simulation and the programming languages such as Scratch, Python, Javascript, and C to develop a learning platform for chemical and process engineering that can be deployed across a range of ages, from junior-school children to undergraduates. The work could provide a number of undergraduate and postgraduate R&D projects across engineering, bringing together aspects of Industry 4.0.

From the teachers’ point of view the scheme should provide:

  • greater flexibility in course delivery;
  • materials for distance learning (eg VR, simulations, videos, Lego models), which can be used to enhance public outreach, and to advertise the capabilities of the participating organisations worldwide;
  • improved industrial networks between academia,companies, and professional engineering institutions;
  • a strengthened student and employee pipeline by encouraging more youngsters into STEM subjects;
  • concrete examples to teach difficult theoretical concepts, act as an aid memoir and enhance lectures by introducing a greater variety of learning methods to match individual learning preferences;
  • greater autonomy for study, linked with social media; and
  • a method of teaching, and a practical demonstration of Industry 4.0, which brings together concepts such as simulation; the internet of things; big data; systems integration; augmented reality; additive manufacturing; cyber security; cloud computing; and autonomous systems.
Collaborating with LJMU: a bottle unscrambler, inspired by the production line of local glass bottle manufacturer Encirc

Collaboration is key

Hopefully I’ve given you a feel for one of the ways the Chester and North Wales MG has started to bring the world of chemical and process engineering to the attention of schoolchildren, and the general public, across our region. Besides local MG members, and Education Special Interest Group (SIG) members from across the globe, the work has involved three local universities, many schools, and input from a number of firms and other institutions. I would like to see the current work extended to include more effective use of CAL tools such as VR, AR, gaming and videos. The Education SIG Digitalisation Working Group is currently exploring ways to bolster understanding and uptake of Industry 4.0 techniques relevant to our profession. If, like me, you feel these techniques and models have much potential, I would ask you to offer your support and suggestions through the Education SIG. There is always a need for enthusiastic subject specialists to help build more effective CAL resources.

Further reading

1. Blum, J, Exploring Arduino, Wiley.
2. Demaagd, K, Oliver, A, Oostendorp, N and and Scott, K, Practical Computer Vision with SimpleCV, O’Reilly.
3. Fellows, PJ, Food Processing Technology, Woodhead Publishing.
4. Howse, J, OpenCV Computer Vision with Python, Packt Publishing.
5. Isogawa, Y, The Lego Power Functions Idea Book, Machines and Mechanisms, No Starch Press.
6. Lego, Bucket Wheel Excavator construction manual, lego.com/technical.
7. Molloy, D, Exploring Raspberry Pi, Wiley.
8. Norris, D, Raspberry Pi Electronics Projects for the Evil Genius, McGraw Hill.
9. Norris, D, Raspberry Pi Projects for the Evil Genius, McGraw Hill.

To read more articles in the series visit https://www.thechemicalengineer.com/features/type/chemical-engineering-in-the-community/

Article by Peter Swanson CEng FIChemE

Visiting Research Fellow, Faculty of Science and Engineering, University of Chester; and Chairman, IChemE Chester and North Wales Members Group.

For more information or advice, contact him via membergroups@icheme.org

Recent Editions

Catch up on the latest news, views and jobs from The Chemical Engineer. Below are the four latest issues. View a wider selection of the archive from within the Magazine section of this site.