Are you a fan of programming? Does your child enjoy the creative world of building blocks? Well, we've got an exciting fusion for you. We're bringing together programming and building blocks to create an engaging learning experience. It's a fantastic way for your child to explore critical thinking, unleash their creativity, and dive into the exciting realm of programming.
Why programming and Building Blocks?Programming Delight: If you're passionate about coding or want to introduce your child to the wonders of programming, This is the perfect platform.It's a playground for creating digital magic, and it's easier than you might think.
Building Block Brilliance: Building blocks have been a cherished childhood pastime for generations. They foster imagination, spatial awareness, and fine motor skills. Plus, they're just plain fun!
The Perfect Pair: When you combine the power of program with the creativity of building blocks, something magical happens. Your child gets to tinker, experiment, and see their ideas come to life.
What Can You Expect?Learning Through Play: Our programming and building block combo isn't just about education; it's about having a blast while learning. It's a hands-on experience that turns lessons into playtime.
Creativity Unleashed: Watch as your child's imagination soars. They'll design, build, and code their own creations, gaining confidence and problem-solving skills along the way.
Parent-Child Bonding: Get in on the action! Join your child in this adventure of discovery. You'll share quality time while learning and growing together.
The Future of Fun: Programming and building blocks are a dynamic duo that bridges the gap between play and education. It's a sneak peek into the exciting world of technology and innovation.
So, whether you're a programming enthusiast or your child can't get enough of building blocks, this fusion of learning and fun is bound to bring joy and inspiration to your lives. Get ready for a perfect playtime that sparks curiosity and unlocks the potential for a future filled with creativity and innovation!
Building a buliding block Line Tracking Robot CarWelcome to the exciting world of robotics! In this project, we will delve into the creation of a Line Tracking Robot Car using two IR tracking sensors. As the name suggests, a Line Tracking Robot is a self-driving vehicle that follows a black track line printed on a white surface. The tracking sensors on the robot continuously check if the car deviates from the track. If it does, the car makes adjustments to get back on the right path.
Before You Begin: Gathering the Necessary PartsTo complete this project, make sure you have the following components ready:
Note:- The color of the building blocks may vary from the actual product, but this doesn't affect their functionality.
- ALL OSOYOO PRODUCTS FOR ARDUINO ARE THIRD-PARTY BOARDS THAT ARE FULLY COMPATIBLE WITH ARDUINO.
Before building the robot with blocks, install the OSOYOO basic board for Arduino under the OSOYOO Magic I/O shield. Ensure that the pins of the I/O shield align with the ports of the basic board, and then firmly press the shield onto the board.
For detailed building steps, please download the clear PDF building guide from here.
Note: If you have already built the robot car from lesson 1, you can skip to step 35 in the PDF.
Connect the motors and the 9V battery case as you did in lesson 1. Then connect the left tracking sensor to D2 of the Magic I/O shield and the right sensor to the D13 port using 3-pin PNP cables. Pay attention to the six jumper caps on ENA/ENB/IN1/IN2/IN3/IN4.
We'll be using mBlock as the programming tool for this project. Follow these steps to set it up:
Step 1: Download the mBlock PC version from here. Choose the download file according to your computer's operating system (don't use the browser version).
Step 2: Download the OSOYOO_UNO.mext device file from here.
Step 3: Run the mBlock PC software by double-clicking the panda icon. You'll see the Block UI. Delete the default device "CyberPi" by clicking the cross in the red circle.
Step 4: Drag and drop the osoyoo_uno_mext file (downloaded in Step 2) into the mBlock software.
Now you'll have a new device firmware in mBlock.
We'll use Blockly coding to program your robot car. Here are the steps:
Step 5: Click on "Events, " then add the "when Arduino UNO starts up" block to the top.
Step 6: Click on "Control" and drag and drop the "Forever" block into the programming area.
Step 7: Within the "Forever" loop, add an "If Else" block. Inside the "Else" area of the first "If Else" block, add another "If Else" block.
Step 8: Click on "Sensor" and add two "IR Tracking Sensor Pin 2" blocks inside the "If" condition area. Change the 2nd pin from 2 to 13.
Step 9: In the "Action" category, add three "Backward Left Speed 100 Right Speed 100" blocks inside the "If Else" blocks. Change the first "Right Speed" from 100 to 0 and the 2nd "Left Speed" from 100 to 0.
Step 10: Upload the program to your OSOYOO basic board. Here's how:
- Connect your OSOYOO basic board to your PC using a USB cable.
- Click the "Connect" button at the bottom of the mBlock software. A USB window will pop up.
- Check the "Show all connectable devices" checkbox, and a device drop-down menu will appear.
- Select your port from the device drop-down menu.
- Click the "Connect" button to establish the connection between your PC and OSOYOO basic board.
- After the connection is established, click the "Upload" button at the bottom of your software. The code will be uploaded to your OSOYOO basic board.
In Lesson 1, we learned about the Yellow Event Program block and some Blue Action blocks. In this lesson, we'll explore new program blocks from the Control category:
This block is like a crocodile head with blocks inside its mouth. The blocks inside are executed sequentially, and after the last one, it loops back to the first and repeats the process.
This hexagonal block returns a True or False value to Control blocks. It reads the tracking sensor in D2 pin (left sensor). If the sensor detects black, it returns TRUE; if it detects white, it returns False.
This block has two branches and a condition block at the top. If the condition block returns True, it executes the blocks inside the "if" branch; if it returns False, it executes the blocks inside the "else" branch.
This block can control the left and right wheel speeds independently. In the example, the left speed is set to 0, and the right speed is set to 100, making the car turn left.
The Blockly program runs as a forever loop, meaning it keeps running unless you turn off the power. Here's how it works:
- The program first checks the left sensor (D2 pin) to see if it detects a black line. If yes, the car makes a left turn.
- If the left sensor detects white, it checks the right sensor (D13). If the right sensor returns True, it means the black line is on the right side, and the car makes a right turn.
- If both sensors don't detect a black line, it means the black line is in the middle, and the car moves forward.
Disconnect the Arduino from your PC and insert a 9V battery into the battery box (ensure the polarity is correct to prevent damage or fire hazards).
Adjust Tracking Sensor Sensitivity:
- Turn on the car and hold it. Adjust the sensitivity screw on the tracking sensor with a screwdriver until you achieve the best sensitivity status: the signal indicator LED will turn on when the sensor is above a white surface and turn off when it's above a black track.
Prepare a black track on a white surface. The width of the black track should be between 30 mm and 60 mm. Avoid sharp turns (greater than 90 degrees) in the track, as this can cause the car to move off the track.
Turn on the car and position the middle of the tracking sensor module over the black track. Your car should now follow the black track autonomously!
Enjoy your journey into the world of robotics with your Line Tracking Robot Car!
Comments
Please log in or sign up to comment.