Make your Own Smart AI Chatbot Using Speech Recognition

Make your Own Smart AI Chatbot Using Speech Recognition
Smart ChatBot Thumbnail
ABOUT THIS PROJECT

We will make the chatbot that will recognize your speech and convert it into text using PictoBlox’s Speech Recognition Extension and then answer your questions accordingly.

Introduction

You must have used a chatbot at least once in your lifetime to ask a question on a website or maybe just to have fun! Today, we’re going to make one of our own.

We will first enter a few questions and their answers. Then, when the chatbot runs, it will recognize your speech and convert it into text using PictoBlox’s Speech Recognition Extension and then answer your questions accordingly.

Building Guide

Step 1: Prerequisites to make the Chatbot

You’ll need the following things to make the toy recognizer:

  1. A laptop or a computer with a camera
  2. The latest version of PictoBlox
  3. A good Internet connection.

Step 2: Setting Up the Project

Let’s begin by adding the Artificial Intelligence and Text to Speech extension. Follow the steps below to add the extension:

  1. Open PictoBlox.
  2. Click on Board and select evive.Selecting board
  3. Next, click on the Add extension button. You need to keep two things in mind while working with this extension:
    1. You need to log in to your PictoBlox account to use it.
    2. That your computer is connected to the internet.
  4. Select the Artificial Intelligence Extension.Artificial Intelligence extension
  5. Next, let’s add the Text-to-speech extension. This extension lets you convert the Audio into a text message. Click on the Add extension button again and scroll down till you find the text-to-speech extension.Text-to-Speech Extension

Step 3: Setting Up the Stage

Now, let’s set up the Stage by adding the Sprite and the Backdrop.

  1. Let’s begin by adding Abby, the sprite which will be the character of our chatbot to our project,
  2. Click on Choose a Sprite button.Adding New Sprite
  3. Select Abby from the library.Abby
  4. When Abby’s added, remove the Tobi’s sprite.
  5. Now, let’s add a good backdrop. Click on the Choose a Backdrop button and choose Boardwalk backdrop from the library.Broadwalk backdrop

You can add any sprite or backdrop of your choice.

Step 4: Writing the Script for AI Chatbot

Follow the steps below to write the script.

As we want to execute the program every time the green flag is clicked, thus place the when flag clicked hat block into the scripting area from the Events palette.when flag clicked

Introducing each other

Now to get the user familiar with our Chatbot, we will introduce Abby to the user and ask for the name of a user to add a personalized touch to it

  1. Thus, get a speak () block from Text to Speech palette. This block converts any text written in white space to audio form to be played on your PC/laptop speaker.
  2. Write “Hello, I am Abby your friend!” to introduce Abby to the user.
  3. Again add a speak () block and ask for the user’s name Write ”What is your name? ” into space given.
  4. This block will not store the user’s name for us. Thus, for storing users name we need to add more blocks. Get recognize speech for () secs in () block from the artificial intelligence extension blocks. This block records audio and sends it to the web to decode and convert the speech into the text form.
  5. Its result i.e the user’s name is stored in the speech recognition result block.
  6. Now to use the name in further communication we will store it in a variable. Go to the Variables tab, click on Make a New Variable and make a String type variable named “Name” to store the name of the user.
  7. Get a set () to () block from the Variables palette, select Name from the drop-down, and add speech recognition result inside it.
  8. Now to make our chatbot welcome users get a speak () block. Place a join () () block inside it from the Operators palette. Write “Welcome ” into the first space of the join block. And add the Name reporter block into the second space.

Chatting Up the Bot

  1. To continuously chat with our chatbot, we will add in a forever block from the Controls block palette below the speak block.
  2. Now we will first prompt the user to ask a question. To do so, get a speak () block and add a join () () block in it.
    evive Notes Icon
    Note: We will always add a join block, to make Abby say the user’s name.
  3. Write “What’s on your mind ” into the first space of the join block. And add the Name reporter block into the second space.
  4. Now to again recognize the user’s questions, we will add the recognize speech for () secs in () block from the artificial intelligence palette to record whatever the user is speaking.

Adding the Questions and their Answers

Chatbot normally answers the predefined questions fed in it. Thus, now, we will be adding common questions which if matched chatbot can reply with the respective answer.

  1. Now get an if-else block from Controls block palette to check if recognized speech matches the question.
  2. Inside the if arm, we will add an () = () block to check result.
  3. Now into the first blank space of equal to block, place, the speech recognition result block, and type in the question ” Who am I? ” in second space.
  4. We will want our chatbot to reply as “You are and the name of the user”. Thus, get a speak () block from the text-to-speech palette into the if portion and add a join () () block inside it from the operator’s block palate.
  5. Write “You are ” into the first space of the join block. And add the Name reporter block into the second space.
  6. Similarly, I’ll be adding a few sample questions, you can add the questions and answers according to your choice.
  7. Duplicate the if arm and place it below the else arm.
  8. We will edit out the contents with appropriate questions and their answers.
  9. You can add in as many questions as you want.

Making Chatbot do Something Extraordinary

Apart from playing around with simple questions and answers, you can even add some special features to your chatbots such as celebrate bday, crack jokes, make it play a song, and much more. We will be making one such custom event for Bday.

  1. Duplicate the if-else block as we did previously and change the question portion with the statement ” It’s my birthday”.
  2. Now when the speech matches, we will change the backdrop to the birthday theme. Thus, add in the Party backdrop from the add backdrop option.
  3. Place the switch backdrop to () block from Looks block palette and choose party from the drop-down.
  4. Now to wish the user get a speak () block and add a join () () block inside it inside the first space write “Happy Birthday ” and add the Name reporter block into the second space.
  5. Now, to play the birthday song, go to the Sounds tab from the top and click on choose a sound button. And the Birthday sound.
  6. Come back to the script.
  7. From the sounds block palate, add play sound until done block below the speak block and choose birthday from the drop-down.

Adding the Default Case

Now, let’s add the default case, if the recognized result does not match any predefined questions then we will make Abby say “Sorry! I don’t understand it yet.”

Add a speak () block into the last else arm of the question and write “Sorry! I don’t understand it yet.”.

Making Abby Talk

Now to make chatbot look more realistic we will be making one small script.  This script will make the character move its face and hands to make Abby look like she is talking.

  1. First, get one more when the flag is clicked block and add the forever block below it.
  2. Now from the looks block palette get a next costume block.
  3. Now to make costume switch visible place a wait () block from Controls block palette and add the wait time of 0.5 seconds.

With this, your script is ready just click on the flag button to start chatting with a chatbot.

 

 

 

Code

DESCRIPTION DOWNLOAD CODE
Smart Chatbot A Download

Make Flappy Bird Game Using Human Body Detection Extension in PictoBlox

 

Make Flappy Bird Game Using Human Body Detection Extension in PictoBlox
Flappy Bird Game Using Human Body Detection
ABOUT THIS PROJECT

Make your version of the flappy bird game using PictoBlox’s Human Body Detection extension to control the bird using our nose.

PROJECT INFO

Introduction

I’m sure many of you might be familiar with Flappy Birds – if not the game, then at least the viral Instagram filter in which you control the bird using your nose. That is exactly what we are going to make in this video.

We’re going to make our version of the flappy bird game using PictoBlox’s Human Body Detection extension in which we will control the bird using our nose.

 

Building Guide

Step 1: Prerequisites

You’ll need the following things to make the make your own logo quiz:

  1. A laptop or a computer with a camera
  2. The latest version of PictoBlox, which you can download from here.
  3. A good Internet connection.

Step 2: Setting Up the Project

Let’s begin by setting up the project.

  1. Open PictoBlox
  2. Click on the board button and select evive.select evive as board
  3. Click on the Add extension button.
  4. Choose the Human Body Detection Extension and wait for a little while till the models get loaded.Human Body Detection Extension

