Skip to main content

From Motion to Meaning: Detect your nose in Scratch 3

From Motion to Meaning: Detect your nose in Scratch 3

When I first wrote about Scratch and Webcams back in 2019, the excitement was centred on the "New Frontier" of Scratch 3.0. We were exploring how to bring back the classic video sensing features—making cats jump or bubbles burst when we waved our hands. At the time, that was the peak of "Magic" in the classroom: the physical world interacting with the digital one.

Fast forward to today, and the landscape for STEM educators and makers has shifted. We are no longer satisfied with the computer merely knowing that something moved; we want the computer to know what is moving  We have moved from simple motion detection to Artificial Intelligence and Computer Vision.

If you want to re-energize your STEM lab or maker space, it’s time to move beyond the basic Video Sensing blocks and dive into the Face Sensing extension, So here is an example project playing with htese ideas.


The Project: The Nose-Tracking Security "Mask"

The goal of this project is to create a digital lock. When no one is present, a "Green Button" sits idle on the screen. But the moment a face is detected, the AI springs into action, switches to a "Red Button," and physically tracks your nose as you move.

Think of it as a biometric "Privacy Shield"—the computer recognises you and immediately places a digital mask over your face.

face coveredd with a big red button



Step 1: Create the buttons

You will need two costumes for your "Lock" sprite:

  1. Button 1: The standard button from the Scratch library (Green).

  2. Button 2: A modified version with the centre filled in (Red).

creating the sprites as two button

Button2 just has the centre filled in, button 1 is the standard one from the library of sprites.


Step 2: The Idle State

Start with the camera closed or covered. We want the program to behave like a standard screensaver when no one is around, placing the green button randomly on the screen to show the system is "Ready."

scratch blocks for the idle state



Step 3: Adding the AI Magic

To level up, you need to add the Face Sensing extension (found in the Extensions menu in the bottom-left corner). Once added, you’ll see a brand-new set of blocks that can detect eyes, ears, and—most importantly for us—the nose.

We are going to use logic that continually checks the environment:

  • If a face is detected: Switch to the Red Button (Button 2) and use the go to [nose] block.

  • If no face is detected: Switch back to the Green Button and return to the random "idle" movement.

Using the face sensing extension 

The face-sensing blocks in the extension library

We have a number of new blocks to play with

the face-sensing blocks


We are going to use the logic that the program continuously checks 

- if the face is detected, then go to the nose and change the button to the red burron (Button2) and then place it on the nose - check tracking the nose;

-if there is not a face detected, then switch to the green button


The complete code with all the blocks


The "Aha!" Moment

What was the "wow" moment for me? It was the precision.

Using such a simple set of blocks, the tracking is incredibly robust. Even when I moved my head quickly or tilted to the side, the AI kept that red button pinned exactly to my nose. In 2019, this would have required complex coding; in 2026, it’s a three-block script. It proves to students that AI isn't "magic"—it's just very clever math that they can control


Where can we go next?

The possibilities for makers are endless:

  • The Biometric Password: Create a screen that only hides or reveals a "secret" message once a face is detected.

  • Physical Integration: Connect a Micro:bit. When the nose is detected, have a physical servo motor move a latch or ring a bell.

  • More AI: Go further by using Machine Learning for Kids to train the computer to recognise specific faces or objects.

By building this, students aren't just consumers of AI technology—they are the architects of it.

What will you build with Face Sensing? Let me know in the comments!



All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Comments

Popular posts from this blog

Programming Anki's Vector robot

With the sad news that Anki is shutting down ( https://www.vox.com/2019/4/29/18522966/anki-robot-cozmo-staff-layoffs-robotics-toys-boris-sofman ) I thought it was time I start playing with the SDK for the Vector robot. In this short post, I providing a quick overview of getting going with this with a simple program based on the tutorials Anki provide. Installation I am using a Mac (more details are available here  https://developer.anki.com/vector/docs/install-macos.html ) but there are instructions for Windows and Linux. - You need the Vector to have been set-up previous on a tablet, and an account set-up on the Anki Cloud. - Install Homebrew - available here  https://brew.sh/ - Using Homebrew to install Python3  brew install python3 -Now install the SDK  python3 - m pip install -- user anki_vector - Lst but not least configure the set-up  python3 - m anki_vector . configure - that is it. The configuration tool tells you where the serial...

Speech Recognition in Scratch 3 - turning Hello into Bonjour!

The Raspberry Pi Foundation recently released a programming activity Alien Language , with support Dale from Machine Learning for Kids , that is a brilliant use of Scratch 3 - Speech Recognition to control a sprite in an alien language. Do the activity, and it is very much worth doing, and it will make sense! I  would also recommend going to the  machinelearningforkids.co.uk   site anyway it is full of exciting things to do (for example loads of activities  https://machinelearningforkids.co.uk/#!/worksheets  ) . Scratch 3 has lots of extensions that are accessible through the Extension button in the Scratch 3 editor (see below) which add new fun new blocks to play with. The critical thing for this post is  Machine Learning for Kids  have created a Scratch 3 template with their own extensions for Scratch 3 within it  https://machinelearningforkids.co.uk/scratch3/ . One of which is a Speech to Text extension (see below). You must use this one ...

Robot Software

In the previous blog posts for this 'series' "It is a good time...."  Post 1  looked at the hardware unpinning some of this positive rise in robots; Post 2  looked at social robots; Post 3  looked at a collection of small robots; Post 4 looked at further examples of small robots Robots, such as the forthcoming Buddy and JIBO, will be based some established open sourceand other technologies. Jibo will be based around various technologies including Electron and JavaScript (for more details see:  http://blog.jibo.com/2015/07/29/jibo-making-development-readily-accessible-to-all-developers/ ). Buddy is expected to be developed around tools for Unity3d, Arduino and OpenCV, and support Python, C++, C#, Java and JavaScript (for more details see http://www.roboticstrends.com/article/customize_your_buddy_companion_robot_with_this_software_development_kit ).  This post contin ues with some of the software being used with the smaller robots.  A number ...