Arduino-Compatible Modular Kit Design and Implementation for Programming Education

Article history: Received: 22 July, 2020 Accepted: 11 August, 2020 Online: 17 September, 2020 To cultivate creative talent, ways to learn creative problem-solving skills is needed, and one of them is programming. Arduino is a well-known tool used for programming education and the usefulness has been demonstrated in various case studies. However, there are several problems in existing Arduino-compatible kits as education tools, including the need for understanding hardware and the difficulty of expanding the kits with third-party hardware. In this paper, the design of an Arduino-compatible modular kit, called as FRUTO, is proposed that can be easily connected and conveniently programmed to overcome the problems. The structure and features of the FRUTO kit that implements the proposed design are also shown. The FRUTO kit consists of the FRUTO module that uses a unified connector for easy and intuitive connection and the FRUTO library that abstracts hardware-dependent code for easy programming. The FRUTO kit is easier to use and more scalable than existing kits. Even more, it can be used in various ways depending on the students’ familiarity with hardware and programming. These strengths will make the kit to be an appropriate tool for various microcontroller-related education as well as programming education.


Introduction
In modern society, programming goes beyond creating programs that run on computers to include interacting with everyday environments through computers. This concept of programming is more important than ever in the context of the fourth industrial revolution and the internet of things. The importance of programming education is also evident in the inclusion of programming in curriculum, beginning in the United Kingdom in 2014. In Korea, programming education has been implemented gradually since 2018 following the curriculum revision in 2015 [1]. Accordingly, information course was designated as compulsory and physical computing was included as part of information course. Physical computing, designed to teach interactive design at Interactive Telecommunications Program at New York University, means building interactive physical systems by the use of software and hardware that can sense and respond to analog world [2], which can be extended to a creative framework for understanding human beings' relationship to digital world. The introduction of physical computing, not just computer-based programming, in information course reflects the assessment that programming education helps to develop problem-solving skills and improve logical thinking. The findings that hardware education has a positive impact on students' interest, motivation and learning attitudes also influenced this decision [3][4]. Physical computing can be beneficial for students who are not necessarily interested in pursuing computer programming but would like to gain a better understanding of technology and how it is shaping our world [5].
Arduino is one of the representative tools used for programming education [6][7][8]. Arduino began as an open-source microcontroller project for artists and has become one of the leading microcontroller projects for its ease of use. Arduino has been widely adopted as an educational tool in elementary, middle and high schools as well as universities, and various educational effects using Arduino have been reported [9][10]. In addition, various studies on the development of Arduino-compatible educational tools are also in progress [11][12][13]. However, one of the problems in using Arduino as an educational tool is that it requires knowledge of hardware. Besides, existing Arduino-compatible kits are designed without consideration of various applications and are limited in their use in ways that are not considered in design phase. These problems are from the fact that existing kits were designed for Arduino itself. The kit for programming education should be considered as a tool.

ASTESJ ISSN: 2415-6698
In this paper, the design of a modular Arduino-compatible kit, called as FRUTO, is proposed to overcome the problems mentioned, and its structure and features are shown that implement the proposed design. On the hardware side, the connection between modules is made easy and intuitive with a unified connector, while on the software side, the code for controlling modules uses common abstract functions to facilitate easy programming, which results in improved usability. The proposed design also improved scalability by allowing anyone to produce hardware and software modules using the proposed design. As a result, improved usability and scalability make the FRUTO kit a learning tool for students of various levels. The proposed design was recognized for its differentiation through patent registration [14][15], and the FRUTO kit that implements the design is undergoing a pre-launch test.
In the next section, Arduino-compatible kits used in programming education and their limitations are presented. Section 3 is devoted to propose a new kit design that solves the problems of existing kits, and section 4 describes the FRUTO kit that meets the proposed design. Conclusions and directions for further improvements are discussed in section 5.

Programming Education using Arduino
As a leading physical computing platform, Arduino has been widely used for programming education as well as physical computing. In particular, Arduino is drawing attention as an alternative to overcome the limitations of the traditional programming education, as it places importance on the process of 'thinking by hand' through the prototyping process [16]. The use of Arduino for physical computing and programming education comes from the fact that it is highly accessible and usable as it is designed as a platform for artists and designers. The fact that Arduino is suitable for project-based learning (PBL) is another reason why Arduino is used as a tool for programming education. PBL has advantages such as getting structured and integrated knowledge for problem-solving beyond fragmentary knowledge and fostering active attitudes and confidence by searching for the knowledge required in problem-solving. The usefulness of PBL using Arduino in engineering subjects as well as programming education has been demonstrated in various case studies [17][18][19].

Problems with Existing Kits in Hardware
There are several Arduino-compatible kits used for programming education, which can be divided into three groups: (1) Arduino kit using the original Arduino board, (2) Arduinocompatible all-in-one board with built-in I/O devices, (3) Arduinocompatible kit with modular I/O devices and a unified connector.
The fundamental problem in using the original Arduino board as an educational tool is that students need to understand hardware. Since most I/O devices use different numbers of I/O pins and different data exchange methods, it is necessary to understand the hardware specification of each I/O device to obtain the desired operation. One way to solve the hardware dependency is to use an all-in-one board that contains all the necessary I/O devices as shown in Fig. 1-(b). All-in-one boards do not require a deep understanding of hardware, which can be seen as an advantage. On the other hand, it is difficult to use in ways that are not considered in the design, that is, it is poor in scalability. Moreover, programming education using an all-in-one board is almost the same with the conventional computer-only education. The modular kit in Fig. 1-(c) uses a unified connector to make the connection easy. However, only simple I/O devices can be made in modules, and the position where the module can be connected to the main module is fixed. In addition, the control method varies from module to module in spite of the unified connector.  Table 1 summarizes the evaluation of existing kits based on the number of available I/O devices (Diversity), the degree of easy connection (Connectivity), and the degree of hardware-related knowledge required (Independency). Of the three types, modular kits can be used reasonably in all respects. However, modularity in software is not considered and hardware modularity is limited to some simple I/O devices. Therefore, there is a need for a new design that all modules can be connected easily and intuitively using a unified connector.

Problems with Existing Kits in Software
Two programming tools are mostly used to make programs for existing kits: Arduino and Scratch. Arduino uses C/C++ language to write a program, while scratch uses drag-and-drop blocks to build a program visually. It is not easy, however, to make complex code with the blocks given and the assembled blocks should be converted to C/C++ code before compilation. Therefore, only C/C++ language under Arduino environment is considered in this paper.
Writing a program using C/C++ language under Arduino environment also has a similar problem with that on the hardware side. Since different I/O devices have different I/O control methods, it is also necessary to understand hardware to write the code for a specific I/O device. Most existing kits are based on Arduino environment. The Arduino library already provides an abstraction of low-level functions for AVR microcontrollers in Arduino boards, which makes it possible for different AVR microcontrollers to control a specific I/O device in the same way. That is, Arduino provides a microcontroller-independent library. However, as I/O devices are still controlled in different ways, the Arduino library is still hardware-dependent. Therefore, it is necessary to ensure hardware independence through a library that can control I/O devices with common abstract functions. This library should be based on the Arduino library for compatibility with Arduino.

