Picture of 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: 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
mahadevan10 months ago


Thanks for the fast reply.

Earlier I have seen you dimmer circuit and I asked PWM question as components are lesser. Actually I need 4 simple tube lights where there is no need of PWM(copper chokes -- which could be inductive while tubelight starting) and 1 fan (here PWM is neede). So I will club this circuit with your other dimmer circuit.

Do you have eagle-scheamtics/board documents? If so, I can customize them for 4 simple SSR and 1 dimmer for PWM control.

Thanks & regards,


diy_bloke (author)  mahadevan10 months ago

yes i remember :-)
I made this in Fritzing. I prefer that one over eagle :-)

But as you can see in step 2 it is a very easy lay-out. should take you 5-10 minutes in eagle to set that up


Thanks for your kind advice. It seems that I can't get (39MF22, PR26MF12, S26MD02 ) in India. So I am planning to use following SSR (PANASONIC ELECTRIC WORKS - AQH3223AJ - SSR, 600V, 1.2A) . Link is http://in.element14.com/panasonic-electric-works/aqh3223aj/ssr-600v-1-2a/dp/2095718

Can I use AQH3223AJ as replacement ?

It seems AQH3223AJ is having random-fire-crossing (as opposed to zero-cross-firing in SSR mentioned by you). So will it be OK to use this part?

As AQH3223AJ support random-cross-firing, can I use it for Fan-Control (inductive load)?

Thanks & regards,


Small correction:

I do get 39MF22, PR26MF12, S26MD02 from element14 in India, but I can buy AQH3223AJ for 1.5$ :)

diy_bloke (author)  mahadevan10 months ago

you can use that one as a replacement, but i doubt if the pins would be compatibel so u may have to change your lay out. Yet, if it has random firing be prepared for a lot more spikes on your mains line and i would advise a good filter. Yes can use it for a fan... but use a good filter
Only reason i used the 39mf22 was because it was relatively cheap


Thanks for the reply.

I will ensure in my circuit about the pin compatibility. Thank you very much for your suggestion.

I would like to use the filter, but I am not sure how the circuit looks like with filter. If you don't mind, would you please let me know how a good-filter can be incorporated . You can write here or send an email to me at sgorti at.the.rate gmail.com with the values for LRC components for the good filter. Maximum Resistive/Inductance load would be less than 100W @220/240V with 50Hz.

Thanks & regards,


mahadevan10 months ago


Thanks for great circuit & detailed description.

What is equivalent for 39MF22? Can I use S26MD02 as replacement for 220V AC?

Where should I put Snubber (R and C) components? Should they be connected (line or neutral) ? Please let me know.

Can I use this to load tube lights with copper-chokes and electronic chokes with < 60W?

Can I use this to PWM control for fans ( < 60W )?

To reduce accidental shortage on AC lines, can I apply glue on AC lines to avoid short circuits ( Question is any heat transfer area need to be kept for AC side of SSR or not ).

Thanks in advance,


diy_bloke (author)  mahadevan10 months ago

in principle every ssr can be used that is suitable for the load you want to switch. I have chosen the 39mf22 because it was very cheap, but the S26MD02 is certaily useable. It has a different pin lay out though.
A snubber is usually not strictly necessary with a pure Ohmian resistance but if you want to switch a motor i would recommend it.. Usually the snubber is put over the poles of the TRIAC, in this case pin 8 and 6, but one can also try put them over the connections of the load.

I have not tried it myself but I think one could switch a tube light with this.
It is not suitable for PWM control. the reason for that is that the 39mf22 has a built in zerocrossing control. Therefore when you send your pwm signal, it will still wait for the next zerocross and thus screw up your timing.
If it didn't have a zerocross you would still be in the dark because your pwm signal will then switch on the SSR in random phases of the AC cycle and thus may sometimes send full peak and sometimes send 0 volt.
If you want to do kindoff a pwm with AC you have two options: edge/phase cutting or pulse skip modulation. Both techniques are possible with the circuit in this link:


Once you connected your AC lines there is no problem putting some glue on them/in between them.

Good luck

gsandhu21 year ago

I’m working on a project which is about making a rescue
robot . I have struggling with it for 4 months and now all the mechanical works
had been done . but I’m facing difficulty in make the robot to work with rf
module can u plzz help me…

I want make transmitter and receiver that can control the
motion…I mean that receiver should have control 8 dc gear motor and each dc
motor should have a forward and backward botton to control the motion ……can u
kindly help me with this project ….if u can make the circuit board diagram for
the PCB ….or any other suggestion plz reply……mail me at “sunny1995gagan@gmail.com”

diy_bloke (author)  gsandhu21 year ago

synny, it is kind off a far cry from having questions on a 4 channel solid state relay and designing and building an rf controlled 8 dc back and forth motor project.
I dont want to be unfriendly but you are asking something here. Anyway, as I do not know your platform at all, I will make some suggestions what you can do.
RF transceiver modules can be picked up from dx.com for just a few euro's and can easily be controlled by a microprocessor. Presuming you are using a microcontroller in your robot, you can buy again for a few euro, a 2 or 4 channel motordriver from dx.com in which you can reverse polarity. you need either 4 or 2. hook these up to a pin of the microprocessor and you can control direction. If you also need to control speed you need 2 pins per motor.

Hook up the receiver and let your program take actionon the motors according to what you send.
Attach the transmitter to another microprocessor, or just to buttons, depending on how sophisticated you want to make it and off u go.

Amother possibility is to buy a ready made transceiver set like for model planes, with the amount of channels you need

Good luck

tiger52481 year ago
I looked up the data sheet for the DIP used here (39MF22). My question is can this really switch 120+ low current voltage? I simply don't see that in the data sheet, but I could be wrong. I would like to use this circuit to switch christmas lights that I am working on. Do you think this will work with one strand of normal christmas lights?
diy_bloke (author)  tiger52481 year ago
Though I cannot try it myself as i have no 120 Volts, I see no reason why it should not. The low current should not make a difference
Ben J2 years ago
I built your relay design into an Arduino circuit, but the relays don't seem to be working like SPST switches, like I expected (there is no continuity between pin 6 and 8 when the relay is activated).


Please forgive me, as I know very little about electronics - I simply cobbled together a few circuit designs I've come across (5V regulator, Arduino, MIDI input, and your relay design).
diy_bloke (author)  Ben J2 years ago
Ben, sorry for my late reply, I did not see your question come in. Well the 39MF22 is not exactly a single-pole, single-throw switch it is a solid state relay and the switching takes place with a triac.
When you say that thereis no continuity between pin 6 and 8 I get the impression that you just measured that with a multimeter and that will not give proper results.
You really need to see pin 6 and 8 as the poles of a AC current swith. Have you actually tried to swith an AC load with it?
Your picture looked impressive :-) even though i could not really see what was on it because of the burning LED's. Anyway, let me know what you are trying to switch and wether that is an AC load or a DC load
Ben J diy_bloke2 years ago
Thanks for the reply! :)

Yes, the LEDs are probably a bit too bright, especially that green power indicator.

The relay section will be connected to 1/4" TRS cables for switching channels on a guitar amp - thus, very small current. I'm a bit too gun-shy to do anything with AC at this point; I think I'm a bit of a novice to attempt anything as dangerous as that.

I could've used mechanical relays, but I was attracted to the smaller form factor of SSRs, as I'm trying to make the board as reasonably small as possible, so as to fit into a specific-sized hammond enclosure.

I'm learning things as I go along, and I was pleased with how things turned out, even though it's only a semi-functional circuit. That said, I'm glad that parts and DIY PCB fabrication are as cheap as they are. :)
diy_bloke (author)  Ben J2 years ago
I doubt if the channels on a guitar amp can be switched by a solid state relay, so that is where your problem lies. You do however now have a midi controlled lamp switch :-)
If you do not want to use small relays, use the 4066 (either a HEF4066 or a HCT4066) that is a bidirectional switch (4 per IC I think) that can be controlled with an enable pin
diy_bloke (author)  diy_bloke2 years ago
a HCT4066 costs about 0.25 euro and has 4 channels so that is cheaper than the 4 x 39MF22 (4x1.80) and probably smaller as well
diy_bloke (author)  diy_bloke2 years ago
If you are indeed switching DC then the 39MF22 is not suitable for that. It is better then to use e.g. a HEF 4066 if the current is not too big or otherwise a small reed relay
Farnell has the PR39MF51NSZF SSR for just over a £ in the UK.

The datasheet suggests that you might have problems with inductive loads (motors, solenoids) if the voltage rate of change on switching is high (< 100v per us) and suggests in that case a snubber (R and C in parallel) between pins 6 and 8 - they suggest starting values of 0.022uF and 47ohms - what works will vary with the type of load.

So if anyone has problems with erratic switching of motors, etc, they might want to experiment with different values of R and C between those pins.
That should have been "( > 100v per microsecond)", of course.
diy_bloke (author)  mikeatboduel2 years ago
Thanks Mikeatboduel. Netherlands is not the cheapest country where electronics parts (and many other things) are concerned. 1.80 euro's is about 1.45 pounds.

You are right with regard to the datasheet and switching inductive loads is the very reason why i always hesitate vetween a mechanical relay and an SSR. In another tutorial in which I use the 39MF22 I think I indicated use of a snubber network (100R/100nF). I think though it might be better to have that directly over the contacts of the inductive load. E.g. in a socket where it plugs in.

Having said that. I have been using the 39MF22 for some time already to switch pumps and that has not given any problems yet.

diy_bloke (author)  diy_bloke2 years ago
Let me just add that the 39MF22 is suitable for currents up to 900mA. The max load I have been switching with it was 100 wats and the max inductive load might have been 20 wats and that goes very well. If you'd want to switch a 198 wats (the max) inductive load, I would definitely use a snubber and probably a fuse as well, probably even choose a different relay.