Computer programming education in elementary schools in Israel is constantly rising. As most of the textual programming languages are based on the English language, as well as they have strict syntax requirements, elementary school student face many difficulties using them. In order to overcome these challenges, we suggest using a simple visual programming language, called "PuppetBlocks", for programming an interactive puppet, made by ESP32 micro-controller and MicroPython firmware. By using Google Blockly library with BIPES platform, such a puppet can be used for teaching both the concepts of algorithmic thinking and the basics of programming in Python.
This project is based on a previous work, by A. G. D. S. Junior et. al. (2020). In this work, a framework for website-based visual programming language for controlling micro-controllers using MicroPython firmware was presented. Please read the paper for more details about this work:
Junior, Andouglas Gonçalves Da Silva et. al. 2020. “ BIPES: Block Based Integrated Platform for Embedded Systems.” In IEEE Access, volume 8, pages 197955-197968.. https://doi.org/10.1109/ACCESS.2020.3035083.
This work is submitted as the final project in the course "Project in The Internet of Things"
(236333), at The Interdisciplinary Center for Smart Technologies (ICST), Taub Faculty of
Computer Science, Technion - Israel Institute of Technology. This project was written by
Orel Adivi (orel.adivi [at] cs.technion.ac.il)
, Hila Ginzburg
(hila.gin [at] campus.technion.ac.il)
, and Noy Shmueli (noyshmueli [at] campus.technion.ac.il)
,
and under the supervision of Assel Aborokn, Tom Sofer, and Itai Dabran, Ph.D. . The work was done in about
an academic semester and is released under GNU General Public License v3.0.
As an IoT project, one of the main components is a Puppet, which is a robot with an ESP32 micro-controller, two servo engines, two screens, a 2-dimension joystick, a speaker, and an SD card. We chose the components to be cheap (we assume that the total cost is no more than 30$), so schools can replicate our work easily.
We used the following hardware components in the project:
The following diagram shows the connections described above:
The script Check.py
can help ensuring that all
the hardware components work correctly. The code can be ran using Thonny, after installing the firmware as described below.
In order to perform actions using the website, a firmware with a standard library has to be burned on the micro-controller. The firmware allows using MicroPython for interpreting the commands, the PuppetBlocks library provides an abstraction of the possible actions for an easier use for elementary school students.
In order to burn MicroPython on the device, Requests and pathlib has to be install on the local computer, which can be done using Pip package installer:
python -m pip install -r requirements.txt
Then, running the burner with --help
flag gives the list of the parameters to provide:
python burn.py --help
The following output is given:
usage: burn.py [-h] [-m MICROPYTHON] -e ESPTOOL -c CONNECTION
PuppetBlocks - Learn programming with blocks and a puppet.
options:
-h, --help show this help message and exit
-m MICROPYTHON, --micropython MICROPYTHON
the url of the MicroPython firmware (default: v1.19.1)
-e ESPTOOL, --esptool ESPTOOL
the root for esptool.exe
-c CONNECTION, --connection CONNECTION
the connection to the device (usually COM4)
For help with the burner please read SUPPORT.md .
After specifying a location for a local esptool.exe
file, a serial connection to the micro-controller, and
optionally a URL for a MicroPython firmware (without the --help
flag), a single click is required on the
BOOT button on the ESP32 controller for allowing the burning.
Additionally, the following files are part of the PuppetBlocks standard library:
Audio.py
- This fileboot.py
- This file runsPuppetBlocks.py
-Screen.py
- This fileSecrets.py
- InServo.py
- This fileAs a summary, the following steps have to be performed in order to burn MicroPython and PuppetBlocks standard library:
esptool.exe
to the device (usually such a file is downloaded when installing Arduino IDE).esptool.exe
.import webrepl_setup
,E
, specifying a password and confirming it, and finally resetting the device (optionally using disconnecting andThe total process might take a few minutes, but it has to be performed only once for each device.
The main way in which the elementary school students interact with the system is using the website, available on https://codingblocks5.github.io/PuppetBlocks/. This is a static, single page frontend-based website, written in HTML, CSS, and JavaScript, allowing the students to program the micro-controller. Beside the general blocks that were presented in BIPES, there are 31 unique blocks intend to help the student interact with the device.
The following block categories were added:
Downloading files to the device require previous uploading to the PuppetBlocks cloud, which is stored in Cloud Storage for Firebase. The website allows a simple uploading and viewing a list of all currently available files in the cloud. Executing the code is possible either using a serial (USB) connection or using WiFi with MicroPython WebREPL. It is possible to download the current code to a local file and to upload previously downloaded files from the local computer. The interface is available on English, with a basic support for Hebrew, Arabic, Italian, and Russian.
For security purposes, commits were signed cryptographically, security Github Actions were enabled, and a SECURITY.md file was written. For documentation, a SUPPORT.md file was written. The project was written using both Visual Studio Code and Thonny IDE, and was managed using GitHub.
For allowing an easier development, the following Github Actions were set, running on Linux (Ubuntu 20.04).:
Please feel free to contact us with any questions you have about PuppetBlocks.