Arduino Dimmer

Recently I was doing some quick searching the internet for a zero-crossing dimmer circuit that could be controlled with a DC voltage,
and as I didn't really find any copy and paste kind of circuits I've decided to build one myself from parts I've found could be useful with some modification.

The intelligence of the circuit is an ATMEL ATTiny85 microcontroller and some Arduino code

The circuit basically is a zero-detector consisting of a rectifier bridge where the resulting signal is driving the LED of an optocoupler.
This LED will be on all the time except when at (or very close to) the zero-crossing point.

The second part is simple a clamp-circuit building a negative voltage relative to the MT1 point of the Triac.
This voltage can thus next be used to send a start pulse to this triac at a chosen point in time.
Sending pulses is done again using an optocoupler.

Solving the logic puzzle and the ADC converter part is the ATTiny85.
The code here waits for the zero-crossing and then depending on the level of the analog input voltage
sends the start pulse a certain amount of microseconds after the zero-crossing moment.

The Dimmer circuit is available under the TAPR Open Hardware License
(GPL3 version for hardware)