In the digital era, information security and personal privacy protection have become crucial issues that we cannot ignore. Whether it's precious data or unique creative works, they all require a secure and reliable storage environment. Therefore, developing a password box project not only meets our basic needs for secure storage but also poses a challenge to our technological exploration and practical abilities.
In this project, we will use the micro:bit, NeurOne Module, 9g metal gear micro servo, and push button module to learn how to write programs to achieve password verification and unlocking functions. By building this password box yourself, you will experience the transformation from theory to practice and, when faced with technical challenges, exercise your innovative thinking and hands-on abilities, ultimately creating a password box that is both practical and secure. This project is not only a workout for your personal abilities but also a significant contribution to information security and personal privacy protection.
Learning Objectives
1.Understand the usage of NeurOne Modules.
2.Recognize the role of neural networks in machine learning.
3.Acknowledge the limitations of NeurOne Modules, thereby comprehending the significance of neural networks.
Preparation
Learning Content
1.Artificial Neural Network
Artificial Neural Network (ANN), abbreviated as Neural Network (Neural NN) or Neural-like Network, is a mathematical or computational model in the fields of machine learning and cognitive science that mimics the structure and function of biological neural networks (the central nervous system of animals, particularly the brain). It is used to estimate or approximate functions. Neural networks perform computations by interconnecting a large number of artificial neurons. In most cases, artificial neural networks can alter their internal structure based on external information, making them adaptive systems-informally speaking, they possess learning capabilities. Modern neural networks serve as a tool for nonlinear statistical data modeling. Neural networks are typically optimized through a learning method based on mathematical statistics, thus representing a practical application of mathematical statistical methods. Through standard mathematical methods in statistics, we can obtain a vast local structural space that can be expressed using functions. On the other hand, in the field of artificial perception within artificial intelligence, we apply mathematical statistics to address decision-making problems in artificial perception (that is, through statistical methods, artificial neural networks can possess simple decision-making and judgment abilities similar to humans). This approach offers advantages over formal logical reasoning and calculation.
Like other machine learning methods, neural networks have been used to address a wide variety of problems, such as machine vision and speech recognition. These problems are often difficult to solve with traditional rule-based programming.
2.Getting Acquainted with the NeurOne Module
The NeurOne Module is a functional module through which we can study and understand the foundation of artificial intelligence-machine learning. This functional module simulates the most basic unit in neural networks: the neuron. A neuron, also known as a neure, is the basic structural and functional unit of the nervous system. In humans, neurons have the functions of receiving, integrating, and transmitting information. Similarly, the NeurOne Module we use serves as a basic node in artificial intelligence neural networks, analogous to human neurons. Through the processing of the NeurOne Module, the timing and precision of pressing and releasing buttons can be controlled, thereby achieving the goals of "training" and "adjustment" in machine learning.
After connecting sensors, such as digital and analog sensors like button switches, light intensity sensors, and sound sensors, to the input interface on the left side of the NeurOne Module, pressing and holding the learning button on the module allows it to learn the incoming electrical signals, with the learning indicator light turning on simultaneously. During the entire learning process, the NeurOne Module records the signal intensity and pattern. After the learning process is completed, release the learning button. When the input interface of the NeurOne Module receives the same electrical signal intensity and pattern as during the learning process, the signal line of the output interface will output a high-level signal. Different devices can utilize this voltage signal to achieve the desired functionality. The matching accuracy can be adjusted via the accuracy adjustment knob.
3.Operation Demonstration of the NeurOne Module
Connect the Push Button Module to the input port of the NeurOne Module, and link the output port of the NeurOne Module to the P0 pin of the Micro:bit BOSON Expansion Board, as illustrated in the diagram below. Once the modules are successfully connected, power the expansion board using a USB cable.
To set a password
press and hold the learning button on the NeurOne Module until the learning indicator light (blue light) turns on. At this point, you can set the password using the Push Button Module. Here, we will use pressing the button three times as an example. After the password is set, release the learning button. The white indicator light on the output port will turn on, indicating that the password has been successfully set.
Password Verification
The password we set is to press the button three times. Now let's try it out. Press the button three times consecutively and observe any changes in the indicator light at the output port. After pressing the button for the third time, if the indicator light at the output port turns white, it indicates that the password verification is successful.
Project Practice
This project combines the basic working principle of the NeurOne Module to design a simple yet fully functional password-controlled locking system. The system can receive input signals, process them through the NeurOne Module to determine if the entered password is correct, and if correct, simulate the unlocking process by controlling the rotation of a servo.
Task 1: Obtain Input Values from the NeurOne Module
After successfully entering the password, display the input values from the NeurOne Module on the LED matrix display of the micro:bit.
Task 2: Implement Password-Controlled Locking Functionality
If the entered password is correct, control the servo to rotate to 90 degrees (simulating unlocking), wait for 5 seconds, and then rotate the servo to 10 degrees (simulating automatic locking).
Task 1: Obtain Input Values from the NeurOne Module
Hardware connection
Program Design
Function instruction
Obtain the digital value of the P0 pin. When the password output is successful, a digital signal of 1 is input to the P0 pin; otherwise, a digital signal of 0 is input.
Flowchart Analysis
Load extension library
Create a new project and name it "Make a NeurOne Safe". Click on "Create" to complete the project setup.
Click on "Extensions", then type "boson" in the search bar and search for it. Find "DFRbot_bosonKit" and click on it to complete the addition.
Sample program
Operating Effect
Before entering the password, the micro:bit's LED matrix display shows the number 0. When we enter the correct password (by pressing the button three times consecutively), the output indicator light turns on, and the micro:bit's LED matrix display shows the number 1.
Task 2: Implement Password-Controlled Locking Functionality
Hardware connection
Program Design
Function instruction
At the beginning, set the servo's initialization angle to 10 degrees (default locked state). After entering the correct password, set the servo's angle to 90 degrees (simulating the unlocked state). After successful unlocking, wait for 5 seconds, and then set the servo to 10 degrees (simulating automatic locking).
Flowchart Analysis
Sample program
Operating Effect
After pressing the button three consecutive times and entering the correct password, the servo rotates to 90 degrees (unlocking), waits for 5 seconds, and then rotates back to 10 degrees (locking).
Shape Construction
We have successfully completed the hardware connection and programming stages of the password-protected box. To further enhance the project's visual appeal and attractiveness, we plan to construct a physical password-protected box using a wooden cutting board, with the design of the box as shown in the figure below.
Assembly Steps for the Box: For detailed assembly instructions, click to view the assembly video.
Hardware Installation Steps: For detailed installation instructions, click to view the installation video.
Finished Product Demonstration Video: For a detailed demonstration of the effect, click to view the demonstration video.