3.2.1
MOVE Motor Car Construction
MOVE Motor Car Construction
Did you know that first auto race in the U.S. took place in Chicago in 1895...in a blizzard and where two electric vehicles were competing? Or, that before the Chicago Bears moved there, soldier field was a race track?
You're not going to race a car quite yet but in this activity you are going to build car that we will use with our controller in the next activity.
What to expect
Electric vehicles are becoming increasingly popular because they are less polluting than vehicles powered by gas engines. Most auto manufacturers now sell vehicles that are fully electric. You have probably seen some of them, like Tesla, Rivian, Ford Mustang and F-150 Lightning, Chevy Silverado EV and Equinox EV, Hyundai Ioniq, Volkswagen ID.4, and many others. This week we will be building a small model electric vehicle from the Kitronik :MOVE motor car kit. We will also be programming it to do basic functions.
Connections
In the past several weeks we used our micro:bit to control stoplights and a game controller. For this activity we are going to use the micro:bit to control a model car. In the next several weeks, we will gradually increase the capabilities of what your car can do.
Materials
Kitronik MOVE motor car kit (work in groups of 2)
Two M2 x 10mm screws
Micro:bit
Micro:bit USB connection cable
4 AA batteries
Sharpie marker and several pieces of paper (optional)
Instructions
There are three parts to this activity. In Part 1, we will build the car. In Part 2, we will program the micro:bit to drive the car forward and turn. In Part 3 (optional), we will add a marker to the car, allowing the car to draw on a piece of paper.
Part 1: Build the :MOVE motor car
First, take the pieces out of the box and lay them out in front of you. There should be seven pieces: the body, two plastic wheels, two rubber tires, and two small electronics boards (line follower board and ultrasonic distance sensing board).
2. Flip the car body upside-down and add the line follower electronics board to the car body. The bottom side of the car is the side with the battery holders. The line follower board is the smallest electronics board in the kit. Make sure that the “FWD” arrow on the board is pointing towards the front of the car (hint: the front has the Kitronik logo, while the rear has the buzzer.) Gently press the prongs of the line follower board straight down into the receptacles on the bottom of the car body.
3. Next flip the car right-side-up and add the wheels. Press the rubber tires onto the wheels, and then press a wheel onto the axle protruding from each motor. Note that both the axle and the center of the wheel are rectangular shapes, so be careful of the orientation when you are pressing them on. The rectangle shape will prevent the wheel from slipping on the axle.
4. Screw the wheels onto the axles using two M2 x 10mm screws. These will prevent the wheels from falling off.
5. Next add the ultrasonic distance sensor board to your car. The ultrasonic sensor board has two small cylinders: one to transmit an ultrasonic (i.e. high-frequency) signal, and the other to receive the signal after it bounces off an object in front of it. This is how the car will be able to detect an obstacle in front of it. Make sure the sensors are facing forward (away from the motors) and gently press the prongs of the ultrasonic distance sensor board into the receptacles at the front of the car body.
6. Insert four AA batteries on the bottom side of the car. Be careful to insert the + and - sides of the batteries as indicated on the battery holders.
7. Lastly, slide a micro:bit into the slot between the motors and the ultrasonic sensors. Make sure to insert the micro:bit so that the side with the A and B buttons and LED lights is facing forward. Otherwise it will not work. Your car is ready to move!
Part 2: Program the micro:bit
Now we are ready to program the car’s micro:bit. The micro:bit will tell the motors when to rotate the car’s wheels. To begin, we will program the micro:bit so that when you push Button A, the car will move forward for 1 second, turn left, then move forward 1 second.
Go to https://makecode.microbit.org/ and create a new project. Name your new project “Move Motor Basic”.
2. We need to add some special programming commands for the Move Motor car. To do that, we need to add an Extension to the MakeCode menus. Click on “Extensions” in the middle of the screen.
3. Use the Search bar to search for “Move Motor”, then click on the tile to add it.
4. Now you should see the “MOVE Motor” menu in your MakeCode screen.
5. Add the following code. Blocks colored purple are from the “Input” menu, blocks colored green are from the “MOVE Motor” menu, and blocks colored blue are from the “Basic” menu. This code will cause the car to move forward for 1 second at 50% speed, turn left at 30% speed, then move forward for 1 second at 50% speed.
Part 3 (optional): Add a Sharpie marker
You may have already noticed that there is a hole in the middle of the car’s body labeled “PEN”. This hole is the perfect size for a Sharpie marker. Remove the marker cap, push the pen into the hole, and make sure there is plenty of paper in front of the car. Press Button A and watch it go. Can you change the micro:bit code to make it write something?
Link to code: https://makecode.microbit.org/_bq21f6eqfH7Y
Download the code to your micro:bit, then insert it into the micro:bit slot, making sure that the side with the buttons and LED lights is facing forward.
At the back of your car, slide the power switch to “ON”.
Set your car on the floor and press Button A. It should go! If it doesn’t, check the following: Are batteries installed correctly? Is the power turned on? Are the micro:bit buttons facing forward? Check your code, and re-download it to the micro:bit.
Try modifying your micro:bit code to make the car perform different maneuvers. Can you make it go in a square? Around an obstacle?
Wrap up:
In this activity we learned basic MOVE motor code to make the car move forward and turn. In future activities, we will add more advanced capabilities to the car, like line-following and autonomous driving. But in the next activity, we will convert this car into a remote control car.
What was the most complicated path that you programmed your car to take?
Did your car move how you wanted it to?
What shape did your car draw with the Sharpie marker?
Next time:
Next time, we will use the game controller to convert the car into a remote control car.