#How to Make an AI Robot Recognize the Weather
In today's technological era, Artificial Intelligence (AI) is increasingly influential, especially in weather forecasting. Creating your own AI assistant for forecasting weather conditions offers valuable learning experiences for both kids and educators.By programming a robot to identify the date, weather, temperature, and humidity, children can ignite their interest in coding while teachers gain a fresh, innovative teaching tool.
This #HowTo guide will empower you to utilize your programming skills to develop an AI assistant that can accurately forecast weather in your surroundings.
How to get kids to learn science by forecasting weather
·Observation and Measurement: With the AI assistant providing forecast weather data, children can venture outside or stay indoors to observe weather phenomena. They can utilize thermometers and hygrometers to accurately measure temperature and humidity, enhancing their understanding of weather dynamics.
·Exploring Weather Phenomena: Discuss the influence of temperature and humidity on forecast weather, enabling children to learn about fundamental principles of weather prediction while developing scientific reasoning and observational skills.
·Participation in Science Projects: Encourage children to engage in science projects that focus on forecast weather and climate research, promoting teamwork and inspiring curiosity about the natural world.
Enhancing Learning with AI: mBot2's By Asking Feature for Interactive Education
• In the field of artificial intelligence (AI), the concept of "by asking" typically refers to a way of interacting and controlling through verbal inquiries or questions. It mainly involves using natural language processing and internet connectivity to retrieve information and perform tasks, enhancing the interactive capabilities of robots and automated systems.
• How can we help children understand this concept using mBot2? We have created a related case study."When you ask mBot2 to forecast the weather, it can quickly answer by searching for information online."
• This feature not only demonstrates the application of AI in understanding and executing verbal commands but also helps children see how AI robots retrieve and utilize information from the internet to provide assistance. This showcases the integration of Internet of Things (IoT) technology.
How to write a weather forecasting program
Step1:Preparation
• An assembled mBot 2 cart.
• Type C cable*1
• A computer with internet access
After assembling the mBot 2, use the data cable to connect the mBot 2 to your computer, open the Wise Programming Tool (desktop, web, mobile), connect to the mBot 2, and switch to upload mode.
Step2:Programming
Substep 2.1: Connect To The Network
The first step in programming is to get the mBot2 connected to the network. This step is crucial because it allows the device to access Internet resources for real-time data processing and communication.
• First, drag a hat block from "Events" and place it on top of the other blocks to activate them.
• Next, take out the blocks for connecting to Wi-Fi from "IoT" and fill in the Wi-Fi name and password.
• Then we need to check whether the Wi-Fi connection is successful, and drag the wait condition from "Control".
• Drag the "network connected?" block from "Control" and put it into the waiting condition.
• Finally, drag the colored lights from "LED" as the condition for a successful Wi-Fi connection.
With the above steps, mBot2 will be able to connect to a Wi-Fi network. Next, we will program mBot2 to interact with us!
Substep 2.2: Write a speech recognition judgment program
With the above procedure of connecting to the network complete, we have taken the first step in programming. By connecting to the network, we have gained the ability to interact with the online world, which lays the foundation for our subsequent work. Next, we will work on programs for recognizing speech and recognizing weather.
By recognizing voice, our AI robot will be able to understand human commands and needs; and by recognizing weather, we can make the AI robot an intelligent forecasting weather expert, providing us with timely and accurate weather information.
• First, drag the "forever" block from "control".
• Then drag out the speech recognition block in "AI", change the language to English, and set the recognition time to 2 seconds.
• Then drag out the judgment condition block from "control".
• Put the speech recognition result block in "AI" into the inclusion condition block in "Operators", and fill in "weather" as the recognition condition.
• Finally, put the speech recognition result into the display label of "Display", and then put the display label block into the else condition.
After completing this step, when the machine fails to recognize "weather," it will display the speech it recognizes on the screen. We will be able to understand the reason why it was not recognized by the display.
Substep 2.3: Write a date recognition program
After completing the else step, we will write the program that will make the AI robot react to the recognition of "weather".
• Find the speak block in "AI" and drag it to the judgment condition block, then change the text to be read out to "Today's date is".
• Then drag the time block from "IoT" into the speak block, then click on "UTC", find the time zone of your city and select it, then select "week" for the time.
• After the robot tells the time, it has to display the obtained time on the screen by selecting the print and line feed block from "Display" and writing "Today's date is" in the text.
• Finally, put the time block into the printed and line feed block and the display will show the time of the day.
By this point, we've been able to get the AI bot to tell us the day's date by voice and display it on the screen. The next step is to write a weather recognition program.
Substep 2.4: Write the weather forecasting program
Before writing a weather forecasting program, let's get acquainted with the weather block.
• Click on "location" to enter your city and select it.
• The second option allows you to select weather information, including temperature, weather, and humidity.
Next, we will program using this block
• Same procedure as for the date program, replace the text with "weather", "temp", and "humidity".
• Change "location" to the city where you want to know the weather information.
• Then select the option at the back of the weather block that corresponds to the text of the previous block.
• Finally, write the text to the display block as before, and put the weather block into the "Display" block.
Substep 2.5: Supplementary text size and volume
Add the set text size and volume to the top program and the program is complete!
Now we'll be able to control the AI robot with our voice and have him forecast weather information and display it on the screen.
Full Program & Download
Click to download and let your robot forecast weather for you!