Led Jar is a decorative or night lamp powered by a 18650 lithium-ion battery and controlled by ATtiny85 MCU. It uses three independently driven dew drop strings, but all fancy modes (animations) were removed from the code as they were rarely used.

Functionality

  1. Four levels of brightness.
  2. Battery over-discharge protection and indication.
  3. Integrated USB Type-C charger.

Schematic

The custom PCB was reused from a different project, and the schematic is quite minimalistic.

https://raw.githubusercontent.com/strange-v/LedJar/main/schematic.png

The LED strings are connected to PWM outputs through a 5 Ohm resistor though the initial version without the limiting resistor works for more than a year without any visible degradation.

3D printed components

The jar lid and battery cover are modeled in Fusion 360 and 3D printed on a regular FDM 3d printer (STEP files are attached). M3, M2.5 screws, and a hot glue gun are used to assemble everything.

Software

The code looks a bit overcomplicated (probably, that's typical for my projects), but it's split into files with meaningful names. The MCU sleeps if the lights are turned off or 100% on. Unfortunately, it cannot sleep and generate a PWM signal, so SLEEP_MODE_IDLE is used in that case.

When the battery voltage drops below 3V (configurable in the code), the MCU blinks twice and switches off the lights. Now it'll not allow a user to turn on the lights - it'll only blink.

A few more photos