BBC micro:bit Emoji Bag - Kitronik University
BBC micro:bit - Kitronik University This Kitronik University resource is part of the BBC micro:bit partnership and is an in depth tutorial into making an emoji bag with the the BBC micro:bit and Kitronik free D&T sample pack. kitronik_microbit_logo_870 In this tutorial students will make their own bag from a template from scratch. Then following step by step instructions they will connect additional LEDs to the BBC micro:bit via conductive thread and crocodile clips, and learn how to programme the device to display different emoji.

BBC micro:bit Emoji Bag:

You can customise the bag in any way you want, and we have suggested a few additional tasks to encourage students to explore further programming with the BBC microbit

bbc_microbit_emoji_bag_01_870

Learn how to:

  • Make a simple felt bag from scratch.
  • Program your BBC micro:bit to light the built in LED display and two additional LEDs via the output pins.
 

Level of difficulty:

  • Beginner.
 

Parts List

bbc_microbit_emoji_bag_02_870

In order to create your BBC microbit Emoji bag, you will need:  

You will also require the following equipment:

  • A computer with a USB port and internet access.
  • Large eye needle.
  • Scissors.
  • Round nosed pliers.
  • Paper template pdf_icon.gif .
 

Step-by-step guide to making your BBC microbit Emoji Bag

Step 1

bbc_microbit_emoji_bag_03_870

Cut out templates for the handles, inside pocket, oval and the top band from one colour and place onto the main piece of felt, marking out the position for the inside pocket, the crocodile clips and the LEDs and then cut out the holes. Cut out the battery pocket from the small piece of felt. Taking one of the pieces of the main felt bag we are going to sew the inside pocket which will house the battery cage. Place the pocket into position on the right hand side of the felt.

bbc_microbit_emoji_bag_04_870

Sew along three of the sides, leaving the top open for the battery cage. Turn this piece of felt over to create the circuit for the BBC micro:bit.  

Step 2

bbc_microbit_emoji_bag_05_870

Prepare the LEDs for sewing. Using the round nosed pliers, twist each of the legs on the LED to form a loop, this is so you can connect the conductive thread.

bbc_microbit_emoji_bag_06_870

Prepare the crocodile clips for sewing. Holding the crocodile clip, bend over the ends of the clips with pliers so that they are lying flat.  

Step 3

bbc_microbit_emoji_bag_07_870

Using the conductive thread, position the first crocodile clip in place, and sew to secure this, making sure you go over this a few times.

bbc_microbit_emoji_bag_08_870

The next step is to take the thread out to the side (not too far). Then use running stitch sew up towards where the LEDs will be.

bbc_microbit_emoji_bag_09_870

Before you place the LED into position you need to check the polarity of the LED. If you look at the LED you will see a flat edge, this is the negative leg.

bbc_microbit_emoji_bag_10_870

Position the LED on the right hand markings for the LED with the negative leg to the top of the felt and sew through the loop of the positive leg securing it in position, finish off and cut the thread.

bbc_microbit_emoji_bag_11_870

Sew and secure the second clip into position and taking the thread slightly wider than the first line of stitching and sew up to the positive leg of the left LED leg.

bbc_microbit_emoji_bag_12_870

Place the final crocodile clip into position and sew and secure. We are now going to sew with the thread up the right hand side of the circuit to secure the negative legs of the LEDs.

bbc_microbit_emoji_bag_13_870

Secure the first loop of the LED leg securely and then continue with the sewing across to the negative leg of the left LED. Sew securely and finish off and cut the thread.

bbc_microbit_emoji_bag_14_870

Your finished circuit should look like the example above.  

Step 4

bbc_microbit_emoji_bag_15_870

Place the battery cage into the pocket and turn the felt over. Connect the BBC microbit board to the clips. On the back of the board there is a connector for the battery cage lead, just above this make a mark on the felt and make a small hole for the clip lead to come through to the front and connect to the board.  

Step 5

bbc_microbit_emoji_bag_16_870

Take the piece of hook and loop fastener and cut it in half lengthways. Take the front piece of the felt for the front pocket of the bag and place this over the circuit for the BBC microbit, making sure it is centred.

bbc_microbit_emoji_bag_17_870

To help with the positioning of this take one of the pieces of hook and loop fastener and place it just below the crocodile clips and the thread and pin into place. The other half of the strip will be sewn to the bottom inside of the front pocket. Machine the two pieces of hook and loop fastener into position. Once in position mark where the eyelets will be, and also mark out a square 1” x 1” for where the BBC micro:bit display is. Once the eyelets have been fixed, either use glue or Bondaweb to secure the oval strip in place around the eyelets.

bbc_microbit_emoji_bag_18_870

Machine the two sides and the top of the pocket into place, leaving the bottom part open where the hook and loop fastener is, as this will give you easy access to the BBC microbit.

bbc_microbit_emoji_bag_19_870

Step 6

bbc_microbit_emoji_bag_20_870

Turn the bag inside out, pin the sides together and stitch down the two sides and along the bottom. Turn the bag the right way out.

bbc_microbit_emoji_bag_21_870

