What it shows
Three hands are turned by formulas using the current hour, minute and second from the computer’s clock. It links maths on angles to coding.
The science
A full circle is 360 degrees. In 60 minutes or 60 seconds the hand turns 360, so it turns 6 degrees per unit. In 12 hours the hour hand turns 360, so it turns 30 degrees per hour, plus half a degree for each minute. Scratch measures direction clockwise from straight up, which matches a clock, so the numbers can be used directly.
Materials
Cost: free. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- A computer, laptop or phone with a browser (free)
- Scratch 3 in the browser at scratch.mit.edu (free, no sign-in needed to code)
- Three sprites drawn as lines: hour, minute and second hand
- A round clock face drawn as a backdrop with numbers 1 to 12
- A notebook and a pencil
Safety
This project uses safe, everyday materials. Still, read the rules below with a parent before you start.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
Step by step
8 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Draw a clock face on the backdrop with a circle and the numbers 1 to 12 using the Text tool.
In the Paint Editor draw a long thin line pointing to the right (Scratch’s direction 90) and drag it until its left end sits on the crosshair at the centre of the canvas; the crosshair is the pivot, so the hand will turn about its base.
Duplicate the sprite twice and make one shorter (hour hand) and one thinner and red (second hand).
On the second hand: when green flag clicked, go to x: 0 y: 0, then forever with point in direction ((current second) * 6). Choose second in the Sensing block current ( ).
On the minute hand do the same with point in direction ((current minute) * 6).
On the hour hand use point in direction ((((current hour) mod 12) * 30) + ((current minute) / 2)); the mod and the plus come from Operators.
Press the green flag and compare with the clock on your phone; the hands should agree.
If a hand points the wrong way, check that the line was drawn pointing right and that its base is on the crosshair.
What you should see
Three hands move on the clock face and show the same time as the computer’s clock, with the second hand ticking once a second.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
01Why multiply minutes by 6?
360 degrees divided by 60 minutes is 6 degrees per minute.
02Why does the hour hand use 30?
360 divided by 12 hours is 30 degrees per hour.
03Why add minutes divided by 2?
The hour hand also moves slowly during the hour: 30 degrees in 60 minutes is half a degree a minute.
04What is mod used for?
It converts 24-hour time to 12-hour time, so 15 becomes 3.
Take it further
Add a digital clock using join blocks with current hour, minute and second, and show it beside the analogue clock.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
Free ebooks for this project
Computer & office
Computer Fundamentals Study Book
The complete study notes, practice questions and glossary for Computer Fundamentals
Find out more about computing and coding
Free, well-known places to explore the subject further. Ask a grown-up before you sign up for anything or type your name anywhere.
