Close
0%
0%

Kagedourou: Ghost in the lantern

A traditional lantern with a digital ghost.

Similar projects worth following
A word "kagedourou" (in Japanese, "影灯籠", "回り灯籠": revolving lantern, or "走馬灯") is a kind of lantern with a spinning wheel for casting moving silhouettes. Though the silhouettes moves as if they are breathed life, there is a limitation from their static shape. I wonder if it can be more lifelike as a ghost (joke intended) told in Kaidan stories. That's where this project came from.

Prototype 1: Good old Bad Apple! as a test sample

ファイル:Kuniyoshi The Ghost in the Lantern.jpg

Kuniyoshi Utagawa, ''The Ghost in the Lantern'', 1852. 9.75" by 14" (From Wikipedia)

  • Prototype-1 and its internals

    likeablob01/02/2022 at 16:59 0 comments

    So, here is a prototype-1, made by sacrificing my year-end holidays.  
    I hope it makes some laughs on its finishing which is comparable to 4th-grade-homework-crafts-thing.
    (I admit it's due to 1. my gibberish hands 2. my old Kossel k800 FDM printer. But instead of learning hand crafts and replacing k800 with a new SLA printer, I would try online printing services such as JLCPCB or FusionPCB. HP Jet Fusion 4200 with Nylon PA12? What a tech xxxx.)

    Internally this prototype-1 uses the following components:

    And here is my work log (for myself);

    • Print the parts of the frame, glue them together.
    • Make the LCD driver piggy-backed on the LCD with double-sided tape. Solder two wires for powering to the driver board.
    • Attach the WS2812 ring on the bottom panel with double-sided tape. (Watch out. It's sticky!)
    • Insert the LCD panels into the frame and screw the bottom panel to the frame tightly.
     

    That's it. Then it's time to power the OPi on.  

    • This time I used Armbian 21.08.1 Focal with Linux 5.10.60-sunxi64: https://www.armbian.com/orange-pi-zero-2-h5/
      • Just connect the board to your machine, the board will be detected as a virtual serial device (USB ACM device backed with g_serial).
      • `screen /dev/ttyACM0 115200` and then `sudo armbian-config` to get started.
    •  To bring up X11, just apt get some packages.  Here is a snippet based on my macmini project.
      • $ sudo apt update && apt install -y -q \
            chromium-browser \
            matchbox-window-manager \
            nodm \
            xserver-xorg-input-libinput \
            xserver-xorg-video-fbdev \
            x11-apps \
            xinit \
            xfonts-base \
            xloadimage \
            tmux \
            x11vnc
        
        $ sudo sed -i.orig -e "s/NODM_USER=root/NODM_USER=${USER}/" /etc/default/nodm
        
        $ vi ~/.xinitrc
        #!/usr/bin/env bash
        xterm -e tmux &
        matchbox-window-manager -use_titlebar no
        
        $ chmod +x .xinitrc
    • Install mpv and yt-dlp for streaming YouTube.
      # Install yt-dlp with pipx
      $ sudo apt install -y python3-pip python3-venv mpv
      $ python3 -m pip install pipx
      $ echo 'export PATH=$PATH:~/.local/bin' >> .zshrc
      $ source .zshrc
      $ pipx install yt-dlp
      
      # A workaround for a little bit outdated mpv (v0.32.0-1ubuntu1)
      $ ln -sf ~/.local/bin/yt-dlp ~/.local/bin/youtube-dl
      
      # Bad apple!
      $ export DISPLAY=:0
      $ mpv -fs --panscan=1 www.youtube.com/watch\?v\=on2MUzhuVMw
    • To use the WS2812B ring, use the SPI bus and some Python scripts.
      • # Enable the SPI bus
        $ sudo vi /boot/armbianEnv.txt
        ...
        overlays=gpio-regulator-1.3v spi-spidev usbhost2 usbhost3
        param_spidev_spi_bus=1
        $ sudo reboot now
        $ ls /dev/spidev1.0
        
        # Install the required dependencies
        # You may want to use poetry or pipenv
        $ sudo apt install python3-dev
        $ sudo python3 -m pip install spidev
        $ wget https://raw.githubusercontent.com/likeablob/openvino-opencv-docker/master/demo-face-detection-ws2812/ws2812b.py
        $ vi test.py # See the following snippet
        $ sudo python3 test.py
      • #! /usr/bin/env python3
        from ws2812b import WS2812B
        
        led = WS2812B(12, spi_bus=(1,0))
        led.off()
        
        led.show([[250, 250, 200] for _ in range(12)])
      • Oh, don't forget to wire the ring to the board. WS2812's DIN is connected to OPi's PA15 (SPI1_MOSI).

    • Lessons learned;

    ------ cut here ------

    To draw a dynamic silhouette onto a surface, the following ways are in my mind;

    • A. LCD
      • A-1. Full color LCD with...
    Read more »

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

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