“A tiny dimmer with corrected output for resistive loads. Controlled with 3 keys and showing current value on 8 tiny colored LEDs.
Based on this project, I made a general purpose dimmer for incandescent bulbs or soldering irons with these advantages:
Key controlled: There are 3 keys for up, down and turning the load on/off.
8 LEDs to indicate the percentage of power.
Corrected output, so the light/heat of load is linear based on the current dimmer value.
Saving the value to eeprom to remember the values after reset.
Due to low pin counts of ATtiny13, the LEDs are connected using 74HC164 shift register. This model doesn’t have a buffer register so it needs two pins to drive. one less pin than the popular 74HC595.
The input keys are read using a single ADC channel.
The power supply is a well known transformerless, capacitor based one.
Warning: This module is not isolated form mains. it should be kept in a proper plastic casing. The shift register library is platform independent and can be used for any ANSI-C based microcontroller.”