Building a Four Channel SolidState Relay





Introduction: Building a Four Channel SolidState Relay

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: or even cheaper: . 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.

Step 2: Building a Four Channel SolidState Relay: the PCB

The PCB is quite easy. I have included the lay-out for download here. The file is a pdf file in the right size for the so called 'heat transfer method'.
You will find an extensive instruction on how that works in another tutorial here.
If you make your own PCB, make sure to leave some copper around pins 1 3 and 4 as that helps in cooling.
Mounting the board with components is pretty self explanatory, just watch the polarity of the LED.

At the left side of the PCB there is a 5 pin female header: 1 ground pin and 4 signal pins.
I attach to that using a 90 degree angled male header. Angled because I have put the entire board in a small plastic box that will not allow a straight header.

At the right side are the 4 AC mains switches. These function just like regular switches so they must be in series with the load one wants to switch.

The snubber network (the 100 ohm resistor and the 100nF in series) is not found on the PCB. These are connected over the switch contact of the SSR where it connects to the load. 

An informative website on SSR's can be found here.

Step 3: Building a Four Channel SolidState Relay: the Box

I have used a large Tic-Tac peppermint box to encase the pcb. It measures 8.5x2x5 cm and the PCB fits nice and snug.
The signal cable is coming in through a hole at the left. The mains AC switcg cables come in through a hole at the right.
Once you are completely satisfied with its workings one could seal one or both holes with either hot glue or silicone around the wires



  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Pro Tips Challenge

    Pro Tips Challenge
  • Paper Contest 2018

    Paper Contest 2018

We have a be nice policy.
Please be positive and constructive.




is it possible to use it withoud LED`s ? what resistor should i use then ?

sure. use a 470-560 ohm

thats what i thought so ! thanks ! :)

i have ordered AQH3223 which seems to be capable of 1.2A load :)

I think the solid state relay that I use can take 50mA so there is some leeway.
Your AQH also has a nominal 50mA forward current.
You may however encounter another problem as the AQH3223 has a forward voltage of 6 Volts, so that makes my advice on the resistors completely useless and your Arduino might be barely suitable to drive the AQH Led and if it does, the Arduinoport might get overloaded

Hmm, where did you find that 6v forward voltage ? Datasheet say it is 1.21 to max 1.3v. Or am i wrong ?

just one more remark about the AQH3223 it is non-zero cross. That is not a huge problem but it may give a bit more disturbance on the mains line.
However... you can use it to dim a light then if you add a seperate zerocross detector.
The 3213 would have been a zerocross ssri


Thanks for a quick reply.

Correct me if im wrong, but according to AQH3223 max INPUT is 6v. so i should be able to drive it straight from lets say arduino output without LED in the middle, without even using any resistor ? 3223 should take as much current as it needs, right ?

Well I have to correct you coz you are wrong. :-)
Ofcourse you dont need the series LED. I only put that in there to see if the channel was on, but you do need a series resistor. The nominal trigger current of the AQH3223 is 10mA, but recommended is 20mA. The forward Voltage is 1.18 Volt
If you connect it straight to an Arduinopin you will fry your Arduino as you have no control over the current. As the Arduino will give 5 volt and the forward voltage is 1.18 you have 5-1.18 =3.82Volt that has to drop over a resistor at 20mA so that resistor needs to be 3820/20=191 Ohm. Use a 200 ohm resistor

I am wrong. I looked in the max ratings. Apologies

Hello Again,

Do you know what is the current draw of 39MF22 ?