The Compliment Enchanter

by vicenzobit in Circuits > Gadgets

294 Views, 7 Favorites, 0 Comments

The Compliment Enchanter

The Compliment Enchanter.png
gif1.gif
gif2.gif

Hi! I'm VicenzoBit, a 15-year-old maker who enjoys creating unique projects that mix technology and creativity. One thing that happens to me every morning is that I wake up on the wrong foot. You know, those mornings when nothing seems enough: not the insistent alarms, not the hot coffee, not even the "five more minutes" method. Simply getting up and starting the day in a good mood feels like an impossible mission.

It was on one of those grey days that it occurred to me: what if the first thing I heard in the day wasn't an alarm or a reminder of what I had to do, but something nice? Maybe a compliment, a motivational quote or even a little joke to make me smile. That's how the idea for The Compliment Enchanter was born.

What is The Compliment Enchanter?

The Compliment Enchanter is a bot designed to boost your mood with random compliments. Imagine waking up to phrases like:

• "Today you are as bright as the sun after the rain!"

• "Did you know that the world is better just because you are here?"

• "That idea you had yesterday was just brilliant!"

This little device uses basic electronics and programming to generate compliments that can be played back or displayed on a screen. My goal with this project is not only to solve a personal problem (lack of morning spirits), but also to inspire others to find creative and fun solutions to everyday challenges, no matter how simple. that they are.

Why did I do this project?

I'm one of those who believe that small things have the power to change how you feel. Sometimes, what you need isn't a stronger coffee or a stricter routine, but something that reminds you that you have value, that you can handle whatever comes your way, and that, well, the world isn't so bad after all. This robot is my attempt to capture that little positive spark and make it accessible whenever you need it.

How does it work?

The Compliment Enchanter is easy to use: using its motion sensor, the device detects your presence and after “waking up” selects a random pre-recorded compliment from a list and plays it through a Bluetooth speaker. The idea is that you can customize it to whatever motivates you the most: do you want inspirational quotes? A touch of humor? Something absolutely ridiculous? Anything is possible.

Why should you build one?

If you've ever felt like me in the mornings, or know someone who needs a little pick-me-up, this project is for you. Plus, it's a great way to learn basic electronics and programming while creating something that can really make people smile.

In this Instructable, I'll walk you through the step-by-step process of building The Compliment Enchanter. I'll show you what materials you need, how to program it, and even how to customize it with your own unique phrases.