Requirements
The most important problem to be solved in a new design is the dependence on hardware. Most of the existing kits are for learning Arduino, not for learning programming or physical computing. As a kit for programming education should reduce hardware dependency as much as possible, the kit design proposed here has the following goals: • a modular kit with easy and intuitive connection using a unified connector • hardware-independent abstract functions to exchange data between modules • scalability by adding third party or DIY(Do It Yourself) modules and corresponding libraries • applicability in various microcontroller-related education To achieve these goals, the followings are applied to the design.
• There are two kinds of modules: main module and expansion module with an I/O device.
• The Modules form a cascading connection with I2C(Inter-Integrated Circuit).
• The main module is compatible with Arduino and has one dedicated I2C connector for connecting an expansion module.
• Each expansion module includes a microcontroller that controls the I/O device and communicates with the main module.
• The microcontroller in each expansion module is one of the microcontrollers used in Arduino boards for compatibility.
• The expansion module has two dedicated I2C connectors to support cascading connection.
• The program for the main module consists of the code for I2C communication and system logic for overall system control.
• The program for the expansion module consists of the code for I2C communication and the code for I/O device control.
• Hardware-dependent code for I2C communication and I/O device control is provided through a dedicated library.
• I2C communication code in the main module uses common abstract functions in the library across all expansion modules.
• The dedicated library is based on the Arduino library to maintain the compatibility with Arduino.
• The module design is based on the published Arduino design and the proposed design is also open source.
• The dedicated library is also open source.
The core of this design and implementation is in the modularization of hardware and software. Hardware modularization enables easy and intuitive connection and software modularization allows students to focus on hardware-independent system logic.
All modules are compatible with Arduino, so the kit can be used in a variety of configurations, such as main and expansion modules together, main module only, and expansion module only. These configurations can be selected according to the student's prior knowledge of hardware and software, and used in various microcontroller-related education.

Hardware Design
The key in the proposed design is to enable cascading connection using a unified connector. In order to enable cascading connection, a communication method that can share a serial connection line and a dedicated controller for communication are required. There are many ways to share the serial connection line, and one of them is I2C communication [20], which is supported by Arduino by default. I2C communication allows cascading connection with four lines. In I2C communication, the main module acts as a master and the expansion modules act as slaves. Fig. 3 shows an example of module cascading using I2C connection.
The controller in the expansion module is responsible for controlling I/O devices as well as I2C communication. The proposed design adopts ATmega328 as the microcontroller for all modules to maintain compatibility with Arduino UNO. Fig. 4 shows the basic configuration of the main and expansion module in the proposed design. The main module has one I2C connector as a starting point, and the expansion module has two I2C connectors to support cascading connection.

Software Design
In the proposed design, the library is also modular. The Arduino library is an abstraction of low-level microcontroller functions. However, the Arduino library is hardware dependent as it requires the understanding of I/O devices connected to an Arduino board. Therefore, the proposed design reduces hardware dependency by separating hardware-dependent and hardwareindependent code.
Consider a system that uses a main module, a button module, and an LED module to represent button states to LEDs. In this configuration, three ATmega328s are used, and three programs for each ATmega328 are required. The button module requires a program to read the status of the buttons and send it to the main module through I2C communication, while the LED module requires a program to represent the data received from the main module to LEDs. That is, the program for the expansion module includes hardware-dependent code for controlling I/O devices and I2C communication. On the other hand, the program for the main module contains the code for I2C communication with the expansion modules and the hardware-independent code for controlling the overall system, called system logic. The emphasis in programming education should be on hardware-independent system logic.
In the proposed design, the library consists of a main (or master) library and expansion (or slave) libraries. The expansion library has I2C communication and I/O device control functions, and is pre-installed in the expansion module. The main library, on the other hand, provides common abstract functions for exchanging data through I2C communication with expansion modules. The main library is compiled with system logic and installed in the main module.  Fig. 5, each library contains hardware-dependent code, and system logic is hardware-independent code that is the only one students must write. Hardware-independent system logic allows students to develop logical thinking and problem-solving skills that are the goal of programming education.

FRUTO Kit
The FRUTO kit is a kit that satisfies the guide and consists of the FRUTO modules corresponding to hardware and the FRUTO library corresponding to software.

