Close
0%
0%

Gif Pendant

A necklace that plays animated GIF images

Similar projects worth following

This is continuing the work from #Video Pendant — I had to create a new project page to submit it to the contests.

The idea is to use one of those tiny TFT screens to build a piece of jewelry that you wear on your neck, to which you can save any animated GIF file of the right size, to have it displayed on the screen.

  • Some Progress

    deʃhipu10/01/2021 at 20:51 0 comments

    I had a friend visiting over the weekend, and they were interested in this project, so we sat down together and made some progress with it. I assembled a second unit, flashed the usual bootloader to it, and started to work on the CircuitPython firmware with the displayio library included.

    Right away I ran into a stumbling block: displayio is too large to fit on the SAMD21 flash by default, even with all the unneeded modules disabled. Fortunately I had a similar problem with #PewPew OLED before, and I knew that reducing the size of the filesystem from 64kB to 48kB solves that problem.

    Next problem took us some more time to resolve. I copied the display initialization code from #PewPew M4, since both displays use the same ST7735, they just differ in size. But on the pendant this code was crashing the whole firmware. It took me some time to figure out that the PA10 pin I used as MOSI for the display can't in fact be used as MOSI, despite what my notes say. Instead, pin PA11 should be used. So we cut the trace, bodged the connection to one pin to the right, and this time got working firmware. But unfortunately with non-working display still.

    Two days later I finally figured out what was wrong. I typed the value I was writing to MADCTL register as binary value, with "0b" at the beginning, but I forgot this is C, not Python, and that means something else. After writing that in hex with "0x" the display magically started working:

    The next step is to write the code for decoding GIF images. I already have working code for CircuitPython, so I tried that. Unfortunately (but predictably), I ran out of memory. So next, I need to figure a way of sending the data straight to the display, without buffering it first in RAM. I might need to use a C library for reading that GIF file for this, we will see.

  • Battery Holder

    deʃhipu06/14/2021 at 13:31 0 comments

    A separate task is going to be designing the battery holder. For now I'm just using an off-the-shelf battery box, with a switch on it, and it's enough for testing, but eventually a separate special design will probably be necessary.

    There are two main problems to solve here:

    1. Since the battery holder will be worn on the back of your neck, it will be in contact with a rather sensitive part of your body — I will need to make sure it's safe for your skin.
    2. Since it's relatively large and heavy, an ergonomic shape will be necessary.

  • Reading GIFs in CircuitPython

    deʃhipu06/14/2021 at 13:27 0 comments

    This is not advertised very much, but CircuitPython can now load GIF files using the Adafruit's Image Load library — I have added GIF support to it a while ago, based on the example code a wrote here: https://github.com/deshipu/circuitpython-gif

    However, there is one small technicality: that library doesn't handle animated GIFs.

    An animaterd GIF image actually contains multiple images inside, each representing one frame of the animation. They can contain the whole frame, or just the differences from the previous frame, with everything else transparent.

    I will need to modify my code to make it read one frame at a time — the SAMD21 microcontroller I'm using probably doesn't have enough memory to read all the frames at once. Hopefully the code will be fast enough to animate the image reasonably well.

    If that fails, I might need to include a library written in C to read and display the animations.

  • The Screen

    deʃhipu06/14/2021 at 13:20 0 comments

    I'm still using the same tiny ST7735 color TFT screen, with a new PCB added to the back of it, containing just the microcontroller and a micro-USB socket made of the PCB itself — to make the whole thing as thin as possible. I will probably need to cast it in resin eventually, so it's a sturdy, one-piece thing. For now, for ease of debugging, I'm keeping it separate.

    I will need to make at least one more version of that PCB, to include touch pads for switching the image on the pendant.

  • Continuing from Previous Project

    deʃhipu06/14/2021 at 13:17 0 comments

    I haven't touched the #Video Pendant project in a while, but I think it's really time to resurrect it now. CircuitPython has grown a lot in this time, and I also wrote a library that reads GIF files in Python, so there is much that can be improved on the software side.

    On the hardware side, I'm going to continue where I left off. I will use the new configuration, with the screen on one end, and the battery holder worn on your back, under the shirt:

    This allows the pendant itself to be much smaller, and the battery to be much larger. I will probably switch to a pair of regular alkaline AAA batteries, instead of rechargeable LiPO. They are safer and much easier to get. Also, I don't need to ship them with the device.

View all 5 project logs

Enjoy this project?

Share

Discussions

knox1138 wrote 06/15/2021 at 22:56 point

yes, i 100% agree that your idea would be much more ideal, and i have no idea how that would get done

  Are you sure? yes | no

knox1138 wrote 06/15/2021 at 21:12 point

So maybe not the way to go for larger screens, but what I did for a 128x64 oled is i took a gif, optimized it for size and color, and broke it into individual frames. After that I made a spritesheet where each sprite is a frame, and a pi pico update the sprites reasonably fast. Not the best framerate, alot of work on my end, but technically accomplished the goal of having a 128x64 monoxhrome oled display an animated gif with circuitpython. Good luck!

  Are you sure? yes | no

deʃhipu wrote 06/15/2021 at 22:53 point

The thing is, I really want to make it a no-brainer for people to use. So ideally you just resize/crop the GIF you want, save it in your favorite graphics program, and copy to the USB disk of the pendant. The format is not very difficult to read, it's just a question of whether it's going to be fast enough, or have enough memory to cache it if it's not.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates