Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 154 - 2615_KEC
P. 154

    HANDS-ON PROJECT

                      PROJECT NAME: Building a Bluetooth-Controlled 4-Wheel Car with Micro:bit
                      Objective: Students will build a 4-wheel car using a readymade chassis, a Micro:bit, Bluetooth,
                      servo motors and a GPIO board. They will use Bluetooth commands to control the car’s movement.

                      Materials Required:

                         ∑  Micro:bit (with inbuilt Bluetooth)
                         ∑  Continuous servo motors (4)

                         ∑  GPIO board
                         ∑  Breadboard

                         ∑  Jumper wires

                         ∑  Readymade chassis (to mount the motors and wheels)
                         ∑  Mobile device with Bluetooth capability

                         ∑  Micro:bit extension for Bluetooth

                      Step-By-Step Instructions:

                      1.  Assemble the 4-Wheel Car with Readymade Chassis:
                              Begin by assembling the 4-wheel car using the readymade chassis.

                              Attach the 4 continuous servo motors (2 for the front wheels and 2 for the back wheels) to
                              the chassis.
                              Mount the wheels to the servo motors and ensure they rotate freely.

                      2.  Set-up Micro:bit with Bluetooth:

                              Open the MakeCode Editor for Micro:bit and create a new project.
                              From the Extensions menu, add the Bluetooth extension to your project.

                      3.  Writing the Code:

                              Initialize Bluetooth:
                              o    Use the bluetooth uart service block to initiate Bluetooth communication when the
                                   program starts.

                              Code Blocks Explanation:

                              o   On Bluetooth  Connected:  Display  ‘C’  on the  Micro:bit  screen  when the  Bluetooth
                                  connects.
                              o  On Bluetooth Disconnected: Display ‘D’ when Bluetooth is disconnected.

                              Receiving Bluetooth Data:
                              o   Use the on data received block to capture data from the mobile device and store it in
                                  a variable called DATA.

                      152   Premium Edition-VI

| 149 150 151 152 153 154 155 156 157 158 159 |