FRUTO Module
The FRUTO module can be a main module or an expansion module, and ATmega328 is used as the controller for each module. The main module follows the published design of Arduino UNO and has an additional I2C connector for cascading connection. On the other hand, an expansion module is composed of an expansion controller, I/O devices, and I2C connectors. Fig. 6 shows the circuit diagram of an LED module. Unlike the main module, the expansion controller uses minimal circuit in the Arduino UNO design. Therefore the expansion module cannot fully operate as an Arduino UNO compatible board. However, in most cases, the expansion module uses the pre-installed program, and a custom program can be installed with an external programmer.
The modules are connected directly to each other by default, but a dedicated cable and a distribution module is also included in the FRUTO kit to enable flexible connection. Fig. 7 shows an example of connecting 4 modules using a distribution module and a dedicated cable.

FRUTO Library
As shown in Fig. 5 the programs needed for the FRUTO kit are a library for a master, libraries for slaves, and a main Arduino sketch. The master and slave libraries are provided as part of the FRUTO library, and students only need to make a master sketch for a main module. Fig. 8 shows a blink sketch that blinks the LEDs on the LED module at 1-second intervals.  The master library in Fig. 9 and 10 is a library defined differently according to each expansion module. Whereas the operations common to all modules are defined in the system library. Typical common operations included are to initiate I2C communication and to initialize each expansion module. Data sent to the expansion module using the master library is received and processed by the LED module. Fig. 13 and 14 show the slave library for an LED module, which receives one byte data and controls 8 LEDs accordingly. Since the slave library is the same as the sketch for Arduino, it is also possible to learn Arduino through the slave library. This can also be seen from the fact that the slave library has an INO extension. Although the types of code presented seem diverse and complex, students can start by writing a main Arduino sketch for programming education. Table 2 summarizes the functions and features of each code.

FRUTO Kit
The FRUTO kit consists of modular hardware compatible with Arduino UNO and the FRUTO library for programming support. The biggest advantage of the FRUTO kit in hardware is that it is easy to add I/O devices. The hardware configuration is completed by simply connecting the module having the I/O devices required through a unified 4-pin connector. Observations of the course using the FRUTO kit showed that the time required for hardware configuration was less than one third compared to the course using other Arduino-compatible kit. The rest of the time could be spent on conceptual descriptions of the hardware and how it works.
The biggest advantage of the FRUTO kit in software is that the hardware-dependent code is provided as a library. Low-level hardware control tasks are handled in each expansion module, which allows students to build and test a system by writing only hardware-independent code for a main module. The hardwareindependent code can be made in the same manner with the original sketch except that there is no hardware-controlling code. The length of the code required when using the FRUTO library is about 1/2 when controlling simple I/O device such as an LED module, and about 1/4 when controlling a complex I/O device such as an LED matrix module compared to the code using the Arduino library. Overall, it was less than one third. The rest of the time can be used to develop the logical procedures of the system.
In addition to simplifying hardware connection and programming, one of the advantages of the FRUTO kit is that it can be used as an educational tool for students of various levels. Table 3 shows an example of how to use the FRUTO kit depending on the students' level. For beginners, the biggest advantage is that it allows them to easily configure a system and write a program for it with minimal hardware knowledge. Intermediates can use the expansion modules and Arduino environment to learn Arduino and/or microcontrollers. Module DIY allows advanced students to design and implement an Arduino-compatible kit.

Conclusion
As the importance of programming education is being emphasized more than ever, the demand for an appropriate learning tool is also increasing. In addition, research findings that using Arduino can improve problem-solving and team-level collaboration, have led to various attempts to use Arduino for programming education. However, existing Arduino-compatible tools are limited in their use because of their hardware dependency. In this paper, the design of a modular Arduino-compatible kit, termed as FRUTO, that minimizes hardware dependency has been proposed, and its configuration and features are examined that implemented the proposed design. The FRUTO kit is easy to connect and program, and expandable in many directions, which makes it a versatile learning tool.
Currently, the FRUTO kit has 10 expansion modules and is undergoing a pre-launch test in programming and microcontrollerrelated education. Although the FRUTO kit satisfies the design guide, developing a Scratch-like block programming tool is expected to increase the number of users. Securing compatibility with existing learning tools like Lego is also expected to contribute to user growth. The feedback collected during the test including the ones mentioned above might be incorporated into future modifications and revisions.