MoodBox Keychain

by wijdanmkh_insk in Circuits > Wireless

46 Views, 1 Favorites, 0 Comments

MoodBox Keychain

WhatsApp Image 2025-05-13 at 13.34.50.jpeg

Fidgeting with home key is something I often do when I bored, whether I'm walking alone, waiting in line, or just sitting on public space waiting for someone. Sometimes, I find myself admiring one of my keychains I made a year ago with Half-Life chibi theme. At first, I like to stare it for long, wishing its eyes could blink to me, just once. Then there's something hitting me. I want something better than this, something that can interact with me by changing expressions and doing even more, and also being a badge attached to my backpack, to show that I'm proud for being an Electrical Engineering student without saying any words or wearing special attire, even I hate the reality at first. This thought sparked the idea of making a MoodBox Keychain


MoodBox is a small robot made from ESP32 C6 for compact size, attached to 250 mAH battery with DHT11 to detect the environment temp and humidity, and SSD1306 to shows environment information. This robot were inspired from Dasai Mochi, a robot that can interact with vehicle acceleration changes. MoodBox uses RTC Time, requires you to connect it to Wi-Fi to fetch the time data and then disconnects it automatically if time data had been fetched successfully.


Note that MoodBox is a prototype and it's still in development. To check the project updates, you can check it on my github.

Supplies

WhatsApp Image 2025-05-13 at 13.30.25.jpeg

To make this keychain, you'll need these following supplies :

  1. ESP32 C6 for compact size for keychain. I'm using DFRobot version, so I can connect the battery directly to the board and supports charging.
  2. 3 Pcs of 10K resistors, 2 pcs used as voltage divider and 1 pcs used as button pull up resistor
  3. SSD1306 (0.96 inch) Display
  4. 3.7V Lithium battery
  5. Button
  6. Breadboard for prototyping
  7. Jumper cables
  8. 3v3 Zener diode as reverse current protection (optional, unless you want to make it permanent)
  9. Double layer perfboard if you want to make it permanent. But better use PCB so you can save space more for resistors

Read the Schematics and Prepare the Supplies

Screenshot 2025-05-13 120117.png

Here are the schematics you need based on the minimum requirements. You can use other ESP32 or Arduino as your microcontroller. But if you wanted to use battery, I suggest you to buy TP4056 module to make the battery rechargeable and make sure you need to check the ESP32 pins since each ESP32 models have different pins. Here's the schematics for ESP32-C6 DFRobot whether you wanted to make it as prototype or permanent product

Start Building

Don't let your screen turns off! If you still confused how put those pins correctly (just like me), keep the screen turned on, so you won't let your device can't turned on because of putting the pins wrong, for example, when you wanted to put the SDA pin from the display to the SCL of the microcontroller. If you can't make it stay on for longer, maybe make a note of your board pins on a paper isn't a bad idea.

Test the Circuit With Dummy Code

Some of us may experience device that won't turned on. It may be due to wrong pins pairing or maybe the problem with the hardware itself. In this step, there are few devices I used. There are SD card module, SSD1306 and DHT11.

Before making a statement of your broken hardware, you may check it with Serial Monitor, especially with SSD1306 since you might put the memory address wrong. Based on my experiences, you can use this tutorial to troubleshoot your SSD1306 :

  1. If your display won't turned on, you can check the address first with I2C scanner code. Usually, SSD1306 uses 0x3C address, but just to make sure, you can re-check the address. The code is below the text here.
  2. If you found the address but it still won't show anything, make sure you've added the DisplayColor() function before adding the contents inside.
  3. If your SSD1306's address is found but it won't show anything, it may be due to wrong soldering that cause two of your pins fused on the same tin melts. You can resolder the pins if it's still not working
  4. Based on the 3rd case, I fixed the soldering pins, but damaging the other pins, making it no longer usable since when I'm doing memory scanning, it can't detect 0x3C address. It means you have to find other display.

I once had tried to apply the SD card reader on this circuit, but it's still not readable. It may be due to my SD card that holds bigger capacity and I haven't checked the format type itself since my laptop doesn't have SD card slot.

Test It by Making BMP Files

Screenshot 2025-05-13 130924.png
Screenshot 2025-05-13 135600.png

This is the best part of you who love drawing things. In this case, we're using pixilart to make animation components layer by layer. After you made those animations, go to File -> Export -> and check the box for all layers. If you're way too lazy to convert all of those PNGs, we have solutions for you. If you have an SD card, you can use the file png2bmp.py.

What if you don't have an SD card? Well, it's fine. I don't have an SD card either. But don't worry. As long as your flash memory can hold more files, you can convert your bulk PNG files at the same time with png2arr.py and if you're way too lazy to rename it the whole file? It's okay! I made the file can read your expressions directory and naming each expressions automatically. The files would be stored on .h file, so your expressions can be accessed through header files. Since we're only relying on flash memory, you can make the canvas size smaller. In this case, I'm using 64x64px, and I used the x-offset, to center the image.

Upload the Code

Now, upload the code into the microcontroller and finally! You have your own digital keychain named "MoodBox"! I decided to put all the components inside a 3D model case, but I'd like to make it as it is and I'm going to buy other components soon, so I can make the real one for me.