Introduction: Make a Face Mask With Animations

About: Maker 101; Beginner and intermediate level Maker projects! You can find projects such as "How to" and "DIY" on programmable boards such as Arduino, ESP8266, ESP32 and Raspberry Pi on this channel. The projects…

Let's make a Face Mask with LEDs! This DIY LED lights face mask displays some animations and responds to your voice with effects. You can have a mask that reacts to the sound using the sound sensor, or you can make different light animations by not activating the sensor.

Step 1: Watch How It Works?

As you can see in the video, I made a very simple LED light face mask that is not complicated. Of course, you can easily change these animations because we used a programmable LED strip in the mask. The design and animations of the face mask depend on your imagination. I just tried to show "how to do it?".

Step 2: Let's Get the LEDs Ready for the Face Mask

I have an addressable LED. What that really means it's just that in a normal LED strip when you power it all the LEDs light up at the same time. But an addressable LED powers up based on what you input to it from a microcontroller and you can tell LED number one to light up in one color and LED number ten to light up in another color. Also I have is something copper tape. I'm gonna use that for the positive and the ground connections. Finally we're gonna need to mount all that onto this little piece of cardboard and later that will be inserted into the facemask. Because we need to be able to take out the LEDs otherwise we can't wash the facemask.

The components required for the face mask are as follows:

WS2812 5V LED Strip - http://bit.ly/2YoWKmh

Copper Tape - http://bit.ly/36cDb5h

Face Mask - http://bit.ly/3oktBDi

Wire Cable - http://bit.ly/3qRI3of

Plier - http://bit.ly/2Gbl6aq

Soldering Tool Kit - http://bit.ly/2D6YbuC

Solder Wire - http://bit.ly/36escZ0

  • Place two strips of copper tape on the cardboard. One of the copper tape strips will be used to connect the positive legs of the LEDs and the other to connect the negative legs.
  • Cut your LED strip from the connection points (make sure the number of LEDs according to your mask size).
  • Place the LED strips you cut out on the cardboard. The most important point here is Din and Do points on the LED strip, the LED strip array should be placed as Din - Do, Din - Do. So if one end of the LED strip is Din, the other LED strip must be connected to the Do end for the signal to continue. Please see the video.
  • After placing the LED strips, make the connections. The negative (GND) points of the LED strips must be common and the positive (5V) points must be common. Copper tape will make it easier for you to make these common connections.
  • Finally, connect a jumper wire to each output to connect to the microcontroller.

Step 3: Tiny Microcontroller ATtiny85

I will try to use an ATtiny85 board to control LED strips. Because I want the project to be minimal. In the prototype we will use sound sensor, ATtiny board, 9 volt battery and some wires.

The components required for the prototype are as follows:

ATtiny85- http://bit.ly/2YhUX2p

Sound Sensor - https://bit.ly/3fuZoP7

Battery Connector - http://bit.ly/2M8PZCC

Jumper Wire - http://bit.ly/2pBD9BQ

Soldering Tool Kit - http://bit.ly/2D6YbuC

The necessary input-output pins we will use from the microcontroller:

  • In this section, we will do the soldering process again. We will need to solder 2 jumper wires to the 5V output of the microcontroller to use it in the sound sensor and LED strips.
  • Solder 3 jumper wires to GND output to use on sound sensor, LED strip and 9V battery.
  • Solder 1 jumper wire to VIN input to use in battery.
  • Solder a jumper wire to P1 and P2 pins that will be used for the sound sensor and LED strips.

Now let's connect all the components:

  • Connect the 5V input wire of the LED strip (red wire connected to the copper band) to the 5V wire on the microcontroller.
  • Connect the GND input wire of the LED strip (black wire connected to the copper band) to the GND wire on the microcontroller.
  • Connect the Din input wire of the LED strip (blue wire connected to the copper band) to the P1 wire on the microcontroller.
  • Connect the 5V input of the sound sensor to the 5V output of the microcontroller.
  • Connect the GND input of the sound sensor to the GND output of the microcontroller.
  • Connect the IN of the sound sensor to the P2 output of the microcontroller.
  • After uploading the source code, the battery VIN and GND connections will be made.

Step 4: Let's Make the Prototype Smaller and No Wires

