One advantage of solid-state relay (SSR) over conventional electro-magnetic relay (EMR) is its tear and wear free operation. S201S01 from Sharp is a good example.
Here is the circuit diagram of a DIY SSR project, which is in fact an isolated triac power controller.
The switching output from any dc circuit can be connected to pin 1 of opto-isolator (IC1) through a suitable current limiting resistor. Pin 2 of IC1 is grounded.
Pin 6 of IC1 is connected to one main terinal of Triac (T1) through resistor R1 and pin 4 drives the gate terminal of T1.
To limit the rate of change of voltage, a snubber circuit (R2-C1) is added across T1.
When current passes through the internal LED of IC1, internal diac is triggered and the diac provides the gate pulse to T1. Now T1 is fired to drive the ac mains operated load at its output.
After construction of the solid state relay on a common pcb, enclose the whole circuit in a very small ABS case. Now drill suitable holes to mount four labelled input and output terminals. Since switching is accomplished by triac T1, don’t touch the internal parts while AC supply is plugged in.