Step 3: Setting Up the Stage for the Flappy Bird Game

In this video, we will mainly focus on writing the script to control the bird with the nose. We have already written the script to set up the stage and project. You can download the script from the link given here.

  1. Once you have downloaded the script, go to PictoBlox.
  2. Choose the File option to open up the downloaded script.

Once you open the script, you will notice a lot of sprites and their scripts.

We will briefly understand them and go back to writing our main script.

Logo of the flappy bird Sprite

The logo appears every time we start the game by clicking on the green flag. With the start of the game, the score is set to 0.flappy bird logo

The Bird Sprite

This sprite is the hero of our game, we will discuss the scripts into this sprite in the later part of the project.bird sprite

The Floor Sprites

The next two sprites are for the floor and the scripts written in them make them move continuously.floor sprite

Start Button Sprite

Upon clicking the start button, the game starts and the pipe hurdles start moving.Start button sprite

Pipe Hurdles Sprites

The next three are the pipe sprites. On clicking the green flag, these sprites should be hidden. As soon as the game begins, they should begin to move in continuously by changing the Y position randomly.Pipe Sprite

Score Sprite

The next two sprites show the score of the player. As soon as the bird crosses the hurdle of pipe the score should increase by changing the next costume. We have used two numbers of sprites to show the score in two-digits. You may notice that we have used numbers as costumes, you can simply display the score in the variable too.number sprite

Game Over Sprite

The next sprite if the game over sprite that should appear as soon as our bird touches any of the pipe sprites.game over sprite

Title Sprite

This is an optional sprite to make the stage look better. You can name the game or add the title sprite according to your choice.title sprite

Step 4: Writing the Script for the Flappy Bird’s Bird Sprite

Now, let’s come back to our main bird sprite.

Making the Bird Move

Firstly, we will first set up the bird sprite as soon as the game begins.

  1. Thus, drag and drop when I receive () block from the Events palette and choose begin game from the drop-down.

    Making the Flappy Bird Script in Scratch

  2. Now to make the bird move forward, place point in direction () block from the Motion palette.
  3. From the Looks palette, place show block.
  4. Also, to bring the bird to the front layer, place go to () layer block below the show block. Choose front from the drop-down.Script for Flappy Bird in Scratch
  5. Now, set the initial position of the bird to x as 0 and y as 0 using the go to x () y () block from the Motion palette.Script for Flappy Bird in Scratch
  6. Now, to make the bird look like it is flying, place a forever block from the Controls palette.
  7. Next, place the next costume block from the Looks palette into the forever block.
  8. To make the costume change visible, place the wait () block from the Controls palette, and write 0.05 into the space given.

    Making the Flappy Bird Script in Scratch

  9. The final script will look like this:Making the Flappy Bird Script in Scratch

Controlling the Bird Using Nose

Now, let’s make another script in the bird sprite to control it using our nose whenever we click on the Start button.

  1. Drag and drop when I receive () block from Controls palette, choose game from the drop-down.Control Flappy Bird with Nose
  2. To turn on the video feed, from the Human Body Detection palette, drag and drop turn on video on stage with () % transparency block replace 0 with 25.Control Flappy Bird with Nose
  3. To continuously detect the position of the nose. Drag and drop forever block from the Controls palette.
  4. Drag and drop the analyse image for human pose from () block and choose camera from the drop-down.Control Flappy Bird with Nose2
  5. And set the y position of the bird as the y position of the nose. Drag and drop the set y to () block from the Looks palette.
  6. Into the input, place Y position of () of person () block from the human body detection palette. Choose nose from the first drop-down and from the second.Control Flappy Bird with Nose
  7. The complete script will look like this:
    Control Flappy Bird with Nose

Script when the Bird touched the Pipes

Now, what happens when it touches the sprite. Thus, let’s make a small script for the same.

  1. Duplicate the above hat block and remove all the blocks below it.
  2. Place a forever block from the controls palette.
  3. Place an if arm from the Controls palette.
  4. Place touching color () ? reporter block from the Sensing palette into the if arm picks the color of the pipe’s border as using the color picker option.Color Picker Option
  5. If it touches the pipe, the bird should stop moving a.k.a all the scripts of the bird should stop. Thus from the controls palette place stop all into the if arm.Control Flappy Bird with Nose

With this our script is complete. Click on the green flag and start playing.

Step 5: Conclusion

With this, you’ve successfully made your flappy bird project.

Beat my score and share your video with us in our Facebook community here.

 

Code

DESCRIPTION DOWNLOAD CODE
Setting Up Flappy Bird Project and Stage Download

Self Driving (Autonomous) Car in PictoBlox Using Recognition Card Extension

Self Driving (Autonomous) Car in PictoBlox Using Recognition Card Extension
Self Driving Card in PictoBlox using Recognition Card
ABOUT THIS PROJECT

Learn how automated vehicles decide which route to take to reach a particular destination using Recognition Cards in PictoBlox.

PROJECT INFO

Introduction

Have you ever wondered how Tesla, the self-driving car decides the route? Today, we are going to make something similar but in PictoBlox. We are going to make our own self-driving car in PictoBlox, which will detect the sign cards and accordingly. We are going to use the Recognition Card Extension of PictoBlox.

Let’s begin by understanding what Recognition Card Extension is.

Components Required

IMAGE COMPONENT QUANTITY AVAILABLE IN KIT
PictoBlox Download NOW

Building Guide

Step 1: What is Recognition Card Extension?

Recognition Card Extension is one of the latest extensions added in the latest version of PictoBlox, v.4.1.0.

recognition card extension

This extension is our very own take on a pre-trained classifier. We can recognize Numbers, Human-like Hazel and John, Traffic Signals, Card Suit, other random cards like pizza, hospital, etc.

Along with the NLP Extension, there are a lot of new features added to the latest version of PictoBlox. You may need to download PictoBlox or update it to use the latest features.

Step 2: Setting the Stage to make track for Self-Driving Car

First, we will set up our stage. We will make our stage look like the street. We already have designed one, you can download it from the link given below or you can design one for yourself.

  1. Open PictoBlox.
  2. Upload the backdrop.Street Backdrop
  3. Let’s first understand the elements of the backdrop.
    1. There will be two lanes, on which we will select by showing the number cards.
    2. Next are the three points, home, pizza store, and hospital. Once the lane is selected, the car will recognize the next card and move on to reach that particular location.
  4. It’s time to add the Sprites. But before we add the sprite, we need to say bye to Tobi. Upload the car sprite from the computer, which you can download from here.Car Sprite
  5. Next, choose John’s sprite from the sprite library. Here, John is the instructor that will command us to perform certain tasks and the car will be following our commands.
  6. If you may have noticed, that the lanes are in opposite directions, we need one car to face the other side. Thus, duplicate the car sprite, go to the costume palette, select car and click on flip horizontally.

With this, our stage and sprite’s setup is complete.

Step 3: Making John the Instructor

Script to Make John Instruct the User

Choose John sprite. We will begin by writing the script for our narrator, John.

  1. Place, when flag clicked hat block from the Events palette.
  2. Next, let’s add the recognition card extension. Click on Add extension button and then select the Recognition Card Extension.turn () video on stage with () transparency block
  3. Place turn () video onstage with 0% transparency block from the recognition card palette and select off from the drop-down.
  4. Next, we need to switch the backdrop to a clear one, thus, from the Looks palette, drag and drop switch backdrop to () block and select backdrop1 from the drop-down.
  5. Set John on the stage using the go to x() y() block from the Motion Palette. Write 21 in the first space given and -112 in the second space.
  6. Next, from the Looks palette, place the show block.
    Setting the position for John
  7. Next, we need John to instruct the user to show the number card to select the lane. Thus, place a say () block from the Looks palette, to make John speak. Write. “Hello, Let’s go on a ride with the self-driving car“.
  8. Duplicate the say block and write, “In which lane do you want to drive the car?” in the space given.
  9. Duplicate the say () block again and replace the text with: “Place the number card in front of the camera.Asking User to Show Number Card in Self-Driving Car

With this the instructional part of John is complete. Next, we need the camera to open up to analyze the number card and choose the actions for car accordingly.

Script to Analyze the Lane Number

  1. Next, after instructing this much, we need to hide John, so that the cars can perform their actions. Thus, from the Looks palette, place a hide block.
  2. Now, to recognize the number card, we need to turn the camera on. Thus, place turn () video onstage with 0% transparency block from the recognition card palette and select on-flipped from the drop-down.
  3. We need to make John wait for a few seconds till PictoBlox analyzes the card. Thus, from the controls, palette, add wait () seconds block and write 3 in the space given.
  4. Place analyze image from camera block from the Recognition card palette.
  5. To make sure that the cards are recognized perfectly, we will a bounding box around them. Thus, place the show bounding box block.show bounding box
  6. Once, analyzed, we need to hide the bounding box. Thus, add a wait () seconds blocks and write 2 seconds and place the show bounding box block again, but select hide from the drop-down.
  7. Also, let’s turn off the camera, thus, place turn () video onstage with 0% transparency block and select off from the drop-down.analyzing the number and location card
  8. Now, we need the cars to perform the actions once lanes are recognized. Thus, Place an if () block from the Controls palette.
  9. Place is number () detected reporter block from the Recognition Card palette and select from the drop-down.is number card detected block
  10. To make the Right direction car to do the next steps, we will send the right car sprite the message. From the Events palette, place broadcast () and wait block, and in the new message write Lane-One.
  11. Duplicate the previous two steps. Choose 2 from the drop-down of the if block and write a new message ‘Lane-Two’.analyse the number card for self-driving car

With this, the script for our John is complete. Let’s move on to write the scripts for the car.Complete script for John

Step 4: Making the Self-Driving Car Move from Lane-One

    1. Select the right car.
    2. At first, the car should not be visible. Place, when flag clicked hat block from the Events palette. Next, from the Looks palette, place a hide block.hide the car

    Fixing the Car’s Initial Position

    1. Now, let’s write the script on what happens when you send the Lane-One message.When I receive message block
    2. Next, we need to switch the backdrop to Street, thus, drag and drop switch backdrop to () block and select Street backdrop from the drop-down.
    3. We need the car to come to the initial position and point in the right direction. Thus, place point in direction () block from the Motion palette and write 90. Drop go to x() y() block and write 242 in first and 62 in second space respectively.
    4. Now, the stage and the position of the car are set, it’s time to show it, place show block from the Looks palette.setting the initial position of the car
    5. Now, the car is in Lane-One we need it to come a little further till the intersection. Thus, place glide () seconds to x() y() block from the Motion palette and write, 147, and 62 in first, second, and third places respectively.glide to x () y () block

    With this, the car has reached the place where it has to ask the user to show the location card.

    Analyzing the Location Card

    1. Thus, place a say () block and write “You need to choose whether you want to go to Pizza store, Home, or Hospital.”
    2. Place another say () block and write “Thus place the location card in front of the camera.”asking user to display the location cards
    3. As we want to on the camera for a while, we will hide the car, thus, place the hide block.Setting car's location
    4. Now, to recognize the location card, similar to the number card, we need to turn the camera on. Thus, place turn () video onstage with 0% transparency block from the recognition card palette and select on-flipped from the drop-down.
    5. Add wait () seconds block and write 3 in the space given.
    6. Place analyze image from camera block from the Recognition card palette.
    7. Place the show bounding box block.
    8. Add a wait of 2 seconds and place the () bounding box block again, but select hide from the drop-down.
    9. Also, let’s off the camera, thus, place turn () video onstage with 0% transparency block and select off from the drop-down.
    10. Now, that the location card is analyzed, let’s bring the car back on to make it move. Place the show block.analyzing the number and location card

    Moving in the Analyzed Direction

    1. Now, if Pizza is located we need the car to head towards the pizza store. Place an if block. Place is Pizza detected reporting block from the recognition card palette.
    2. Next, into the if arm we will write a couple of commands to move the car.
    3. To make it move forward, place glide () seconds to x() y () block and write 0.49 and 16 respectively.
    4. To make it turn upward. Place point in direction () block and write 180 in it.
    5. Now to make it move forward and then turn right, duplicate the glide and point in direction block and write 0.66119 in the glide () seconds to x() y () block and -90 in the point in direction () block.
    6.  To make it reach the Pizza store, place another glide () seconds to x() y () block and write 0.5109 and 127 respectively.route to the Pizza Store

    With this, your car has reached the pizza store from lane one. Make sure to change the numbers in the glide and the point-in-direction blocks if you have planned out the backdrop of your choice.

    1. Similar to the make it reaches the Pizza Store, we will write the code to make the car move to home and hospital from lane one.
    2. Duplicate the if arm and make the changes according to the path to the home and hospital from lane one respectively.route to Home and Hospital

    With this, your script for the car if moving in lane one is complete.Final script for Autonomous Car of lane one

Step 5: Making the Self-Driving Car Move from Lane-Two

Make the changes to move the self-driving car from lane two to Pizza Store, Home, and Hospital respectively.Final script for Autonomous Car of lane two

Step 6: Conclusion

With this your self-driving (Anonymous) Car in PictoBlox is ready to move on it’s own!

Code

DESCRIPTION DOWNLOAD CODE
Self Driving Car Using Recognition Card Extension Download
Sprites and Backdrops Download

Gesture Controlled Space Battle Game in PictoBlox using Human Body Detection

Gesture Controlled Space Battle Game in PictoBlox using Human Body Detection
ABOUT THIS PROJECT

How to make a gesture-controlled space battle game in PictoBlox and control it using the tip of your fingers.

PROJECT INFO

Introduction

Most of you must have played games on Xbox, or using gamepads, Joysticks, and whatnot. How about making a game that you can control using your fingertips? Sounds pretty cool, right?

In this video, we will show you how to make a gesture-controlled space battle game in PictoBlox and control it using the tip of your fingers.

Let’s begin!

 

Building Guide

Step 1: Working with PictoBlox

As the title of the tutorial itself suggests, we will be making this project in PictoBlox- a scratch based graphical programming software. Follow these steps and make your own expression recognition machine.

Setting up the Software

As you like to be up-to-date, so does the software. To use the face detection extension of PictoBlox, you need to update PictoBlox to its latest version. You can download it from here.

Adding Up the Extension

Now that we have the latest version, let’s add the Face Recognition.

  1. First, select the board as evive.
  2. Next, click on the add extension button
  3. Once clicked you will be able to see all the extension available,
  4. Select Human Detection ExtensionHuman Body Detection Extension

You will notice new blocks are being added under the same extension

Please remember that this extension requires an Internet connection in order to process images. Also, wait till models get loaded it might take a few moments to load.

What will you need

  1. A pc/laptop with a camera.
  2. PictoBlox.
  3. Internet connection.
  4. A webcam.

Step 2: Writing the Script for the Space Battle Game in PictoBlox

Now, that everything is ready. let’s start writing the script.

We have already made a space battle game that you can control with the gamepad of Dabble, a project -making app for Smartphone. As we press keys on the gamepad, it sends data to the control of the games to the computer via evive.

We are going to make the changes to the code of the same game. Download the code from here.

If you wish to get started with programming visit the course here to learn the basics of programming.

Step 3: Making Gesture Controlled Space Battle Game in PictoBlox

Let’s begin by making the changes in the previous script.

Open the downloaded SB3 file directly by clicking on the file. Or open PictoBlox, go to File, then select Open and from the dialog box that appears choose the file that you have downloaded. Once the game is loaded you are ready to make changes.

