2 Related Work
2.1 The Impact of Blockchain Technology on Education
2.2 Incorporating Scratch into Tinker Learning for Computational Thinking
2.3 Using Polygon SDK for JavaScript to Interact with a Smart Contract
2.4 Challenges in Blockchain Education and the Need for User-friendly Tools
Our paper demonstrates the use of BlocklyDuino to control an Arduino board and obtain sensor data, with the primary challenge being to synchronize this data onto the blockchain. In response, we propose an example that uses a combination of Blockly, BlocklyDuino, Polygon SDK, and an Arduino board to create an IoT project that interacts with the blockchain. First, a smart contract is built on the Polygon blockchain, which can be accomplished using Remix or another development environment. Next, the Polygon SDK connects to the smart contract from our JavaScript code, requiring establishing a provider and a contract instance. Blockly is then employed to create a visual programming interface for our IoT device, using built-in or custom blocks to interface with sensors and other hardware. BlocklyDuino is subsequently utilized to generate the necessary Arduino code based on the blocks created in Blockly, which is then uploaded to the Arduino board. Our JavaScript code uses the Polygon SDK to send data to the smart contract whenever our IoT device collects new data, which is then stored on the blockchain for analysis or other purposes. Additionally, the Polygon
The file is as follows:
SDK can read data from the smart contract and display it in our JavaScript code or Blockly interface. Following these steps, we can develop an IoT project that interacts with the blockchain using a visual programming interface.
This is our smart contract https://goerli.etherscan.io/address/ 0xf4910c763ed4e47a585e2d34baa9a4b611ae448c. Our NFT is https: //testnets.opensea.io/collection/untitled-collection-6860424. In conclusion, we have successfully uploaded the data collected by the sensors on the Arduino board to the Polygon testnet by following the abovementioned steps. Our experimental setup involved a plant irrigation system, where the continuously changing data related to each observed plant was updated in the metadata of an NFT that represents that plant. This project demonstrates the potential of using blockchain technology in IoT and agriculture, where tracking and managing data related to crops and farming practices is essential. Using visual programming interfaces like Blockly and BlocklyDuino, we hope to inspire more young learners to explore the possibilities of blockchain and IoT and to create innovative solutions for real-world problems. By storing irrigation records in NFTs, the sensor data, time, weather information, temperature, humidity, and crop log can be automatically updated in the attributes of the NFTs regularly. This allows students to directly experience realtime data aggregation without manual record-keeping, achieving traceability of plant growth in blockchain-based resumes. This is just a demonstration of how blockchain can be used for traceability. Blockchain technology can be used for a wide range of applications beyond resumes. By lowering the threshold for students to interact with smart contracts, they can explore the new world of blockchain economics, creating and exchanging value through innovative digital data chaining in the blockchain.
Authors:
(1) Yun-Cheng Tsai, National Taiwan Normal University, Taipei, Taiwan ([email protected]);
(2) Jiun-Yu Huang, Small Town Intelligence Co., Ltd, Taiwan ([email protected]);
(3) Da-Ru Chiou, Taitung Tung Hai Junior High School, Taiwan ([email protected]).
This paper is