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

DescriptionDownload Code
Face Recognition Based Attendance System Using Micro: bit ScriptDownload
Share this Project
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Featured Projects
All articles loaded
No more articles to load