The Rocketship Script

First, we will begin by editing the script of Rocketship.

  1. Let’s begin removing the extra blocks. Click on Rocketship sprite, remove the first two if blocks inside forever along with its contents. Also, remove is triangle pressed on gamepad block from, the third if block. Now, let’s replace the controls of Dabble by the controls of Hand Gestures.
  2. Select the Human Body Detection palette and add the turn () video on stage with () % transparency block to get your video to control the space battle. Place this block above the forever bock and below the set score to 0 blocks.Gesture Controlled Space Batlle Script
  3. Now to analyze the image from the webcam, add the analyze image for hand in camera block inside the forever block. This block looks for the details on hand location and other details from the live image feed from the camera.Gesture Controlled Space Batlle Script
  4. Next, we need to sync the location of the top of our index finger along the axis with our rocketship to control its movements thus, use a set x to () block from the Motion palate. Place the () position of () of () fingers inside set x to block. Choose from the first drop-down, top from the second and index finger from the third drop-down. This block will provide all the information on the location of all the fingers.Gesture Controlled Space Batlle Script
  5. Then, we need to fire the bullets by pressing the space key on the keyboard.Drag and drop the is space key pressed block from the assessing palette.

The final script of the Rocketship is here:Gesture Controlled Space Batlle Script

The Monster Script

Finally, we need to turn the camera off once the game is over, thus, click on to monster sprite, add the turn Off video on stage with 0% transparency.Gesture Controlled Space Batlle Script

The final script of the monster is here:Gesture Controlled Space Batlle Script

Gesture Controlled Space Batlle Script

The Bullet Script

We are not going to make any changes to the script for bullet sprite.Gesture Controlled Space Batlle Script

With this the script for our Gesture-controlled Space Control is ready.

You can download the script for the game from here.

Step 4: Conclusion

Now play the Rocketship using your fingertip.

Get started with Artificial Intelligence and Machine Learning with the all-new PictoBlox.

Code

DESCRIPTION DOWNLOAD CODE
Gesture controlled Space Battle game Download

DIY Automatic Chocolate Dispenser

DIY Automatic Chocolate Dispenser
Automatic-Chocolate-Dispenser
ABOUT THIS PROJECT

Make your own DIY automatic chocolate dispenser for a sweeter and merrier Christmas!

PROJECT INFO

Introduction

‘Tis the season of joy, giving gifts, and sharing sweets and treats! How about doing something special for Satns this time? 😉 Learn how to make your own automatic chocolate dispenser a.k.a. a chocolate vending machine and make your Christmas sweeter than ever before by sharing treats with dear Santa! All the electronic components that you need to make the chocolate dispenser is available in the evive Starter Kit. And you can program it without any kind of hassle in PictoBlox – a Scratch block based graphical programming software. You can download PictoBlox from HERE.

What is more, is that the automatic chocolate dispenser can also act a beautiful piece of Christmas decor!

So, are you ready for some “sweet” DIY?

Let’s begin!

Components Required

IMAGE COMPONENT QUANTITY AVAILABLE IN KIT
evive 1
PictoBlox To Be Downloaded
Ultrasonic Sensor 1
Metal Servo Motor and Accessories 1
Male to Female Jumper Cable 20cm 4
Plastic Corrugated Sheet 2
  • None

Building Guide

Step 1: Collecting the 3D Printed Parts

Before we begin the assembly of our chocolate vending machine, we need to 3D printed some of the components.

You can directly download the STL files from Thingiverse.

Step 2: Setting the Servo Angle

Once, we have all the 3D printed parts ready!

We can start the assembly, but there is just one more thing that we need to make sure. i.e the metal servo angle should be 0°.

Thus, to ensure that we’ll check the angle using evive– an Arduino embedded all-in-one prototyping platform.

  1. Take a metal servo and connect it to evive’s Servo Channel 1 i.e. S1.
  2. Then, switch ON evive.
  3. From the menu select Controls.
  4. Then navigate to Servos.Control Menu Servo Selected
  5. Finally, select Servo 1 as we have connected our servo to Servo Channel 1.Servo Select Menu
  6. Now, set the angle to 0° using potentiometer 1.

Step 3: Making the Dispensing Mechanism

Let’s begin by making the chocolate dispensing mechanism with the metal servo and the 3D printed parts.

  1. First, take the 3D printed gear, slider and the baseplate.
  2. Next, mount the servo motor onto the baseplate using M3 bolts of 12mm length such that the servo head faces outwards.Making Automatic Chocolate Dispenser
  3. Then, place the slider inside the slot given on the baseplate.
  4. Finally, fix the gear onto the servo head such that the teeth of the gear match the teeth on the slider.Making Automatic Chocolate Dispenser

Step 4: Making the Structure of the Chocolate Dispenser

Now that the dispensing mechanism is ready, it’s time to make the chocolate/candy dispenser.

evive Notes Icon
We’ll be using a combination of red and white corrugated sheets, the Christmas colours, for making the box. You can even make the dispenser using the colour of your choice or even using thick cardboard.

We will first make the structure of the box i.e. the top and the bottom plate and the sidewalls and then add the details in them in the later steps.

  1. For making the top and bottom side of the dispenser box. Take a white corrugated sheet and cut two squares of 17 cm * 17 cm each.Making the Candy Dispenser
  2. Next, are the sidewalls. Take the red corrugated sheet of 60 cm * 15 cm.
  3. Now, mark three lines 15cm apart from each other along the 60 cm side to make the four sides of the box.
  4. Next, cut along those lines and fold it into a box to make the sidewalls of the dispenser.Making the Candy Dispenser
    evive Notes Icon
    Make sure that you only cut through the first layer so that the sheet can be folded easily.
  5. With this, the basic structure of the candy dispenser is ready.

Step 5: Making the Candy Collector Box

Now, we would need a box i.e. the collector or the storage box to collect the dispensed box, if you don’t want your chocolates to fall on the ground.

  1. Take a piece of white corrugated sheet of size 10 cm * 18 cm.
  2. Now mark two lines leaving 5cm from both the edges.
  3. Cut along the lines marked and fold it along.
    evive Notes Icon
    Make sure to cut through the first layer of the sheet only.
  4. With this, we have a pair of two opposite sides and the bottom of the box.
  5. Next, take two rectangles of size 5 cm * 8 cm from the red corrugated sheets to make the remaining sidewalls.Making the Vending Machine

With this, your collector box is ready.

Step 6: Making the Globe to Hold the Chocolates

Now, comes the globe, that is the container for holding the chocolates into your chocolate vending machine. This is where all your chocolates/candies will be hidden before being dispersed.

  1. Take a white corrugated sheet of 10 cm * 24 cm.
  2. Next, mark three lines at 4 cm, 12 cm and 16 cm along the longer side i.e. along the 24 cm side.Making the Vending Machine
  3. Next, cut along the first layer of the marked lines.
  4. Fold along the lines and glue them together to make the globe.
  5. Next, take a red corrugated sheet of 8 cm *3 cm, the chocolate support plate that will give appropriate level to the chocolates so that it could be dispensed easily.

Now that we have the structure of all the parts of our vending machine ready, it’s time to add the details.

Step 7: Adding the Details to our Vending Machine

It’s time to add small details into our vending machine. Make sure you follow each of them carefully.

  1. Take the globe, a.k.a the candy holder and cut out a small rectangle of 2 cm * 2 cm from one side of the globe for the slider.
  2. Next, cut another rectangle of 8 cm * 2 cm on the opposite side of the first rectangle on the globe for dispensing chocolates.
  3. Then, glue the chocolate support plate at the bottom end of the globe.Making the Vending Machine
  4. Now, take the corrugated sheet with sidewalls and cut out a rectangle of 8 cm * 2 cm from the bottom left corner of the front sidewall leaving 1 cm from the left side for dispensing the chocolates.Making of the chocolate Dispenser