Fold the handles lengthways so that the edges meet in the centre. Pin and stitch down the middle using a zig zag stitch.

bbc_microbit_emoji_bag_22_870

Position the handles upside down on the right side of the bag, with the ends protruding slightly over the top. Once they are evenly placed pin them.

bbc_microbit_emoji_bag_23_870

Take the top band join the seam and sew into a circle.

bbc_microbit_emoji_bag_24_870

Sew the magnetic clasp in place.

bbc_microbit_emoji_bag_25_870

To fit the top band to the bag place one half of the band over the back seam and the other half exactly opposite at the centre of the band. Once into position sew along the top seam.

bbc_microbit_emoji_bag_26_870

Turn the inside top panel over and machine the handles to the top of the panel.  

Step 7

microbit etextiles emoji bag Go to the BBC microbit website, click “Lets Code”, then look for the Microsoft MakeCode Editor. Let's practice using the block system to build some code. The blocks are organised into categories and the categories are listed in a column down the left-hand side of the screen.  

Step 8

microbit emoji etextiles forever loop We need to create a "forever" loop. This is the block that the rest of our code will sit inside. The "forever" loop runs all the blocks inside it starting from the top and working its way to the bottom. Once it gets to the bottom block it starts again at the top and this process will continue forever. Click on the "Basic" category to open it and then drag the "Forever" block into the workspace. (This is the big white area in the middle of the screen.) The forever block is useful as it runs the program again from the beginning once all of the steps have been completed.  

Step 9

bbc_microbit_emoji_bag_step9a_870 To create the mouth for the face using the LEDs which are located on the BBC microbot we need the "show leds" block. Place this command block in with the "forever" block, they should snap together. Now click in the show leds block to create a smiling mouth. Now we have the mouth for the face programmed we need to program the pins to turn the LEDs on and off for the eyes. bbc_microbit_emoji_bag_step9b_870 We need to use the "digital write" command to turn one of the pins on. Drag the "digital write" block from the "Pins" category into the workspace and put it into the "forever" command. Taking a look at this block we can see that it has a circle on it so that you can input a value of either 1 or 0. You will need to set this to "1" for the first block which will turn the pin on, the second part of the block is setting which pin to turn on and off, leave this set to "P0". Now we need to include a "pause" block so the LEDs stay on for a period of time. The "pause" block is measured in milliseconds, so if we want the LED to remain on for 1 second we need to set the "pause" block value to "1000". Finally, we need to add a second "digital write" block to turn the LED off, we would need to set the number block to "0" and leave the pin set to P0.  

Step 10

  Now, let's try that out! Press the download button and the code should appear in your default downloads folder. If you plug your BBC micro:bit into a USB port it will show up as a storage device. Simply drag and drop the .hex file you just downloaded onto the BBC micro:bit. Now power up your BBC micro:bit with the batteries, then press the "reset" button next to the USB connector you should see the LED turn on.  

Step 11

bbc_microbit_emoji_bag_step11_870.jpg So now we have a basic face that lights one of the LEDs. Now let's use both of the LEDs. So copy the "digital write" command block by right-clicking and selecting "duplicate". Change the pin that is being turned on and off to "P2". Try changing the code so that both LEDs come on at the same time, then after 1 second turn one of the LEDs off and very quickly back on to imitate winking. You will need a couple more "digital write" blocks and "pause" blocks to be able to do this. Try it out on your BBC micro:bit to make sure your happy with how it looks.

Step 12

bbc_microbit_emoji_bag_step12_part_870.jpg Now we have one face working well let's try adding a second face into the code. Create a sad face in the same way we did for the smiling face. Remember to turn the pins on and off for the LEDs, try changing the amount of time that it pauses for to imitate someone blinking quicker when they are upset. Compile the code and try it out on your BBC micro:bit, experiment with the timings until you are happy with the result. We have two different facial expressions, now we want to get the code to repeat a few times before moving onto the next section of code. This requires a "repeat, do" loop, this loop will repeat the code that is contained within the block a set number of times before moving onto the next section of code.
  Lets put the smiling face code into a "repeat, do" loop and repeat the code 5 times. Now do the same with the sad face code, again get the "repeat, do" loop to repeat 5 times. Compile this code and try it out on your BBC micro:bit, you should see the smiling face 5 times and then the sad face 5 times. As the code is in the forever loop it will keep repeating this sequence.

Further Task

At the moment our code is automatically triggered and runs continually with no input. Try using features that are built into the BBC micro:bit such as the buttons or the accelerometer to trigger the code. Set your Emoji bag apart from the rest and have a unique way of triggering the code. Hint 1. Use the "set item" variable to name your movement axis, and use the "acceleration" block to set which axis you wanted to monitor. Hint 2. Use an "if, do" loop to set the value for when the code should be triggered. Still need a little more help? Why not have a look at the "Don't Steal my BBC micro:bit Alarm" tutorial.   Download the paper template here. pdf_icon.gif Download a pdf version of this page here. pdf_icon.gif  

2 comments

Mark Donnison

Mark Donnison

We had no plans to but we can look into doing one.

Faith

Faith

could you do a video doing this?

Leave a comment

All comments are moderated before being published