Blog IndexPosts by TagHome

Ear-lectronics

Posted <2025-10-10 Fri 21:15> by Aaron S. Jackson.

Those who know me (or have seen pictures of me, I guess) know I have large holes in my ears. Some may ask "why?" - I've never had an answer, until now. I can put LEDs in them! This is a project I've been thinking about for quite a while, inspired by mitxela's LED matrix earrings, and to a certain extent, the Fibonacci boards by Evil Genius Labs (I won't link to those because all their images are hosted by Imgur, making them inaccessible to UK visitors. Thanks, Online Safety Act!).

Some terminology

A lot of people call my ear things "stretchers" and "gauges" - I find that a bit annoying because one is a thing used to transport injured people, and the other is a terrible unit for the diameter of wire. Their actual names are plugs or tunnels, depending on whether they're solid or hollow.

KiCAD

I wear 25mm jewellery in my ears which gives a pretty reasonable amount of size to play with. I had a pair of stainless steel tunnels which have a fairly thin walls. That left me with 24.5mm diameter for the PCB.

I decided to use a four layer PCB, since the backside needed to accommodate pads for a coin cell. A friend at nottinghack had recently used an ATTiny1616, so I decided to do that too, since it seemed pretty happy to run off around 3v. The pattern I had in mind lends itself well to using shift registers, since I can just shift the three registers over to move to the next "frame". I considered using charlie-plexing, but that means keeping the CPU awake constantly. While I've not investigating deep sleep on the ATTiny yet, I am hoping it will offer some extra battery life.

The shift registers I used are small 74HC164 chips. Being low voltage CMOS, they run quite happily over a wide voltage range, avoiding the need for any kind of regulation when running off a coin cell.

On the back side, I added three pads for programming it via UPDI. All of the "electronics" is on the front side - I don't want to hide that stuff, it looks cool! I chose 0603 LEDs because I already have thousands of them, but using 0603 for the rest of the passives would have taken too much space. A while back, I accidentally ordered some 0201 resistors, when searching for 0603, because metric and imperial sizes… Anyway, they seemed like a suitable size.

The assembly

I ordered the PCBs from JLCPCB. I only ordered five because I assumed something wouldn't work. I also ordered a solder stencil to go with it. Here is the bare PCB and one which I'd applied solder paste to and populated.

I was planning to assemble these at nottinghack using the Pixel Pump and microscope, but I was feeling a bit rough on Tuesday and decided to stay home. Eager to start, I used tweezers, and my actual eyeballs. At the space we also have a cheap reflow oven, which actually works very well. I did these on my hot plate, which mostly worked. I think I put them on when it was too hot because some of the resistors and LEDs pinged off. While soldering 0603 LEDs is pretty easy, soldering 0201 resistors is a bit of a challenge. With some flux, it wasn't too bad, and everything looked good.

Programming

Here's my code for the first pattern. It basically just pushes one bit to each shift register, and then moves it across occasionally. While the delay is set to 4000ms, it's actually much shorter - closer to 300ms. Running it at 125KHz does some strange things I don't understand. I've made a few other patterns since, including PWM for a "heart beat" like pattern.

#include <avr/io.h>
#include <util/delay.h>

void pattern() {
  for (int bit=0; bit < 7 ; bit++) {
    if ((1 << bit) == shift) {
      PORTB.OUT = 0b0111;
    } else {
      PORTB.OUT = 0b0000;
    }
    PORTB.OUT |= 0b1000;
    PORTB.OUT = 0;
    _delay_ms(4000);
  }

  shift = shift << 1;
  if (shift == 0) shift = 1;
}


int main(void) {
  PORTB.DIR = 0xFF;

  while (1) {
    pattern();
  }
}

along with a Makefile

GCC = avr-gcc
OBJCOPY = avr-objcopy

DEVICE = attiny1616
PROGRAMMER = atmelice_updi
CLOCK = 128000

MAIN = main

all: build flash

build:
    $(GCC) -Wall -Os -mmcu=$(DEVICE) -DF_CPU=$(CLOCK)UL $(MAIN).c -o $(MAIN).o
    $(OBJCOPY) -O ihex $(MAIN).o $(MAIN).hex

flash:
    avrdude -v -p $(DEVICE) -c $(PROGRAMMER) -e -U flash:w:$(MAIN).hex:i

clean: rm *.o *.hex

The End Result

I mounted the boards in the tunnels. It's just a friction fit, so a tiny bit of sanding was needed. For the battery contacts, I used some desoldering braid. A small bit folded over in the middle for the cell negative, and a slightly longer piece running along part of the tunnel's inner wall. Conveniently this takes up just enough slack for a friction fit on a 2450 battery.

I've made four of them so far, but only mounted one in a tunnel. I'm still playing with patterns and different LED colours. This was a fun project though :) I also posted a video on Mastodon.

Post by @asj@hachyderm.io
View on Mastodon

I have some more ideas for improving this. Maybe more LEDs, but definitely a small accelerometer so the patterns change as I move around. My original goal was to make something to wear in Null Sector at the next EMF Camp, but Nottingham Light Night is also coming up. Last year I wore a DIY LED Matrix on my backpack. Maybe I'll be covered in LEDs next time :D Finally, here's the back and front together.

Wanting to leave a comment?

Comments and feedback are welcome by email (aaron@nospam-aaronsplace.co.uk).

Related posts:

Tags: electronics

Blog IndexPosts by TagHome

Copyright 2007-2025 Aaron S. Jackson (compiled: Sat 11 Oct 14:59:34 BST 2025)