SPI module to control AC power based on attiny13

Hi,

I want to share a simple module I build which can be used in any project to control AC power (heating, lighting, fan etc.).
It accept on SPI interface a single byte which sets power in a range 0-255.
0 - is full OFF
255 - is full ON
1-254 is power between 0 to 100%

through my test a voltage on a load can be regulated from just a fraction of a volt till full AC voltage.
resistive, inductive or mixed load are accepted
here is an example of regulation of mixed load - lamp + fan

power regulation is based on a phase regulation - tiny13 looks for zero cross and will start count time and based on a power selected will trigger triac at appropriate phase. Internal constant is set for 50Hz AC. For 60Hz it should also work but probably regulation will be less smooth at low range.
Here you can see two channel oscilloscope there yellow channel shows zero-crossing while blue channel shows triac opening.
Multimeter shows a voltage on a load.

Module is about 48x24mm:

schema:

attached you will find zip with all things to make it if you ready to etch pcb and solder components.
you will also find an example avr project. you can rewrite it for arduino without big problems.

image-small.png

p7001 power ac module files.zip (164 KB)