Step 8: Decorating the Chocolate Vending Machine

Since ‘CHRISTMAS IS COMING‘. let’s make the chocolate dispenser more “Christmas-y”!

Glue the Santa cutout on the front plate i.e. on the plate with rectangle on it. You can decorate it the way you want it to.Making of the Automatic Chocolate Dispenser

Also, make two holes into the eyes of the Santa of the size of the ultrasonic sensor.Making of the Chocolate Dispenser

Step 9: Completing the Chocolate Dispenser Assembly

Now all the components are ready, it’s time to assemble the dispenser.

  1. Firstly, let’s assemble the side walls.
  2. Take the base plate and draw a square of 15 cm * 15 cm on it.
  3. Next, take the sidewalls and glue them to the base plate on the markings using hot glue.
  4. Now, let’s attach the globe.
  5. Match the slots on the globe and sidewalls and carefully glue the globe to the bottom plate using hot glue.Making the Candy Dispenser
  6. Next, place the dispensary mechanism behind the globe and make sure that the slider fits into the slot on the globe perfectly.Making the Automatic Vending Machine
  7. Now, let’s make our vending machine automatic i.e. it’s time to add the ultrasonic sensor.
  8. Attach the ultrasonic sensor on the front wall behind Santa’s face. Make sure that it fits into the ultrasonic sensor perfectly.Fix the ultrasonic sensor into the dispenser
  9. Now, glue the storage box for catching the chocolates into the front of the vending machine using the hot glue. Again, make sure that the slots on the front side and the storage box.Candy Dispenser
  10. Finally, take the top/lid of the box.
  11. Now, draw a line 3 cm from one of the edges and cut along it only through the first layer. This makes the lid opening and closing easy.
  12. Finally, attach the lid to the top of the box.

With this, the assembly is done.

Don’t forget to fill the globe with delicious treats for you and your friends.

Step 10: Making the Connections

We are going to connect the Metal Servo and the Ultrasonic Sensor to evive.

  • Connect Metal Servo to evive’s Servo Channel 1.
  • Connect Ultrasonic Sensor as:
    • VCC pin to evive’s +5V pin.
    • GND pin to evive’s GND pin.
    • TRIG pin to evive’s Digital pin 2.
    • ECHO pin to evive’s Digital pin 3.Chocolate Dispenser Connection Diagram

Step 11: Coding your Chocolate Vending Machine

The program will start executing when evive starts up. It will continuously monitor the readings from the ultrasonic sensor whose trig and echo pins are connected to Digital Pins 2 and 3 respectively.

If the distance is less than 10cm, we’ll set the servo connected to Channel 1 to 180° so that the slider moves outwards, causing the chocolates to fall. Otherwise, the servo will remain in the default position, i.e. at 0°.

Chocolate Dispenser Code

Step 12: Conclusion

With this, your DIY automatic chocolate dispenser is ready. Have a sweet Christmas! ????

Circuit Diagram

DESCRIPTION CIRCUIT DIAGRAM
We are going to connect the Metal Servo and the Ultrasonic Sensor to evive.

  1. Connect Metal Servo to evive’s Servo Channel 1.
  2. Connect Ultrasonic Sensor as:
    1. VCC pin to evive’s +5V pin.
    2. GND pin to evive’s GND pin.
    3. TRIG pin to evive’s Digital pin 2.
    4. ECHO pin to evive’s Digital pin 3.

Code

DESCRIPTION DOWNLOAD CODE
PictoBlox Code Download
Arduino Code Download
evive Library Download

Attendance System Using Face Detection Extension in PictoBlox

Attendance System Using Face Detection Extension in PictoBlox
Face recognition_attendance system
ABOUT THIS PROJECT

Learn how to make an attendance management system based on Face Recognition using PictoBlox and store data in real-time.

PROJECT INFO

Introduction

Because of the current pandemic, everything is becoming contactless – from lift buttons to doors to sanitizer dispensers. So, why should the fingerprint-based attendance systems, widely used in offices and schools, be left behind? In this video, we’re going to show you how to make a contact-free face recognition-based attendance system using PictoBlox AI.

Our system will first take a sample image of the person whose attendance needs to be tracked. The next time when the system scans the person’s face, it will match the image with the sample image stored and will note down the time stamp for that person.

Let’s begin.

Building Guide

Step 1: Prerequisites for the Attendance System based on Face Recognition

To make this project all you need is:

  1. A laptop or a computer
  2. Camera/Webcam
  3. The latest version of PictoBlox (Download the latest version from here)
  4. A good Internet connection.

Step 2: Setting Up the Project

Let’s begin by adding the Face Detection extension.

  1. Open PictoBlox.
  2. Click on Board and select evive.select evive as board
  3. Next, click on the Add extension button.
  4. And choose Face Detection extension.Face-detection Extension
  5. You need to keep two things in mind while working with this extension:
    1. That your computer is connected to the internet.
    2. You need login to your PictoBlox account to use it.
  6. Wait for a little till the models get loaded.

Now to log the timestamp of attendance and name of the attendees, we need to add the Data Logger extension.

  1. Click on the choose the Add extension button again.
  2. Choose the Data Logger Extension. This extension lets you generate a CSV file according to your requirement and store data in it.data logger extension

Step 3: Setting Up the Stage.

We will first need the sample images of whose attendance we need to track. Follow the steps to know-how.

  1. Click on Choose a Sprite button
  2. Select Upload Backdrop, to upload the images.
  3. Right now, we will be using a sample image of Robert Downey Jr. and Chris Evans separately as sample images. And one image of them together to test them.

Step 4: Storing the Images of the Attendees into the Memory

Let’s first recognize the sample image and store them in the computer’s memory.

  1. Click on Choose a Sprite button.
  2. Select Square box Sprite from the library.square box sprite
  3. We don’t need Tobi’s Sprite, thus right-click on it and select Delete from the menu.delete tobi1

Now, let’s begin to write the script.

  1. As soon as we press any on the keyboard the data should be stored on the computer’s memory.
  2. Thus, from the Events palette drag and drop when space () key pressed block and I from the drop-down (You can choose the key of your choice).
  3. To analyze the images from the backdrop, we need the camera to be off. Thus, from the Face Detection palette, place a turn on video on stage with 0% transparency block, and choose off from the drop-down.Storing the Images for the attendance system
  4. Next, we will store the images of Robert Downey Jr. and Chris Evans into memory.
  5. Thus, from the Looks palette place a switch backdrop to block and select Robert Downey Jr from the drop-down.
  6. Next, add a wait of the 1-second front the Controls palette.Storing the Images for the attendance system3
  7. Now, to store Robert’s face, from the Face detection palette, place adds class 1 as () from () block. Select 1 from the first drop-down and stage from the second.
  8. To identify the image/backdrop as Robert Downey Jr., write Robert Downey Jr into the space given.
  9. Similarly to store Chris Evan’s face into the memory. Repeat the steps from 5 to 8 and make the necessary changes.Storing the Images for the attendance system3

 

 

Step 5: Completing the Face Recognition based Attendance System

