Teach computer science to your kids by building a Smart Watch
Get your kids ready for the future
Looking back at how I first learned programming, it wasn't a smooth experience. The internet was in its infancy and the only source of knowledge were books.
There wasn't anyone to ask either, people who knew anything about computers were in short supply.
Today, we have both abundance of information and tools. Building apps can be done with low code solutions, resulting in amazing applications.
One thing that hasn't changed is that to build apps, you still need to think like an app designer. You need to understand concept like data models, storage, processing, loops, functions platform dependencies and more.
These concepts are arguably even more important now than they been when I was a teenager. Now every company is a tech company, so being able to understand and design applications is something you'll find yourself doing in many different roles.
Why not give your child a head start?
That was my thinking when my 6y.o son and I decided to build a smart watch.
Where to start?
There are actually several software development platforms made for kids.
We're going to look at Microsoft's MakeCode, an open-source graphical software development platform, allowing you to create games and apps literally in minutes.
The nice thing about MakeCode is that aside from graphical programming, you also have the option to convert your application into JavaScript, Python and back.
While you can use MakeCode to target many different platforms (RaspberryPi, Lego Mindstorms, Adafruit, Cue, Minecraft and more), we'll be looking a the BBC micro:bit V2.
The micro:bit is half the size of a credit card, yet it possesses an ARM processor, accelerometer, 25 LED screen, light sensor, sound sensor, compass, magnetic sensor, temperature sensor, Bluetooth radio, USB port, speaker, hardware buttons, touch button, gyroscope, digital and analog I/O pins. All for 20$.
The micro:bit also has a vibrant ecosystem of accessories and a large collection of community projects you can work with.
Let me show you how it works:
In the example above, we see the brick editor and device simulator. Every time you put a new block on the board, the simulator reacts accordingly, with the ability to simulate almost all the hardware sensors onboard.
You can also see that on top there's a switch between blocks, JavaScript and Python. This allows you to switch languages easily and let MakeCode do the conversion.
When starting a new project with your child, you can start with bricks to learn the fundamentals and have the ability to switch to code whenever you feel you're ready. It's actually possible to write certain pieces in code, while building the overall design in bricks.
There's a lot of tutorials and projects using the micro:bit from simple games to advanced robotics.
Get started with Microsoft MakeCode for micro:bit (microbit.org) or Microsoft MakeCode for other platforms.
If you'd like to build a hardware project, take a look at these kits:
Recommended by LinkedIn
The SmartWatch
So you saw "Smartwatch" in the title, let's get back to that.
My son and I started by learning to develop simple apps and games, which you could upload and run one at a time. But we wanted to make something practical, something that can be mobile and preform more than one function at a time.
There's 2 things we had to address: how to make it mobile and how to run multiple applications.
Mobility
First there's the issue of power on the go. You can get an external battery pack that runs on 2xAA batteries but this is bulky. Another option is to use a button cell battery, they come in a variety of sizes and operate in the required 1.8-3.6V range.
For the first prototype we used Keyestudio's smartwatch starter kit, it runs on one CR1632 battery which is enough to get started. The battery however is not very powerful so you shouldn't expect more than several hours of continuous operation.
For the second prototype we used a pair of LIR2032, these have the advantage of offering higher capacity and being rechargeable while operating at 3.6V, within the operating limits of the microbit.
It's up to you which way to go but I suggest to start with the first prototype approach to get started and decide where you want to take it further.
The best and most advanced option would be to use a small LiPo 3.7V battery, the same as commercial smartwatches. It does require some know how to step down the voltage to below 3.6V and you'll need to do some soldering.
Software
The second issue is how do you put more than one app on the microbit? It doesn't have an OS, desktop environment or an app store. With 256KB flash you can't exactly install Android on this board, so whatever we do, needs to be really compact.
I've started by writing the bitOS, an app that would start with the device and do the following: handle all I/O, provide an interface to create apps and UX to browse installed apps. Essentially, it would act as a very simple OS.
Makecode has the ability to include extensions in your projects, which are apps or components written by other people using blocks, JS or Python. These could be loaded from the gallery or uploaded from a public Github repository.
bitOS is implemented as an extension so that any project can utilize it to run built-in apps or custom apps, implemented using the provided app template.
With bitOS added to your project you'll see new categories added to the toolbox, which make it very easy to add bult-in apps to your project:
You can add your own apps but they must be converted to JS and adopted to the bitOS App Template.
bitOS, all the built-in apps and deployment instructions is available on Github: Feincraft/FinewatchJS: Smartwatch project based on BBC Micro V2
Feel free to ask questions or suggest features on the project discussions board,
In conclusion
Computer science education is important, but it also needs to be interesting. Building something that your children can touch and play with goes a long way.
All you need to get started is 30$ worth of hardware and one hour to program the first prototype.
Your kids will learn something and will have something cool to show off at school 😉
Mcrosoft Power Platform | Dynamics 365 CE | Senior Technical Consultant | Tech Lead | Ex-Microsoft
3yWell done, Ilya! Inspiring to try this with my son