• Experiment 17 Remote control your micro:bit 40-42 • Experiment 18 Smart music box 43-44 • Experiment 19 Remote control fan 44-45 • Experiment 20 Car remote control 46-48 • Experiment 21 Pick up beans 48-51 Keep exploring 2020 ELECROW All Rights Reserved.
Affordable Easy The Elecrow Starter kit for Micro:bit is designed for people who are at the doorstep of learning electric modules and programming knowledge and bring numerous creative possibilities for you to dig out and help you enter a wonderful electronic world. This kit includes more than 20 modules like the buzzer, light sensor, servo, ultrasonic ranging sensor, and OLED, etc.
Get to know micro:bit Micro:bit is a pocket-sized computer that lets you get creative with digital technology. You can code, customize and control your micro:bit from anywhere! You can use your micro:bit for all sorts of unique creations, from robots to musical instruments, the possibilities are infinite. The micro:bit compatible with a number of online code editors across a number of different languages, such as Blocks, JavaScript, Python, Scratch, and etc.
Page 6
A/B Buttons: There are two buttons on the front of the micro:bit - button A and button B, you can detect when these buttons are pressed, allowing you to trigger code on the device. You can detect events such as a single press, a double press, and a long press by programming.
Page 7
Radio: The radio feature allows you Bluetooth: The Bluetooth Low Energy antenna communicate wirelessly allows the micro:bit to send and receive Bluetooth between two or more micro:bits. signals, you can wirelessly communicate between micro:bit and phones, PCs, or tablets. You need to pair your micro:bit with another device before using the Bluetooth antenna.
Page 8
The left part is a simulator, which will simulate the work of micro:bit after finishing the program. The middle part is our command area, there are various program blocks we need. The rightmost area is the script area, you can drag and drop instructions into this area to form your program.
Page 9
Step 2-4. Download the code Click the Download button in the editor, And then it will download a “hex” file that your micro:bit can read. Once the hex file has downloaded, copy it into your micro:bit like copying a file into a USB drive. Step 3.
Note: When you connect a high-power device, such as a motor, you need to connect a 12V power supply to the board. Crowtail – Modules We've made more than 100 kinds of electronic modules into Crowtail modules. They include a variety of sensors, displays, inputs and outputs modules, communication types include I2C, UART, digital or analog, which aim to provide more options to fully meet all needs for your electronic projects! All modules can be used by simply connecting them to the Crowtail- Base...
Page 12
Connect Crowtail-LED to P0 port of Crowtail-Base shield for Micro:bit. The hardware connections are as follows: Programming and note Forever: forever block is a block that loops any other command blocks inserted into it over and over again. It starts from the top and executes your code in order by working its way to the bottom and then starts from the top again.
Experiment 2 – Switch light Instruction Congratulations, you have mastered the method of controlling the LED on and off. But just like the lights at home, can we add a switch to control the lights on and off at any time? Of course, in this experiment, we will use our switch module to control the lights anytime and anywhere.
Programming and note Digital Read: Just like the way digital write block turns a pin on (1) or off (0), the digital read block check at the state of a pin, which is either HIGH (1) or LOW (0). In this case, we can detect if the switch is pressed or not by using this block.
Page 15
Target Learn how the buzzer work and use it to play songs. Learn how to run the code once at the beginning of the program. Required Parts Micro:bit x1 Crowtail-Cable x1 Crowtail-Base shield for Micro:bit x1 USB cable x1 Crowtail-Buzzer x1 Hardware learning and connection The buzzer module is used for making sound in your project.
On start: Different from forever block that loops your code forever, The On start block is a block of code that only runs once at the very beginning of your program. In this case, we use it to set the melody to play once. Download the program to micro:bit to see what happens.
Page 17
Connect Crowtail-Touch Sensor and Crowtail-Buzzer to P0 and P1 ports of Crowtail-Base shield for Micro:bit. The hardware connections are as follows: Programming and note Digital Write: Different from the last experiment, this time we will use digital write block to set the buzzer 1(on), which can make the buzzer make a big bee noise to prevent touching.
Experiment 5 – Collision check Instruction Do you know there is a collision sensor inside the car? It is used to detect collisions to make sure the car can open airbag immediately and alarming after the impact. In this experiment, let's make a collision detector to simply simulate the process of automobile collision detection.
Page 19
Programming and note If/else: The If/else block is a logical structure. If the logical statement that is attached to it (digital read P1 = 0) is true, then it will execute the code blocks inside of the if. If that statement is false, it will execute the else blocks.
Experiment 6 – Intelligent corridor lights Instruction You must have a lot of questions if pay attention to the various phenomena of daily life, such as corridor lights? How does it work? How did it automatically turn on the lights when we went up the stairs? With these questions in mind, let's start our sixth experiment: intelligent corridor lights.
Page 21
Programming and note Analog Read: Micro:bit uses an analog read block to read the value as a 10-digit number that ranges from 0 to 1023. The analog read block is a value based block, Which means that you have to insert it into a block with a matching shape. In this case, we use this value and compare it with the value( It indicates that the brightness is bright and we don’t need to turn on the LED when threshold we set is larger than this value;...
Experiment 7 – Plant soil moisture detection Instruction People need water to survive, so do plants. Soil moisture indicates the moisture in the soil. As long as the soil moisture value is suitable for the plant, the plant can get water from the soil. Therefore, in this experiment, we will make a plant soil moisture detector to ensure that our plants can get enough water and grow.
Page 23
Programming and note Show Icon: We can use this show icon block to draw icons on the Micro:bit’s matrix LEDs. Many icons have already been created in this block, so we just need to select the icon to be drawn. If/else if/else statement: If/else if/else is a logical structure that is very similar to if/else.
Experiment 8 – Intrusion alert Instruction Have you ever played any adventure games? They can always open the institutions when the enemy enters their private territory. How does this work? In fact, this is the role of intrusion alarms. Through this experiment, we will teach you how to make your own intrusion alarm, and quickly put it in your private space to protect your own space! Target Learn how PIR motion sensor works and use it to make an intrusion alarm with buzzer.
Page 25
Programming and note If/else: In this case, when the value digital read from the PIR motion sensor is true(1), turn on the buzzer and show an angry icon for 5 seconds, otherwise, clear the micro:bit’s matrix LEDs and turn off the buzzer. Clear screen: This clear screen block will clear all the information displayed on...
Experiment 9 – Make an adjustable table lamp Instruction The eye is a very important organ for us. We can see the colorful world by them. so protecting eyes is very important to us! Reading in a too bright or too dark environment can cause damage to our eyes, so when we read a book, we must pay attention to the brightness of the light to be appropriate.
Page 27
Programming and note Set to: You can use this set to block to set the value for a variable that selected from a list of the variables you create. You can create variables by click Variables→Make a Variable and then naming it. Analog write: Just like the analog read analog write...
Experiment 10 – Automatic control Instruction How do we safely use high-power appliances, do you know how to control the elevator? In fact, it needs an automatic control system, in which the relay plays an important role in helping us. This system guarantees our electricity safety by controlling large currents with small currents.
Page 29
Connect Crowtail-Switch and Crowtail-Relay to P1 and P8 ports of Crowtail-Base shield for Micro:bit. Loosen the screws of the relay, connect one end of the jumper to the 3V3 port of the Base Shield and the other end of the jumper to the COM port of the Relay. Connect the two wires of the motor to the NO port of the relay and the GND port of the Base Shield.
Experiment 11 – Automatic door Instruction It’s so convenient when we enter and exit the gate of the community, that the door will open and closes automatically after we press the switch of the gate. How about making a mini automatic door? Target Learn how servo work and use it to make a mini automatic door with touch sensor.
Page 31
Programming and note Servo write: Use this servo write block to write a value to the servo on the specified pin and control the shaft. This function will move the shaft of a standard servo(Crowtail-9G Servo) to the specified angle, or set the speed of a continuous rotation servo (0 specifies full speed in one direction, 180 specifies full speed in the other, and approximately 90 specifies no movement).
Experiment 12 – Weather station Instruction The changing weather is so annoying, I even got a cold because of it! No, I have to think of a way to remind myself of changes in the weather at all times. I have to pay attention to keep warm and never catch a cold again.
Page 33
Programming and note To using the Crowtail-Temperature&Humidity Sensor, we need to add the extension package. Follow the steps below to add extension package: Step 1: Click on the Extensions Step 2: Enter the address in the search bar and search: https://github.com/Tinkertanker/pxt-iot-environment-kit Step 3: You will view the search...
Download the program to micro:bit to see what happens. Result When you press button A on the micro: bit, the matrix LEDs will show you the current temperature. When you press button B on the micro: bit, the matrix LEDs will show you the current humidity. How to build a more comprehensive weather station so that we can get air quality, temperature, humidity, ultraviolet information and more? Experiment 13 –...
Page 35
Connect Crowtail-Ultrasonic Ranging Sensor, Crowtail-Buzzer and Crowtail-9G Servo to P13&P15, P0 and P1 ports of Crowtail-Base shield for Micro:bit. Note: You need to connect 12V power supply for the Crowtail-Base shield for Micro:bit. The hardware connections are as follows: Programming and note Just as Crowtail-Temperature&Humidity Sensor, we need to add the extension package for Crowtail-Ultrasonic Ranging Sensor before we use it.
Ping trig…echo…unit: This block is inside the sonar package we added. We can use this block to get the time, distance in cm and distance in inches detected from the ultrasonic ranging sensor. In this experiment, we set the trig pin and echo pin of the sensor are P13 and P15 port of micro:bit.
Page 37
Required Parts Micro:bit x1 Crowtail-Buzzer x1 Crowtail-Base shield for Micro:bit x1 Crowtail-Cable x2 Crowtail-RTC x1 USB cable x1 Hardware learning and connection This tiny RTC module is based on the clock chip DS1307 which communi- cates with microcontrollers with I2C protocol. The clock/calendar provides seconds, minutes, hours, day, date, month and year information.
Set date and time: We use this block to set the current date and time. In this case, we start the time from the beginning of the program, so the time needs to be set exactly the same as your local time, or you can set it faster because you need time to upload the program, otherwise the clock may be inaccurate.
Page 39
Target Learn how OLED works and use it to make a monitor with ultrasonic ranging sensor to show distance that detected by the ultrasonic ranging sensor. Learn how to show number and string on OLED. Required Parts Micro:bit x1 Crowtail-OLED x1 Crowtail-Base shield for Micro:bit x1 Crowtail-Cable x2 Crowtail-Ultrasonic Ranging Sensor x1...
Page 40
Step2: Add sonar and OLED packages to your Makecode and you can see it. Initialize OLED with width…height…: This block is used to set up the OLED display and is ready for micro: bit use. In order to use our 128 x 64 dot matrix OLED module, we need to initialize the OLED according to the hardware, setting the width to 128 dots and the height to 64 dots.
Download the program to micro:bit and see what happens. Result When the distance detected by the ultrasonic ranging sensor is less than 10 cm, the distance and warning( “Danger!” and “Keep distance!” ) will be displayed on OLED. Otherwise, the distance and Security Information( “Safe distance”...
Page 42
Connect Crowtail-Buzzer to P0 port of Crowtail-Base shield for Micro:bit(named bit1). Plug another micro:bit into Crowtail-Base shield for Micro:bit(named bit2, if you don’t have two Crowtail-Base shield for Micro:bit, you don’t have to plug this micro:bit into Crowtail-Base shield for Micro:bit). The hardware connections are as follows: Programming and note Send_code:...
Radio set group: Make a program have the group ID you tell it for sending and receiving with radio. A group is like a cable channel (a micro:bit can only send or receive in one group at a time). A group ID is like the cable channel number. If you do not tell your program which group ID to use with this function, it will figure out its own group ID by itself.
Page 44
Target Learn how IR receiver work and use it to control the LED with infrared remote control and servo connected to micro:bit. Learn how to detect the keys pressed by the infrared remote control. Required Parts Micro:bit x1 Crowtail-9G Servo x1 Crowtail-Base shield for Micro:bit x1 Crowtail-Cable x2 Crowtail-IR Receiver x1...
Page 45
Step2: Add the package to your Makecode and you can see it Connect ir receiver to: This block is used to tell the micro:bit that which port the IR receiver is connected. On button pressed: This block is to detect whether the key on the infrared remote control is pressed and which key is pressed.
Experiment 18 – Smart music box Instruction Have you ever seen a robot that says hello when someone approaches? That is a very interesting thing, so let's do a similar project in this lesson, put it in a box and make a fun and smart music box! Target Use the modules and programming knowledge we have learned to make a smart music box.
5. If the value of dis more than 10, clear the matrix LEDs, stop melody and turn two LEDs off. 6. Loop in forever block. Download the program to micro:bit to see what happens. Result When the distance detected by the ultrasonic sensor is less than 10cm, the matrix LEDs on the micro: bit will display a heart icon, the buzzer will play the melody, and two LEDs will light up.
Page 48
you need to connect a 12V power supply to the Crowtail-Base shield for Micro:bit. The hardware connection are as follows: Programming and note On button pressed: This block is to detect whether the key on the infrared remote control is pressed and which key is pressed.
Experiment 20 – Car remote control Instruction Just like our brains, controllers play a very important role in remotely controlled cars. It is responsible for telling the car what to do and how to do it. Why not try to use a micro:bit as a controller to simulate how the car is controlled, such as lights, horns, steering, etc.
Page 50
Programming and note Send_code(bit1): Receiver _code(bit2): On Gesture: On logo down, on tilt left and on tilt right these three blocks are all called On gesture block. This type of block will start an event handler(part of the program that will run when something happens).
Page 51
Blocks Overview Send_code(bit1): 1. Set radio group for micro:bit. 2. Send corresponding code based on different gesture detected. 3. If the touch sensor is touched(1), send number 4. 4. If the switch is pressed(1), send number 5. 5. If the switch pops up(0), send number 6. Receiver_code(bit2): 1.
Experiment 21 – Pick up beans Instruction Micro: bit is really cool, why not use it to make a game console? Making your favorite game and playing it in your hand is definitely the coolest game console! Let's take a look at how to use microbit and hardware modules to make a game console! This game console fully meets all your expectations of the game console, not only can play games, but also game sound effects, lights! The game we are going to make is one of the most popular games-pick up beans.
Page 53
Create sprite: Create a new LED sprite pointing to the right. A sprite is like a little LED creature you can tell what to do. You can tell it to move, turn, and check whether it has bumped into another sprite. In short, you can control this sprite according to your needs. There are two parameters in this block, “x”...
Result The Bean will drop from the top of the matrix LED, and you can use button A or B to control the player to move to the left LED or the right LED. If the player picks up a bean, you can hear a sound effect and the LED will light up to indicate a score, a new bean will spawn on top of the matrix LED and start falling, otherwise, the game ends and the score is displayed.
Need help?
Do you have a question about the Crowtail Starter Kit and is the answer not in the manual?
Questions and answers