Now, let’s move on to the main script to recognize the image and store the entry along with the timestamp in real-time.

  1. We need to execute the program, whenever the green flag is clicked, thus, from the events palette, drag and drop when flag clicked hat block.
  2. Initially, we will hide the square box, thus from the Looks palette, drag and drop the hide blocks.
  3. Now we will create a new file to store the attendance data. From the data logger palette, choose a create file () block we will give it a name ‘attendance’.
  4. Next, we will change our backdrop to a photo where we have both Robert and Chris together.
  5. Thus, from the Looks palette, use the switch the backdrop to block and select Robert and Chris from the drop-down.
  6. And as we want to verify the image on the stage we will make sure that the camera is off, thus add the turn off video on stage with ()% transparency block.
  7. Now as to continuously analyze the image, add a forever block from the Controls palette.
  8. We need to match the faces on the stage with the ones we have uploaded too. Thus, drag and drop the do face matching on stage block.
  9. As we will recognizing multiple faces on the stage, multiple clones of the square box sprite are created. Thus, we will broadcast a message to delete the clone of the square box. Place a broadcast () block from the events palette.
  10. We will make a separate script to delete the clone while it will run parallel. Thus, drag and drop when I receive () hat block from events palette.
  11. And place delete this clone block from the control palette to delete the clone of the square boxes.
  12. Now, we need to come back to the original script.
  13. We need to store the data of the recognized persons.
  14. Thus, get an if block and check if the recognized faces are more than 0.
  15. Place a greater than operator block into the if condition. To check the number of faces, use the get # faces block from the face detection palette and place it into the first input of the greater-than operator. Write 0 in the second.
  16. Next, we need to make a variable.
  17. Click on Variable palette and then click on Make a Variable, name it as Face.
  18. Set the variable face to 0, inside the if block.
  19. Now we need to repeat the process of data logging for all the found faces, thus, place a repeat until () block, and add an () = () operator from the operator palette. Place the reporter block of Face variable in the first input. And get # of faces from the face detection into the second input.
  20. Now we will increment the variable face by 1 each time the repeat block is executed. Thus, add a change () by () block.

It’s time to store the data into the CSV file

  1. To store the data we will add blocks from the data logger extension.
  2. To store the timestamp, place a set the data 1 to () block and place the get current timestamp reporter block. The get current timestamp block contains all the date and time-related information.
  3. Now in the second data, we will store the class of recognized face which contains the name of a person whose face is recognized.
  4. Now that data has been loaded, but to permanently save the data onto the file we need to use the save data block.
  5. Place a create clone of () block and choose myself from the drop-down to recognize multiple people from the stage.

The final script will look like this.

Script for Face Recognition based attendance system

Step 6: Completing the Script

Finally, we will make the square box sprite to perfectly fit around the person’s face. Thus, let’s set its size and location accordingly.

  1. First, set the size of the square box by using the set size to () % block from Looks palette.
  2. Place get x-position of face reporter block inside it. And choose width from the drop-down. Add the Face Reporter into the space given.
  3. Next to move our Square box to the location of the object, thus add go to x() y() block from Motion palette. Next, insert two () of face () block and choose x position and y position from the respective blocks to obtain the X value and Y value of the face respectively.
  4. Finally, to display the class of recognized face which is the name of the person, get the say () for () seconds block from the Looks palette and make it say the class of the detected Face.
  5. Now that everything is perfectly aligned, place a show block.Making the attendance system

Click on the green flag to run the script. You can find the CSV file into the logger folder of PictoBlox.

Step 7: Conclusion

You can try making this project with your friends and can use the webcam to analyze your faces too.

With this, you can make face recognition based on the attendance system.

Code

DESCRIPTION DOWNLOAD CODE
Script for Attendance System based on Face Recognition Download

Virtual Doctor Using Natural Language Processing Extension in PictoBlox

Virtual Doctor Using Natural Language Processing Extension in PictoBlox

Table Of Content

Introduction

You feel a little unwell, who do you tell your symptoms first? (Except mom.) Google! Yes, you google the symptoms, find what is the thing that has made you unwell, and then you move on to find a remedy for the same.

In this project, we are going to make a virtual doctor using the NLP extension. You need to tell your symptoms to him and he will tell you what caught you and what shall you do next.

Wonder how will the virtual doctor figure the disease as many have a couple of symptoms same. Using NLP!

So let’s begin by understanding what NLP is.

Components Required

IMAGE COMPONENT QUANTITY AVAILABLE IN KIT
PictoBlox Download NOW

Building Guide

Step 1: What is NLP?

NLP stands for Natural Language Processing.

This is the area of AI concerned with the interaction between computers and humans in natural language. The aim of this extension is to help computers understand language as well as we do.

Along with the NLP Extension, there are a lot of new features added to the latest version of PictoBlox. You may need to download PictoBlox or update it to use the latest features.

Step 2: Setting the Stage for the Virtual Doctor

Open PictoBlox.

Let’s begin by setting up the stage.

  1. Delete Tobi’s Sprite.
  2. Click on Upload Sprite Button and upload the Doctor Sprite.Doctor Sprite
  3. Go to the Backdrop Palette, add the Blue Sky backdrop from the library.
  4. To get the hospital on the stage, Upload the image of hospital as the backdrop.Hospital Sprite
  5. You may find the one backdrop of Blue Sky and one of the hospital. Copy the hospital image and then paste it into the backdrop of Blue Sky.
  6. Adjust the placement of the hospital and doctor according to your choice.
  7. The final stage will look like this:Setting the stage for Virtual Doctor

You can download the sprites of doctor and hospital from here.

Step 3: Training the Text Classifier

Now that we have set the stage. Let’s begin by training the text data for diseases. We need to train PictoBlox to analyze the text and perform the corresponding action.

Add text data in classes

We will first add data i.e the symptoms for three diseases, COVID-19Malaria, and Diabetes one-by-one.

  1. Go to the My Blocks palette and create a block named Data for COVID-19.Text Classifier
  2. To make the text classifier, we need the Natural Language Processing extension. Add the Natural Language Processing extension from the extension library.
  3. Take the Data for COVID-19 hat block and drop an add () as () block below it.
  4. In place of text in the add () as () block, write the first command, “Dry Cough”. In place of class, write “COVID-19”. COVID-19 will be the name of the class.text classifier
  5. We’re going to give the classifier three more symptoms to add to our class. You can add many as you may find. Duplicate the add () as () block and write the rest of the symptoms in them.text classifier
  6. Now, we similarly need to add text training blocks for the other two diseases too.text classifiertext classifier

Training the Classifier

Now that we have added data in classes, we need to train our classifier.

  1. Create a block named Train Data.
  2. Take the Train Data hat block and add a reset text classifier block below it from the Natural Language Processing palette.reset text classifier block in NLP
  3. Add the Data for COVID-19, Data for Malaria, and Data for Diabetes stack blocks one after the other.
  4. Add a train text classifier block.Train text classifier block
  5. The script will look like this:Training Classifier using NLP

With this our text classifier for our virtual doctor is trained, it’s time to bring it into action.

To get step-by-step training for AI and ML, you can look into the Online Course for Artificial Intelligence for Kids.

Step 4: Final Script for the Virtual Doctor Using NLP

Let’s begin to write the script that to make the virtual doctor say the name of the disease we have after we tell him our symptoms.

  1. Add a when flag clicked hat block to run the script when the green flag is clicked.
  2. Drop the Train Data stack block below it.script for virtual doctor using NLP
  3. Let’s make the doctor greet us. Add a say () for () seconds block from the Looks palette. Write “Hello! Welcome to the virtual hospital” in the first space given.
  4. Next, we’ll want the doctor to ask the symptoms, thus from the Operators palette, add a ask () and wait block. Write “How are you feeling today? Please tell me your symptoms.” in the space given.Virtual doctor using NLP
  5. Here is when we will write the symptoms and the doctor will tell us the remedies for the same. Place an if () block into the scripting area.
  6. Add an () = () block from the Operator palette.
  7. Inside the first space of the () = () block, drop a get class of () block. In the second space, write “COVID-19”.Get class of block
  8. Inside the get class of () block, drop a answer block from the Sensing palette.
  9. This will check the symptoms you enter with the text data, and if they match with COVID class, the doctor will say out the disease as COVID-19.
  10. matching the symptom entered by patient with the train dataInto the if () arm place a say () for () seconds block.
  11. Place join () () block from the Operator palette.
  12. Write “You are infected with  ” in the first space. Add another join block in the second space. Drop a get class of () block into the first space of the second join block and write “.” to complete the statement in the second space. Inside the get class of () block, drop an answer block from the Sensing palette.Diagonising the dieases
  13. Now that we got to know the disease, doctor will say the remedy for the same. Place a say () for () seconds block from the Looks Palette and write the remedies into it. If you need to write more remedies, you can use another say block too.COVID diagonized and remedy
  14. With this diagnosis of COVID is done, we will now follow similar steps for Malaria and Diabetes. Duplicate the if block and make the changes respectively.Malaria diagonized and remedyDiabetesdiagonized and remedy
  15. With this our script is complete.Virtual doctor using NLP in PictoBlox

Press the green flag to start the script.

Step 5: Conclusion

To escalate the project instead of typing your symptoms you can use speech recognition blocks to recognize your voice and then diagnosis the diseases.

Code

DESCRIPTION DOWNLOAD CODE
Virtual Doctor Using NLP Download

Face-Recognition based Attendance System using Micro: bit

Face-Recognition based Attendance System using Micro: bit
Face Recognition Based Attendance System Using Micro: bit
ABOUT THIS PROJECT

Learn how to make Attendance System Based on Face-Recognition in PictoBlox using Micro: bit.

PROJECT INFO

Introduction

You might have seen a couple of attendance Systems around, but the one that we are going to make today is one-of-its-kind. In this project, we’re going to show you how to make a face recognition-based attendance system in PictoBlox AI using micro: bit.

We will use one of the buttons on micro:bit, i.e. button B to feed a new image into our system. To scan a face, we will use the other button – button A. Once the system matches the face detected with the sample image, it will display the name of that person on micro:bit’s LED matrix. and add the time stamp into an excel sheet.

Let’s begin.

 

Building Guide

Step 1: Prerequisites

To make this attendance system all you need is:

  1. A laptop or a computer
  2. Camera/Webcam
  3. The latest version of PictoBlox (Download the latest version from here)
  4. A good Internet connection.
  5. Micro: bit
  6. USB cable

Step 2: Setting Up the Project

  1. Open PictoBlox.
  2. To work with the latest extensions you need to keep two things in mind.
    1. That your computer is connected to the Internet
    2. You need to login to PictoBlox.
  3. Click on the Add Extension button and choose Face Detection extension and wait for a little while till the models get loaded.Face-detection Extension
  4. Now to log the timestamp of attendance, we need to add the Data Logger extension.
  5. Click on the Add Extension button again and choose Data Logger from the list. This extension lets you generate a CSV file according to your requirement and store data in it.data logger extension

Connecting the micro: bit with the computer:

  1. Connect your micro: bit using the USB cable to the laptop. Now, install the Scratch link from here.
  2. Click on the connect button and select the appropriate device.

Step 3: Setting Up the Stage

  1. Let’s first set up the stage. Click on the choose a backdrop button and select the backdrop of your choice. Here we will be using the blue sky backdrop for the same.
  2. Now, on pressing the green flag, the default backdrop that is the Blue sky backdrop should come, thus, place when flag clicked hat block from the Events palette and place switch backdrop to block below it. Make sure that Blue Sky is selected from the backdrop.
  3. Also, we first need the camera to be turned OFF, thus, from the Face detection palette, use the turn on video on stage with 0% transparency block and choose OFF from the dropdown menu.Setting Up the Project of Attendance System
  4. Now, we will make Tobi give instructions to the user.
  5. Thus, place a say block from the Looks palette.
  6. To mark the attendance, we need the user to press the Button A on the micro: bit. Thus write “Please press Button A to mark the attendance” in the space given.
  7. Now, to instruct the user to press Button B to feed the face, duplicate the say block and write “Please press Button B to mark the attendance” in the space given.Setting Up the Project of Attendance System
  8. Now we will create a new file to store the attendance data. From the logger palette, choose a create block we will give it a name “Attendance 2020”.

The final script looks like this:

Setting Up the Project of Attendance System2

 

Step 4: Making the Attendance System Store the Image

We will first write the script to store the sample images of whose attendance we need to track. Thus, let’s first recognize the image from the camera feed and store them in the computer’s memory. As soon as we Button B on the micro: bit the data should be stored on the computer’s memory.

  1. Thus, from the micro: bit palette drag and drop when the B button pressed block.Feeding the Face into the System
  2. To analyze the images from the camera, we need the camera to be ON. Thus, from the face detection palette, place a turn on video on stage with 0% transparency block.
  3. Next, we will make Tobi say, “Feeding the Face”, thus place a say block from the Looks palette.Feeding the Face into the System
  4. Similarly, we will display “Feeding…” on the LED matrix too, thus, from the micro: bit palette, place display text block and write “Feeding…” in it.display text block of Micro:bit
  5. Next, we will store the images of the user into memory. Thus, from the Face detection palette, place adds class 1 as stage block. Select 1 from the first drop-down and stage from the second. To identify the user as his/her name, write the user name into the space given.Feeding the Face into the System
  6. Once the face is added into the memory, we’ll make Tobi say “Face Added into the Database” using the say block from the Looks palette.
  7. Next, we need to turn OFF the camera and come back to the default backdrop. Thus, from the face detection palette, place a turn on video on stage with 0% transparency block, and choose OFF from the drop-down menu.
  8. Finally, to come back to the default backdrop, place switch backdrop to block from the Looks palette and choose Blue Sky from the drop-downFeeding the Face into the System

With this, the script to enter the face into the memory for our face-based attendance system is completed.Feeding the Face into the System

 

Step 5: Marking the Attendance into attendance system using Micro: bit’s button

  1. To execute the program, whenever the Button A is pressed on the micro: bit, thus, from the micro: bit palette, drag and drop when A button pressed hat block.Scanning the Face
  2. As we want to verify the image from the camera feed, we will make sure that the camera is on, thus add the turn on video block.
  3. Add a delay of 3 secs using the wait block from the controls palette.
  4. We need to match the faces on the stage thus, drag and drop the do Face matching on stage block.do face matching
  5. Now to store the data we will add blocks from the data logger extension. To store the timestamp, place a set the data 1 to block and drag and drop the current timestamp block into the space given. The get current timestamp block contains all the date and time-related information.
  6. Now in the second data, we will store the class of recognized face which contains the name of a person whose face is recognized.
  7. Now that data has been loaded, but to permanently save the data onto the file we need to use the save data block.
  8. Now, if the faces are matched, we need to print the name of the user on the LED matrix, thus, from the micro: bit palette, place display text block and drop the get class of face detected block in the space given.get class of face blockdisplay text bloc
  9. Also, we would like Tobi to inform the user that the Attendance is marked and greet. Thus, place a say block from the Looks palette and write Attendance Marked in the space given.
  10. Now to greet the user we want Tobi to say welcome along with the user’s name.
  11. Thus, from the Operators palette, place a join block, write “Welcome “ in the space in the first join block, drag and drop another join block into the second input. Place get class of face detected in the first input of the second join block and write “ !” in the second input of the second join block.Storing the Face into the Sheet
  12. Finally, let’s switch the backdrop to the default. Thus, place switch backdrop to and choose Blue Sky from the drop-down menu.Storing the Face into the Sheet

With this the script of our face-recognition based attendance system is complete.Scanning the Face

 

 

Code

DESCRIPTION DOWNLOAD CODE
Face Recognition Based Attendance System Using Micro: bit Script Download

DIY Mini Safe Locker Using Servo

DIY Mini Safe Locker Using Servo
DIY Mini Safe Locker Using Servo
ABOUT THIS PROJECT

Make your own DIY mini-safe locker using components from the evive Starter Kit and control it using evive’s slide switch!

PROJECT INFO

Introduction

A mini safe locker comes in handy when you want to keep your precious little belongings safe but also close to you(r heart). Though the ones used at homes require a) a LOT of metal b) next-level tech, what we’re making is our own version of the DIY mini safe locker that kids can use to keep their cookies safe from their siblings 😉

Components for making this safe locker are available in the evive Starter kit and it can easily be programmed in PictoBlox – our graphical programming software based on Scratch blocks. You can download it from HERE.

Ready for making your own safe locker? Let’s begin!

Components Required

IMAGE COMPONENT QUANTITY AVAILABLE IN KIT
evive 1
PictoBlox 1
Micro Servo Motor with Accessories 1

Building Guide

Step 1: Preparing the Box for the Safe Locker

For making the box for the safe locker, we first need to make a functional safe box that would help us store valuables in it. The box then needs a door, doorknob, and a locking mechanism.

We will start with how to make a safe locker with cardboard, but for now, we are going to make the safe box using the corrugated sheets.

Making the Top and Bottom of the Safe Box:

First, let’s make the top and bottom of the box.

  1. Take a yellow corrugated sheet of 30 cm * 15 cm and make a line at the center of the sheet and
  2. Now cut along the markings we would get two sheets of 15 cm * 15 cm each of which would act as the bottom and top of our safe box.Mini Safe Box making (2)

Making the Sides of the Safe Box:

The next step would be making walls for making the safe locker.

  1. For making the four walls, take a red corrugated sheet of 60 cm * 15 cm.
  2. Mark three lines on a red corrugated sheet at every 15 cm we would now get four equal squares each of these squares of dimension 15 cm*15 cm.Mini Safe Box making (3)
  3. Next, cut through the first layer along all the three lines designed, which makes the sheet easily foldable, thus removing the mess of gluing the walls together to make the wall of the safe box.Mini Safe Box making (4)

Making the Door of the Safe Box: 

We would need a door to access the valuables inside of the safe box.

  1. Thus, mark a square of 10 cm *10 cm inside the last square on the red corrugated sheet on which we have marked the walls.Mini Safe Box making (5)
  2. Cut along the three sides of this 10 cm * 10 cm square, but make sure not to completely cut through the fourth side.
  3. Create a slit on the fourth side through the first layer, this will give the door, a hinge structure to make the opening and closing of the door smooth.Mini Safe Box making (1)

The door is done!

Making the Door Handle

To open and close the door easily we would make a small doorknob or the door handle.

  1. Take a circle master and mark a small circle on a piece of corrugated sheet of approximately 5 cm diameter.Mini Safe Locker Making (2)
  2. Cut out the circular disk for a knob.
  3. Take a straw and cut a 1 cm tube from it for making the shaft of the doorknob.
  4. Take this straw piece and attach it to the doorknob, with this our door handle is ready.Mini Safe Locker Making (3)

Thus, the different components of the Safe box are ready!

Step 2: Designing the Interlocking Mechanism

We are going to use the servo as the main element of our Interlocking mechanism. Where a part of the door gets hooked to the servo horn thus keeping the door of the safe locker closed. Thus, let’s make the structure that will interlock with a servo motor.

  1. Take another small strip of a corrugated sheet of about 10cm * 4cm size and mark the two lines at an equal distance from one another.
  2. Now fold along the markings and by using some hot glue make sure the bends hold its shapes and all the bends are perfectly perpendicular.Mini Safe Locker Making (4)

Once done, keep it aside.

Step 3: Assembling the Mini Safe Locker

We will start assembling the components of the safe box that we have prepared.

  1. Take one of the two yellow 15cm * 15cm sheets which would act as the bottom and now attach the 3 walls of the safe perpendicular to it. Make sure to keep the fourth side open.Mini Safe Locker Making (1)
  2. Also, attach the door handle assembly we have prepared above near the opening edge on the fourth side using the hot glue.Locker Interlocking Mechanism (2)

Step 4: Completing the Interlocking Mechanism

This interlocking mechanism will provide security to our safe locker.

  1. Thus, take the U-shaped piece of corrugated sheet and attach it at the back of the door exactly behind the door handle using hot glue.Locker Interlocking Mechanism (3)
  2. The servo motor acts as the actuator which controls the locking mechanism.

But before attaching servo, we would set the angle to 90 degrees by using the evive firmware menu.

Setting the servo angle

Setting the servo angle has never been this easy, the plug and play feature of evive. Just follow the steps:

  1.  Attach the servo to evive’s servo channel 2Conenction Servo for Mini Safe Locker
  2. Switch ON evive.
  3. From the menu, select Controls
  4. Navigate to Servo
  5. Than select Servo 2
  6. Use potentiometer 2 to set the servo angle to 90°

Disconnect the servo.

Attaching the Servo Motor

Before we attach the servo motor, let’s first attach servo horns to it which will hook the U-shaped structure in it.

  1. Take one single-sided and one double-sided servo horn and fix them both to servo motor using a 20mm servo screw.Locker Interlocking Mechanism (5)
    evive Notes Icon
    Make sure not to disturb the servo angle while attaching the horn.
  2. Attach the servo motor to the door frame using some hot glue such that it interlocks with U- shaped corrugated sheet that we attached on the inside of the door.Locker Interlocking Mechanism (1)
  3. Once done, close the fourth side by applying some hot glue to the edges of the fourth side.Mini Safe Locker Using Servo (2)

With this most of the assembly is done but we need to make sure if our locking mechanism works properly or not before sealing off the top.

Step 5: Checking Whether our Locker Works Perfectly?

Once again, connect the servo motor to the servo channel 2 or s2 channel on the evive.Conenction Servo for Mini Safe Locker

Upload basic PictoBlox code by using the PictoBlox to the evive.

Use the slide switch 1 on the evive to lock and unlock the door of the safebox.

Step 6: Completing the Assembly of the Safe Locker

Now when we are sure that mechanism in our safebox works perfectly as we tried locking and unlocking the safe box. We will close the safebox by attaching the top.

Take the other yellow corrugated sheet of 15cm*15cm and close of the top of the safe locker using some hot glue.Mini Safe Locker Using Servo (1)

With this, the assembly and the connection of the safe box are ready!

Step 7: Writing the PictoBlox’s Code

Our safe locker will be operated with the help of a slide-switch of evive. Let’s write the code in PictoBlox.

  1. The program starts executing forever when evive starts up.
  2. When the slide-switch is pushed up, the servo angle changes to 100° which results in freeing the U-shaped structure which in turn opens the door.
  3. When the switch is at the center position or down position, the servo angle changes to or remains at 0° and the U-shaped structure gets hooked up to the servo horns thus the door remains locked.Safe Locker Code

Step 8: Making the Safe Locker Password Protected

For the advanced version, we will create a code using pictoblox which will help us open and close the locker only after entering a two-digit password for the safebox.

  1. The code, as usual, begins when evive starts up. We will set the password in the code itself.
  2. When slide switch is in the down position we would be allowed to enter the password by using the potentiometer 1 the display would show the entered password in real-time and access status of the door.
  3. As we are going to enter the password using the potentiometer, which gives a value between 0 to 1023 and we need our password to be any number between 0 to 100.
  4. Thus, we are going to use the map function for the same. Once the values are mapped, we need to check whether the slide-switch is up or not and if the value entered by us is similar to the password.map function block
  5. If yes, then the servo angle changes to 100 degrees thus unlocking the door. And “Access Granted” is displayed on evive’s screen.
  6. If no, the servo angle is set to 0 degrees and the door is locked and TFT displays “Access Denied”.Safe Locker Code 2

Step 9: Conclusion

With this, your DIY mini-safe locker is ready!

Circuit Diagram

DESCRIPTION CIRCUIT DIAGRAM
Attach the servo to evive’s servo channel 2

Code

DESCRIPTION DOWNLOAD CODE
PictoBlox Code Download
Password Protected Safe Locker Code Download
Arduino Code for Password Protected Safe Download

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!