I also designed a PCB for this project. Because in the prototype we will use sound sensor, ATtiny85 board, 9 volt battery and some wires, but only one 3.7 volt li-po battery will be used with the PCB. I used Atmega329P microcontroller on the PCB, added 3 outputs for the LED strip. I added a tiny microphone to avoid using an external sound sensor. So you can think of the sound sensor as embedded.

If you use the prototype, an extension wire will appear for the battery, but if you use the PCB, you can keep everything in a mask.

Finally, one FTDI USB To TTL module is required to program the PCB.

This may take some experience, so if you want this PCB, you can find the details here:

https://www.pcbway.com/project/shareproject/Make_a_Face_Mask_With_Animations.html

I have prepared a different source code for Atmega328, you can find the source code here:

https://github.com/MertArduino/Making-a-Face-Mask-with-Animations

Some necessary components for PCB:

FTDI USB To TTL - http://bit.ly/2RL89st

Digital Microscope - http://bit.ly/3iKHpWO

Hot Air Tool - http://bit.ly/2QFd1z0

Soldering Tool Kit - http://bit.ly/2D6YbuC

Solder Wire - http://bit.ly/36escZ0

Tweezer - http://bit.ly/3og8suc

SMD LED - http://bit.ly/2MqP3JT

SMD Capacitor - http://bit.ly/39jqpDL

SMD Resistor - http://bit.ly/3pm5YeW

JST Connector - https://bit.ly/2yXfJeI

3.7v Lipo Battery - http://bit.ly/2ECTdL7

Programming the ATmega328:

  • Connect the FTDI USB To TTL module to the PCB.
  • Then open the source code in Arduino IDE.
  • Go to Board and select Arduino Pro or Pro Mini
  • Go to Processor and select ATmega328P (3.3V, 8 MHz).
  • Select Port and upload the code.

Step 5: Programming the Face Mask

To use ATtiny85, we will need to follow some steps just once.

Installation Instructions:

  • Note: If you already have additional URLs entered in that box, then click the button on the right of the box and enter this URL on a new line.

  • Go to the “Tools” menu and then the “Board” submenu - select “Boards Manager” and then from the type drop down select “Contributed”:

  • Select the “Digistump AVR Boards” package and click the “Install” button.

  • You'll see the download progress on the bottom bar of the “Boards Manager” window, when complete it will show “Installed” next to that item on the list.

  • WINDOWS USERS: When complete the install with pop up a Driver Install Wizard window, please click “Next” on this Window to install the drivers for Digistump Boards (If you already have them installed, this installer will update them and install any that are missing)

  • With the install complete, close the “Boards Manager” window and select the Digispark from the Tools→Boards menu. “Digispark (Default - 16.5mhz)” is the board that should be selected by all new users.

  • The install is now complete!

Get the Source code for ATtiny85:

https://github.com/MertArduino/Making-a-Face-Mask-with-Animations

Using with the Arduino IDE:

  • From the Tools menu select Board→Digispark (Default - 16.5Mhz)
  • (The Tools→Programmer selection does not matter)
  • Open your code
  • You do not need to plug in your ATtiny85 before invoking upload
  • Hit the upload button. The bottom status box will now ask you to plug in your ATtiny85 - at this point you need to plug it in - or unplug and replug it.
  • You'll see the upload progress and then it will immediately run your code on the ATtiny85.
  • If you unplug the ATtiny85 and plug it back in or attach it to another power source there will be a delay of 5 seconds before the code you programmed will run. This 5 second delay is the ATtiny85 checking to see if you are trying to program it.

Pin outs:

All pins can be used as Digital I/O

Pin 0 → I2C SDA, PWM (LED on Model B)

Pin 1 → PWM (LED on Model A)

Pin 2 → I2C SCK, Analog In

Pin 3 → Analog In (also used for USB+ when USB is in use)

Pin 4 → PWM, Analog (also used for USB- when USB is in use)

Pin 5 → Analog In

Step 6: LED Face Mask Ready

We have completed the project, you can have a mask that reacts to the sound using the sound sensor, or you can make different light animations by not activating the sensor.

If you encounter a problem, you can reach me from the links below:

YouTube channel - https://bit.ly/MertArduino
Instagram - https://www.instagram.com/mertarduino/

Twitter - https://twitter.com/mert_arduino

PCB Challenge

Participated in the
PCB Challenge