For an Arduino project I needed to switch 4 mains devices.
I am always deliberating wether to use a mechanical relay or a solidstate relay.
Solidstate relays used to be relatively expensive, and thus people constructed them from opto couplers and triacs, but there are some cheap SSR chips available. One of my favorites is the 39MF22 that is available for  1.80 euro. So I made a choice to build a solid state relay for my project.
I have to add though that a four channel relay board, ready made, is also not that expensive. So, before you build my solid state relay you may want to check out these options: http://dx.com/p/arduino-4-channel-5v-relay-module-expansion-board-137109 or even cheaper: https://dx.com/p/5v-4-channel-high-level-trigger-relay-module-for-arduino-red-157213 . In fact, these may even be slightly less expensive than the Solid state relay board I will be describing here.

Bill of materials:
4x 39MF22 from e.g. dickbest  I believe it can switch 900 mA which is sufficient for most of my applications You could also use PR26MF12. It is pin compatible and switches 600 mA
4x 8 pins dil IC holder
4x LED in color of choice
4x 330 Ohm resistors
4x 2 pins screwconnector
1x 5 pins female header
1x 5 pins male header 90degrees
1x Tic-Tac peppermint dispenser The bigger one: 8.5x2x5 cm
1x piece of PCB 6x4.6 cm

For a snubber:
1x 100 Ohm resistor
1x 100 nF 600 V resistor

OK Stop right here. This circuit is meant to switch AC loads of  110 or 220 Volt. These voltages can and will kill you, so be careful and if you do not feel confident you know what you are doing, you should only use this for low AC voltage loads.

Also, as said, this circuit is for switching AC, it is not for DC. for switching DC a HCT4066 should be considered (depending on the load to be switched)  or a mechanical relay

Step 1: Building a Four Channel SolidState Relay: the Circuit

The circuit is fairly easy the output from an arduino or other microprocessor is fed to the 39MF22 via a resistor and an LED that will light when the relay is activated.
The 330 Ohm resistor limits the current to the 39MF22 from a 5Volt output. If a higher output voltage is used, recalculate the value.
In calculating the resistor value for other voltages, take the following in consideration: The 39MF22 has forward voltage of 1.2 Volts. Current should be between 5 and 20 mA. Most green or red LED's have a forward voltage of 2 Volts. Therefore the value of R should be at least (Vcc-3.2)/20  (gives value in kOhm) and at most (Vcc-3.2)/5  (gives value in kOhm).
So for 5 Volts this would be 1.8/20=90 Ohm  till 1.8/5=360 Ohm

This table will save you calculating the value of R2:
Voltage Minimal value Max value
5            90                      360
6          140                     560
7          190                      760
8          240                      960
9          290                    1160
10        340                    1360
11        390                    1560
12        440                    1760
13        490                    1960
14       540                     2160
15       590                     2360
16       640                     2560
17       690                     2760
18       740                     2960
Values in Ohms. Just chose one sort of in the middle of the range for your voltage.

The circuit only shows one channel so you will have to build this 4 times.

About This Instructable




Bio: I am a physician by trade. After a career in the pharmeceutical world I decided to take it a bit slower and do things I ... More »
More by diy_bloke:Adding an MCP23017 I/O Extender to Arduino or ESP8266 Calculating Sunset and Sunrise for a Microcontroller A Simple MQTT Pub/Sub Node With Arduino UNO and ENC28J60 Ethernetshield 
Add instructable to: