Face With Animatronic Eyes, Motion Detection and Voice

by MertArduino in Circuits > Arduino

8515 Views, 136 Favorites, 0 Comments

Face With Animatronic Eyes, Motion Detection and Voice

The Face

Are you ready to create something both eerie and captivating? This project combines 3D printing, servo motors, a PIR sensor, and a DFPlayer MP3 module to bring to life an animatronic Squid Game boss face. With Halloween right around the corner, this DIY project is the perfect spooky addition to your home or event. The face's animatronic eyes move in response to motion detection, and a haunting sound is played, making it both visually impressive and interactive.

This project is a great starting point, especially for those who want to control eye movements and play certain audio files. By coordinating the movements detected with the help of the PIR sensor, the movement of the servo motors, and the audio playback of the DFPlayer, you can achieve a great animation.

3D Printed Parts

Ekran Resmi 2024-09-29 07.36.25.png
Ekran Resmi 2024-09-29 07.36.41.png
Ekran Resmi 2024-09-29 07.39.35.png

The animatronic eye parts and the mask itself were printed using a standard 3D printer with PLA filament. The parts were printed with medium quality, but for those wanting a more polished look, feel free to sand and paint the pieces for a smoother finish.

3D Printed Components:

  1. Mask (Face)
  2. Two eyeballs
  3. Two eyelids
  4. Servo holder (to hold all 5 servos in place)
  5. Universal joints (to enable smooth movement for the eyes)
  6. Two bars to support the mask’s internals
  7. A backplate to cover the electronics and allow for easy wall mounting

Feel free to use different colors for the eyes or even hand-paint them after printing. The universal joints play a critical role in the smooth motion of the eyes, allowing them to mimic realistic movements.

Assembling the Animatronic Eyes

Ekran Resmi 2024-09-30 11.47.30.png
Ekran Resmi 2024-09-29 07.37.20.png
Ekran Resmi 2024-09-29 07.36.59.png
Ekran Resmi 2024-09-29 07.37.59.png
Ekran Resmi 2024-09-29 07.38.57.png
Ekran Resmi 2024-09-30 11.45.25.png
Ekran Resmi 2024-09-30 11.45.39.png
Ekran Resmi 2024-09-30 11.45.51.png
Ekran Resmi 2024-09-30 11.46.06.png
Ekran Resmi 2024-09-30 11.46.19.png
Ekran Resmi 2024-09-30 11.46.31.png
Ekran Resmi 2024-09-30 11.46.56.png
Ekran Resmi 2024-09-30 11.47.13.png

Now that we have the 3D printed parts, it’s time to assemble the animatronic eyes. For this, we’ll use five MG90S servo motors to control both the eyelids and the eyes' movement. Here’s what you’ll need:

Components:

  1. 5x MG90S Servo Motors
  2. Metal wire (we used a few paperclips to form the connecting rods)
  3. Pliers and wire cutters (for shaping and cutting the paperclips)

Assembly Process:

  1. Center the Servos: Make sure all servos are positioned at 90 degrees to start. This is critical to ensure the movements are calibrated properly.
  2. Mount the Servos: Place each servo into the 3D printed servo holder. Two servos will control the left-right movement of the eyes, two for the up-down movement, and one for the eyelid.
  3. Attach the Eyes: Connect the servos to the eyes using the paperclip wires, shaped into linkage rods. This will transmit the servo’s rotation to the eye movement. Universal joints are added to ensure the eye movements are smooth.
  4. Attach the Eyelids: The final servo will control the eyelids, giving your mask the ability to blink or close its eyes. The same wire and paperclip method is used to attach the eyelids to the servo.

Animatronic eyes move thanks to the servos manipulating them in two axes (up-down and left-right). Each eye's movement is controlled by two servos, while the eyelids are controlled by a single servo for opening and closing.

Testing the Animatronic Eyes

Ekran Resmi 2024-09-30 11.48.56.png
Ekran Resmi 2024-09-29 07.40.37.png
Ekran Resmi 2024-09-30 11.48.23.png
Ekran Resmi 2024-09-30 11.48.45.png
Ekran Resmi 2024-09-30 11.49.16.png

Before we move on to the rest of the project, it's important to test the animatronic eyes to make sure everything is working correctly. Here’s a simple circuit setup for testing:

  1. Connect the servo motors to a breadboard.
  2. Upload a simple servo control code that moves the eyes in all directions and blinks the eyelids.

Upload shared code using the Arduino IDE, and observe the movements. You can adjust the angles and delay times to fit your needs.

Servo Motor Connections

The first part of our setup involves wiring five servo motors to the Arduino Nano. These servos will control the following movements:

  1. Servo1: Horizontal movement of the left eye.
  2. Servo2: Vertical movement of the left eye.
  3. Servo3: Controls the eyelids.
  4. Servo4: Vertical movement of the right eye.
  5. Servo5: Horizontal movement of the right eye.

Here are the IO pin assignments:

  1. Servo1: Digital 2
  2. Servo2: Digital 3
  3. Servo3: Digital 5
  4. Servo4: Digital 6
  5. Servo5: Digital 9

Make sure your servos are powered by an appropriate external power source, as the Arduino’s onboard 5V supply is insufficient for powering multiple servos.

Code Explanation: The servo control code utilizes the Servo library to manage the movements of each servo. It defines specific angles for left and right movements, as well as up and down for the eyelids. The setup initializes each servo, sets the initial position, and includes a loop that allows for smooth transitions between the defined angles. The eye movements are triggered based on the conditions set in the code, ensuring the animatronic eyes behave as intended.

Printed Circuit Board

Ekran Resmi 2024-09-30 11.49.37.png
Ekran Resmi 2024-09-28 19.26.17.png
Ekran Resmi 2024-09-28 19.27.35.png
Ekran Resmi 2024-09-16 13.33.59.png
Ekran Resmi 2024-09-28 19.27.03.png

A printed circuit board (PCB) was designed to integrate all components, including the DFPlayer, PIR sensor, servo motors, speaker, and Arduino Nano. The goal is to create a more stable circuit and prototype.

  1. Arduino Nano (main controller)
  2. DFPlayer MP3 module (for sound)
  3. PIR sensor (motion detection)
  4. 5x servo motor inputs
  5. Speaker for audio output

PCBWay was chosen for the PCB fabrication. You can find the Gerber file and circuit diagram for PCB fabrication at this link: https://www.pcbway.com/project/shareproject/The_Face_maker101_c4124445.html Also, if you have no soldering experience, you can use PCBWay's assembled PCB service.

I also participated in PCBWay's 7th design contest, if you want to support the project, you can vote for the project from the same link. Thank you.

The component list includes capacitors for power requirements, resistors for servo motor digital inputs, terminal blocks for the sensor and speaker, and female and male headers for the DFPlayer and Arduino Nano.

  1. Resistors and capacitors (for power regulation)
  2. Terminal blocks (for the sensor and speaker connections)
  3. Male/female headers (for the DFPlayer, Nano, and servos)

I soldered all the components in place using a soldering iron and solder wire. This setup ensures that the entire project runs smoothly and that the wiring doesn’t get messy.

Main Code for the Face

Ekran Resmi 2024-09-28 19.30.35.png
Ekran Resmi 2024-09-30 11.52.27.png
Ekran Resmi 2024-09-30 11.52.44.png
Ekran Resmi 2024-09-30 11.53.05.png

Integrating the PIR Sensor and DFPlayer

Now that everything is assembled, it’s time to upload the main code into the Arduino Nano. This code integrates the PIR sensor, servo motors, and the DFPlayer MP3 module. The idea is simple: when the PIR sensor detects motion, the servos will move to open the eyelids and make the eyes move while the DFPlayer plays a sound.

Key Components of the Code:

  1. The PIR sensor triggers when it detects motion.
  2. The DFPlayer plays a sound file stored on an SD card.
  3. The servos control the eye and eyelid movement.

DFPlayer Mini and Speaker Setup

The DFPlayer Mini is a simple, low-cost MP3 player that can play audio files stored on a microSD card. In this project, it will play a sound file when motion is detected by the PIR sensor.

  1. Connect the RX pin of the DFPlayer to Digital 11 and the TX pin to Digital 10 on the Arduino Nano.
  2. Attach a speaker to the SPK+ and SPK- pins of the DFPlayer for sound output.

PIR Motion Sensor Connection

  1. The PIR sensor will detect motion and trigger the servo movements and audio playback.
  2. Connect the PIR sensor’s output pin to Digital 7 of the Arduino Nano.

Use a 9V external power supply for the circuit to ensure stable performance. Once the wiring and coding are complete, it’s time to test your project.

  1. Upload the code to your Arduino Nano.
  2. Ensure the PIR sensor is placed in a location where it can easily detect motion.
  3. When the PIR sensor detects movement, the servos controlling the eyelids should open, and the DFPlayer should play the pre-loaded sound file.
  4. The servos will then make the eyes move in a coordinated sequence.

Code Overview: The main code utilizes the DFPlayer library to control audio playback while coordinating with the PIR sensor's output. When motion is detected, the code triggers the servos to move the eyes and simultaneously starts the audio file. This synchronization enhances the effect, making the animatronic eyes appear more lifelike and engaging. The code efficiently handles various scenarios, ensuring seamless transitions between eye movements and sound playback.

Note: The attached file “1.mp3” contains the sound “I see you” used in the project. Simply upload the audio file to the SD card (SD card format must be FAT32)

Final Assembly

Ekran Resmi 2024-09-30 14.58.37.png
Ekran Resmi 2024-09-30 11.53.27.png
Ekran Resmi 2024-09-30 11.53.35.png
Ekran Resmi 2024-09-30 11.53.47.png
Ekran Resmi 2024-09-30 14.57.56.png
Ekran Resmi 2024-09-30 14.58.10.png
Ekran Resmi 2024-09-30 14.58.16.png
Ekran Resmi 2024-09-30 14.58.23.png
Ekran Resmi 2024-09-30 14.58.48.png

Now it’s time to put everything together in the mask. Follow these steps:

  1. Insert the Bars: Attach the two support bars to the back of the mask.
  2. Mount the Servo Holder: Secure the servo holder (with the servos and eyes attached) to the bars using hot glue.
  3. Install the PIR Sensor: Drill a small 6mm hole in the front of the mask to place the PIR sensor. It’s a mini PIR sensor, so it fits perfectly into the hole.
  4. Place the Speaker: Position the speaker inside the mask, ensuring it’s hidden from view.
  5. Attach the PCB: Secure the PCB inside the mask and make all the necessary connections.
  6. Seal the Mask: Once everything is connected and in place, use the back cover to enclose the electronics.

Finally, mount the mask on the wall using double-sided tape or other methods. Power the mask using a 9V power supply, and you’re all set!

This project combines creativity, technology, and a bit of spookiness, making it perfect for the Halloween season. With a few tweaks, you can customize this mask to your liking, adding different sounds or even more complex eye movements. Happy making!

An extra idea, add LED lighting: If you want to make your project even more engaging, you can add LED lights that turn on when motion is detected, enhancing the visual effect.