Spacegirl

Spacegirl

Simple ATtiny13a-powered earrings, featuring a mirrored pair design.

I was trying to think of a way to use silkscreen to show grayscale images, and came across the idea of using a single spiral line, varying in thickness.

The quasi-circular pattern of the spirals fit the image of the astronaut’s eye and helmet, forcing the eye to shift focus on the varying depth, analogous to the focusing on the lines themselves vs. the gradients they create.

Technical Implementation

The electronics are intentionally minimal. I chose the ATtiny13a microcontroller for its small footprint and low power consumption—essential qualities for wearable electronics. The code implements a simple PWM (pulse-width modulation) system to control the brightness of three LEDs, creating a subtle, animated lighting effect.

The main features of the implementation include:

  • Three independently controlled LEDs that fade between random brightness levels
  • A power-saving sleep mode activated by a button press
  • Debounce logic to handle physical button interactions reliably
  • Watchdog timer implementation to prevent system hang

Technical Implementation

The Spacegirl earrings are built around the ATtiny13a microcontroller, chosen for its small form factor and low power consumption. Each earring contains three LEDs (connected to pins PB0, PB3, and PB4) that create a subtle pulsing animation through software-based PWM.

Hardware Components

  • ATtiny13a microcontroller
  • 3 LEDs per earring
  • Button input
  • CR1220 battery

Key Technical Features

  1. Software PWM Implementation Rather than using hardware timers, the LEDs are controlled via a software PWM implementation with 8-bit resolution (0-255 brightness levels). This approach:
    for (uint8_t i = 0; i < 255; ++i) {
      if (i < led1strength) {
        on(LED1);
      } else {
        off(LED1);
      }
      // Similar logic for LED2 and LED3
    }
    
  2. Button Debouncing A 16-bit state-based algorithm provides clean button input detection despite mechanical bounce:
    inline boolean DebounceSwitch2() {
      static uint16_t State = 0;
      State = (State << 1) | !buttonIsDown() | 0xe000;
      return (State == 0xf000);
    }
    
  3. Interrupt-Based Wake The system uses the INT0 external interrupt to wake from sleep mode when the button is pressed, ensuring minimal power consumption during inactive periods.

  4. Pseudo-Random Animation A simple linear congruential generator creates pseudo-random patterns for the LED animations:
    uint8_t random8() {
      rand16seed = (rand16seed * FASTLED_RAND16_2053) + FASTLED_RAND16_13849;
      return (uint8_t)(((uint8_t)(rand16seed & 0xFF)) +
                       ((uint8_t)(rand16seed >> 8)));
    }
    

The watchdog timer provides a safety mechanism to recover from any potential system hangs, resetting the microcontroller if needed.

Reflections

This project represents my interest in creating technology that doesn’t announce itself as such. The earrings function as both jewelry and a small technical achievement, with the electronics enhancing rather than defining the aesthetic. The power system allows for extended wear without frequent charging, making them practical as everyday accessories.

Project Video