Ready to brighten up your mornings (and everyone else's)? Let's build it together!

Supplies

  1. Unihiker x1
  2. PIR motion sensor x1
  3. Dupont cables (various) x1
  4. Bluetooth speaker x1
  5. USB-C cable with power adapter x1
  6. 3D printed case x1
  7. Hot silicone x1

Design the Case

1210.gif

To start, we will design a custom case in Tinkercad. You have complete creative freedom to adapt it to your style or needs if you decide to replicate this project.

In my case, since I wanted to place The Compliment Enchanter on a mirror, I was slightly inspired by Snow White's "magic mirror . " That's why my design has an elegant oval shape, which complements the place where I'm going to use it.

Once you have your design ready, export the file in STL format to 3D print it.

3D Printing

gif4.gif

With the design finished, export the file in STL format and load it into a slicing software such as Cura. Set the print to 0.2 mm layer height and 15%-20% infill.

If your design has suspended parts, activate supports to prevent warping. Use PLA or PETG as material, as they are easy to work with and durable.

Once printed, carefully remove the supports and sand down any rough areas if necessary. Your case is ready for assembly!

Assembly

1210(1) (1) (1).gif

With the case ready, it's time to mount the components. If you decided to replicate my design, follow the images for guidance and to make sure everything fits together properly.

First, fix the Unihiker plate and the PIR motion sensor into the housing using hot glue. Make sure the sensor is aligned with the corresponding hole so that it can detect motion without any problems. Connect the PIR sensor to the Unihiker:

• Data pin: to pin 24.

• VCC: to VCC pin.

• GND: to the GND pin.

Once everything is connected and secured, your Compliment Enchanter is almost ready to go!

Programming

cat.gif

The programming of The Compliment Enchanter will be attached here so it does not require you to write code from scratch. Your main task will be to upload this material to the Unihiker board so that the device works properly.


import time
import random
from unihiker import Audio, GUI
from pinpong.board import Board, Pin

# Basic configuration for pinpong
Board().begin()

# Initialize modules
audio = Audio()
gui = GUI()
sensor_pin = Pin(Pin.P24, Pin.IN)

# Screen dimensions
SCREEN_WIDTH = 480
SCREEN_HEIGHT = 320

def show_image(image_name):
"""Displays an image in full screen."""
gui.clear()
gui.draw_image(x=0, y=0, w=SCREEN_WIDTH, h=SCREEN_HEIGHT, image=image_name)

def play_random_compliment():
"""Plays a random compliment audio."""
compliment_number = random.randint(1, 20)
audio_file = f"Audio{compliment_number}.mp3"
audio.play(audio_file)

def play_flowers_audio():
"""Plays the special audio for the flower message."""
audio.play("FlowersAudio.mp3")

def play_dance_audio():
"""Plays the dance audio."""
audio.play("dance.mp3")

def main():
"""Main function to handle the device logic."""
while True:
# Wait for sensor activation
if sensor_pin.read_digital() == 1:
# Show sleeping image
show_image("sleeping.png")
time.sleep(4) # Wait for 4 seconds

# Transition to "waking up"
show_image("unsleeping.png")
time.sleep(4)

# Show "talking" image and wait before playing audio
show_image("talking.png")
# Decide whether to play the special audio or a compliment
if random.random() < 0.1:
# Show flowers and play special audio
show_image("flowers.png")
play_flowers_audio()
time.sleep(5) # Time to appreciate the special message
else:
# Play random compliment
play_random_compliment()
time.sleep(5) # Time to appreciate the regular message

# Show final message
show_image("message.png")
play_dance_audio()

# Return to sleeping state
show_image("sleeping.png")
time.sleep(15) # Wait 15 minutes before the next activation

if __name__ == "__main__":
main()


To get started, download the zip file containing the code, audio, and images from the project page. Make sure to unzip it on your computer to access the files. Then, connect the Unihiker board to your computer using a USB-C cable and open your programming or file management tool of choice. While I used MindPlus in my case, you can also use the Unihiker web interface or another tool that allows you to easily transfer files.

With the board connected, upload the provided code to the device. Make sure to also include the .mp3 audios and .png images, as these are essential for the Compliment Enchanter to work as expected.

Once the code and files are on the board, it's time to set up the Bluetooth connection. This will allow the compliments to be played on an external speaker, making the experience more interactive. To do this step we must establish a connection via console with the board, so it is impossible to deal with it in one step, that is why I attach this tutorial from the community which is super clear.

Whenever the sensor detects motion, the device will select a random message and play it through the speaker. Just follow these steps, and in a matter of minutes you'll have a compliment machine ready to brighten your days!

Note: I have tried to comment the code to make it as understandable as possible, likewise if you do not understand something of it or have any problem you can consult it in the comments or go with the reliable ChatGPT

Placement on the Surface You Want

1210(2).gif
1210(3).gif

Glue your device with hot silicone as shown in the image so that it remains fixed and easy to see every morning. Connect the power cable in the same way as in the image

Operation

An ordinary morning with The Compliment Enchanter

Compliment Enchanter is ready to brighten up your mornings. You just need to walk past the sensor, and the device will surprise you with a compliment. In fact, there are several surprises hidden within the code, for example. When our Compliment Enchanter is in a good mood, it can even give us a bouquet of flowers. That's right. Virtually, of course. But I assure you that it will boost your self-esteem.

Now every day can start with a smile!


What's next?

This is where your creativity takes over! I encourage you to explore the possibilities that The Compliment Enchanter can offer: experiment with new features, customize the design, or even take the project to the next level by integrating technologies like AI or IoT. The possibilities are endless, and this device is just the beginning.

Also, you don't have to do it alone. Share your ideas, questions or suggestions in the comments, as they are always welcome. Your participation may inspire others to innovate or improve the project even further.

Thank you very much for following me to the end of this instructable. See you in the next project! 👋🤖


#Writtenbyahuman