# Building your own solid state relays



## Dr Morbius (Sep 21, 2004)

Anyone done this or have a schematic? I know it should be cheaper to build one using an opto isolator.


----------



## CraigInPA (Sep 28, 2007)

You can buy opto-22 odc5/oac5/and the quad versions of these for next to nothing on ebay. The last time I bought some, they were less than $2 each port including shipping (20 singles for ~$30, 20 quads for $60). If you're going to get into these big time, you should look for people selling the opto-22 relay boards full of ssr's that terminate in a 25 pin D shell connector. Buy the board, keep the useful bits, toss the rest. Usually these are even cheaper than buying units individually.


----------



## Dr Morbius (Sep 21, 2004)

So opto-22's are solid state relays? The reason I ask for SSR's is I may be able to use them instead of a kit74, and they last longer. Whether or not they are cost effective is another matter.


----------



## Dr Morbius (Sep 21, 2004)

Is this what you mean? I have no experience with opto-22's at all. 
http://cgi.ebay.com/16-OPTO-22-RELA...ryZ78207QQrdZ1QQssPageNameZWD1VQQcmdZViewItem
Is this too much? Do they come cheaper?


----------



## gmacted (Jan 18, 2006)

Dr. M,

The circuit will depend on if you're trying to control AC or DC voltage. The main components of an SSR are an isolation stage and a drive stage. 

The isolation stage is typically an opto-isolator (you can think of an opto-isolator as a phototransistor where the base is "light isolated" from the emitter and the coupler). You could just use an opto-isolator in a strictly DC application, but you could just use a transistor too.

SSRs are typically used in AC applications where you would still have the isolation stage, but then you would have a drive stage (which is where you would typically use a triac). This is where the size and the cost come into play. Triacs are typically used for light dimmers or speed controlled motors. A SCR (silicon controlled rectifier) could also be used since a triac is just "back to back" SCRs.

What are you trying to control? Your application will really depend on what you really need to build.

I not really sure you could build an AC SSR cheaper than you could buy one and if you could , it wouldn't be very small.


----------



## Diaval (Nov 9, 2007)

Dr Morbius said:


> Anyone done this or have a schematic? I know it should be cheaper to build one using an opto isolator.


Sure you can, but that depends on what you are going to control. If it is AC and high current, then you are best off going with something commercially made. Now if it is DC then you are in luck.

You can use a device called a MOSFET which resembles a transistor. A MOSFET is a voltage controlled device like a vacuum tube. It draws no current on it's control gate. With that in mind you can directly come out of your TTL type circuit and switch a moderately high voltage and a pretty high current using one of these devices. Moreover because it is solid state you can also PWM (pulse width modulate) the FET and you can do things like dim a lamp or control the speed of a motor. Keep in mind that if you want to control 110v devices this way that you can only do so with DC devices. So anything with a transformer or brushless (unless it is DC brushless) motor is out of the question. Also as soon as you go over 60volts on the voltage rating...FETS start to get expensive.

Now if your AC control needs are low current such as turning on and off a few flicker lamps or low wattage bulbs, then you can optically couple an led to a photocell and use that photocell to replace the dimmer pot in a standard household light dimmer. The phantasmechanics.com website offers instructions on how to do this via their 'flicker lamp' controller (you simply replace the flicker lamp with an led that is connected to your controller).

Keep in mind that this method of AC control doesn't offer zero cross switching and can introduce a bunch of power line and RF noise which could hamper computers and other 'sensitive' electric items hooked up to it. The higher the current you switch, the more noise you get. You are also limited to 6 amps or so going this way. Best off to avoid noise, stick with very low currents.

So if you are going to control large loads or PWM AC motors...then I would suggest sticking with a high end zero crossing SS Relay by Crydom (or similar MFG).

I can tell you one thing though...if you don't have much experience with electronics and you want to switch 110v AC devices...stick with something commercially made. If you don't know what you are doing, you can get a severe shock, cause a fire...or worse.

Even if you are dealing with commercially made devices. ALWAYS buy fuse holders. The fuse is going to save you in many ways than one. So don't ignore your fuse holders. You should put a fuse on each one of your solid state relay outputs. What size fuse should you use? Well, by right you should put the lowest value in for the device to operate properly taking inrush into account. But if in doubt, going almost the full rating on a SS is a safe bet. For example...if your SS relay is rated for 10 amps. Put an 8 amp fuse in line with it.

There is another thing you have to take into consideration as well when it comes to current draw. If you have 4 10 amp channels and you are close to the max on these, and you turn all of them on at once...you are looking at a 40 amp total draw. Most wiring will not handle this.

So if you are designing something that draws high current...such as a theatre marquee light chaser, you have to make sure that your power buss (the supply lines that connect to the solid state relays) can handle the FULL load all the way back to your circuit breaker panel.

So that means you need a 40 amp line and a 40 amp circuit breaker.

I am being facisous here. But the numbers are real. While you may not be controlling a theatre marquee, you could have a smoke machine on one channel (usually 10 amps. But the control circuit is usually less), switching a few 100 watt bulbs on and off here and there (10 - 100 lamps is another 10 amps), if you are switching anything that cools or heats that is another 10 amps or so.

So as you can see, the numbers add up pretty quickly without you knowing it.

ALWAYS, ALWAYS, ALWAYS...fuse your circuits and calculate your current draws.

Look at the voltage plate where the power cord goes into your item. Many times the current draw is given. However most of the item it is given in WATTS of power.

The formula for converting power to amps is this

E = voltage, P = Power, I = Current

I = P/E

EG. If the power is 1800 watts and the voltage is 120 the result is:

I = 1800/120 or 15 amps.

Sorry for the lengthy crash course in electronics. But I don't know what your electronics knowledge level is and I am just trying to make you aware that you are no longer dealing with 'breadboard' voltages and currents once you start getting to control larger devices and dealing with household voltages. If you are not careful you can seriously hurt someone (including yourself) or cause major damage.

JG


----------



## CraigInPA (Sep 28, 2007)

Dr Morbius said:


> Is this what you mean? I have no experience with opto-22's at all.
> http://cgi.ebay.com/16-OPTO-22-RELA...ryZ78207QQrdZ1QQssPageNameZWD1VQQcmdZViewItem
> Is this too much? Do they come cheaper?


Opto-22 is a manufacturer of SSR's. Gordos and other manufacturers made equivilent products with similar, if not exactly the same part numbers.

The ones you list are 15v logic, which is probably not what you want.

You probably want to control with 5v TTL logic, running 110v AC lamps or props. This would be more like what you'd want:
http://cgi.ebay.com/Opto-22-OAC5-Lo...ryZ97184QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

Opto-22 names its SSR parts in a common fashion:
first letter o=output, i=input
second and third letters AC=AC, DC=DC
Fourth through Sixth numbers - switch voltage
So, an ODC5 accepts a 5v signal and switches DC voltage,
an OAC5 accepts a 5v signal and switches AC voltage, etc...
When you search ebay, it's actually better to search by part number than company name.

Note that all of these have a wide voltage range for the triggered circuit, but none will supply more than 3A on that triggered circuit. So, no large fans or motors with these.

There are models made for heavy power consumption. For example:
http://cgi.ebay.com/New-25A-SSR-Sol...ryZ78207QQssPageNameZWDVWQQrdZ1QQcmdZViewItem
Be careful when buying ones for heavy loads, since most switch on 24v, which is common for thermostats and industrial equipment, but not for PC control applications.


----------



## gmacted (Jan 18, 2006)

I agree with jukingeo except for the following statement.



jukingeo said:


> You can use a device called a MOSFET which resembles a transistor.


A MOSFET is a transistor ... it's a "Metal Oxide Semiconductor Field Effect Transistor" hence the name MOSFET.

I agree that you could use it, but it is still a transistor.


----------



## Dr Morbius (Sep 21, 2004)

Wow, thanks guys, that really helps. Now, one last question. Can I use these to replace the relays in a kit74? Am I understanding this correctly when I assume the machanical relays in a k74 can handle far more current than a SSR? (referring to the ones CraigInPa linked to). To answer the question, I will be controlling AC flood lights and DC wiper motors.


CraigInPA said:


> Opto-22 is a manufacturer of SSR's. Gordos and other manufacturers made equivilent products with similar, if not exactly the same part numbers.
> 
> The ones you list are 15v logic, which is probably not what you want.
> 
> ...


Listed as switching AC, what would happen if I used these to switch a DC circuit? Also, what is the current draw on these? Can they be hooked up directly to a PC parrallel port without modification to the circuit? It seems like I can, since there's no coil to produce a back voltage to harm the port.
On a side note..Holy crap! 50 for 10 bucks?! That's an unbelievable deal for 50 SSR's. If these can do what I want, then Ebay is definitely the way to go for these.


----------



## gmacted (Jan 18, 2006)

Dr Morbius said:


> Wow, thanks guys, that really helps. Now, one last question. Can I use these to replace the relays in a kit74? Am I understanding this correctly when I assume the machanical relays in a k74 can handle far more current than a SSR? (referring to the ones CraigInPa linked to). To answer the question, I will be controlling AC flood lights and DC wiper motors.
> 
> Listed as switching AC, what would happen if I used these to switch a DC circuit? Also, what is the current draw on these? Can they be hooked up directly to a PC parrallel port without modification to the circuit? It seems like I can, since there's no coil to produce a back voltage to harm the port.
> On a side note..Holy crap! 50 for 10 bucks?! That's an unbelievable deal for 50 SSR's. If these can do what I want, then Ebay is definitely the way to go for these.


The relays in a kit74 (RWH-SH-112D) can handle 12A of current while the OPTO 22s (OAC5) can handle 3A max.

I'm not sure what type of load you will have on the wiper motors, but it may draw more than 3 amps.

As far as replacing the relays in a kit 74. It appears the kit 74 realy has 12V coil voltage and the OPTO22s have a 5V coil. So, no they cannot be used with the kit 74. According to their specs they do have 15V and 24V coil voltages, but no 12V.

The OPTO22s can only be used to switch AC. They will do nothing if you try to switch DC with them.

The OPTO22s draw 12 mA input current each.

I'm not 100% sure, but I believe a PC parallel port is 12V DC, so no you cannot connect them to a parallel port. They draw 12 mA each so I would not connect them to a parallel port without using a "line driver" in any case.


----------



## CraigInPA (Sep 28, 2007)

The OAC5's trigger on 5v TTL logic. The Kit-74 triggers on 12v. They are not compatible. OAC5's switch AC voltage only. If you want to switch DC voltage, you'd want an ODC5. To replace the ones in a kit-74, you'd have to find SSR's that switch on 12v, which I don't think exist.

The PC parallel port is a 5v TTL signal, but can source and sink virtually no current. To connect anything, even an LED, to it, you'd need a buffer chip, like an 74LS244 or it's higher current cousin, the 74HC244. To connect your OAC5 SSR to the parallel port, you'd connect +5v to the +in connector on the OAC5, and the -in to a 330 ohm resistor. The other end of the resistor you'd connect to the output side of the 74HC244. That particular port input side would be connected to the parallel port and the gate side of that particular port would go to ground on the parallel port connector. The resistor is there to give you a nice clean off/on. You'd connect your output load across the two load terminals on the SSR. Depending upon your operating system, directly writing to the parallel port may be impossible, as some operating systems (like windows XP) block applications from accessing the hardware directly.


----------



## Dr Morbius (Sep 21, 2004)

CraigInPA said:


> The OAC5's trigger on 5v TTL logic. The Kit-74 triggers on 12v. They are not compatible. OAC5's switch AC voltage only. If you want to switch DC voltage, you'd want an ODC5. To replace the ones in a kit-74, you'd have to find SSR's that switch on 12v, which I don't think exist.
> 
> The PC parallel port is a 5v TTL signal, but can source and sink virtually no current. To connect anything, even an LED, to it, you'd need a buffer chip, like an 74LS244 or it's higher current cousin, the 74HC244. To connect your OAC5 SSR to the parallel port, you'd connect +5v to the +in connector on the OAC5, and the -in to a 330 ohm resistor. The other end of the resistor you'd connect to the output side of the 74HC244. That particular port input side would be connected to the parallel port and the gate side of that particular port would go to ground on the parallel port connector. The resistor is there to give you a nice clean off/on. You'd connect your output load across the two load terminals on the SSR. Depending upon your operating system, directly writing to the parallel port may be impossible, as some operating systems (like windows XP) block applications from accessing the hardware directly.


So it's possible to do this with the proper resistors and buffer chip? I'd then also need to mix the AC or DC versions of SSR's to mount to my homemeade board and hook up my lights to the AC ones, and Wiper motor or other DC devices to the DC SSR's, correct? I'm using VSA to access the Parallel port, so writing code isn't an issue.


----------



## CraigInPA (Sep 28, 2007)

Yes, with the proper resistors and gate chips, you could easily build an 8 port output off your parallel port.

If you wanted to expand beyond that, you'd probably want to consider something actually designed for this purpose. National and Measurement Computing both make digitial i/o cards that range from 24 to 96 outputs, depending upon model. You can find these on ebay very inexpensively. Many of the ones from Measurement Computing come in two models, normal and high current. The difference is one can directly drive the SSR's (high current version), and the other cannot without swapping the socketed 74LS244's for 74HC244's and installing the extra resistors onto the board. Measurement Computing offers versions with ISA, PCI, and USB interfaces. Typical part numbers are ISA-DIO24, ISA-DIO24H, PCI-DIO24, PCI-DIO48, PCI-DIO96, USB-DIO24H, and USB-DIO96H. Your "missing link" might be software support in vsa, though. Light-o-rama supports these, so vsa might also.


----------



## Diaval (Nov 9, 2007)

gmacted said:


> I agree with jukingeo except for the following statement.
> 
> A MOSFET is a transistor ... it's a "Metal Oxide Semiconductor Field Effect Transistor" hence the name MOSFET.
> 
> I agree that you could use it, but it is still a transistor.


Getting a little picky now aren't we?

Fine, it may have been a poor way to explain it...but the point I was making is that the two kinds of devices are VERY different. So, I guess you opened a can of worms and it is time for a clarification.

Bipolar transistor V.S. MOSFET 101:

Physically both the bipolar transistor and a fet transistor can share an identical appearance (which is another reason I used the term 'like' a transistor). A standard bi-polar transistor is defined by the leads Base, Collector, and Emitter. A Mosfet (and a standard jfet) are defined by Gate, Source and Drain.

A bi-polar transistor is a silicon based device. Normally CURRENT that flows through a complete circuit via the Base and Emitter (depending on circuit design) controls a much larger current flow from the Collector to Emitter circuit. Because of it's current control and interaction between the two circuits a transistor acts as either an amplifier or a switch. However, because of the way the transistor is designed, the Collector to Emitter flow can very well affect the current draw on the Base to Collector circuit. Thus care has to be taken to ensure that excessive current isn't drawn from the control circuit.

Now a field effect transistor (or fet) works differently. The seem very much akin to the bipolar transistor above, but with one major difference. The source and drain are pretty much connected together and you normally get a low resistance between the source and drain. A negative VOLTAGE on the gate is what controls the flow. So the operation is technically reversed that of a bi-polar transistor. Many electronics newbies often mistake a fet for a regular transistor when they test it in circuit, they think it is shorted and bad.

So this is how it works: If you can picture the source and drain as analogous to a rubber pipe that normally has a flow of water going though it. Now take a pipe clamp, put it on the middle and start turning the clamp shut. Eventually you will cut off the water flow. This is how a fet works but electrically. By increasing the VOLTAGE on the gate (which is usually a negative voltage) you are activating the gate. Eventually once the voltage is high enough, you 'cut off' the source to drain current flow. Now the beauty of a fet is that the gate is effectively isolated from the source and drain...so the source and drain current doesn't pull current from the gate as what would happen in a bi-polar transistor.

If you noticed that I stressed the words voltage and current above. That is for good reason. A transistor is a current controlling device and a fet is a voltage controlling device and this is why you cannot sub one for the other.

Now if you noticed I mentioned fets as Jfets and Mosfets.

This is another can of worms we have to open.

Junction Field Effect Transisors are your 'normal' average every day fets. They are silicon based and you don't have to worry about static electric discharges and what not. The problem with J-fets is that they are small and suited mostly for pre-amps and RF circuits...not power switching. Most cannot handle the current of switching large motors or inductive loads. So here is were we enter the J-fet's bigger cousin...the MOSFET.

The MOSFET or Metal Oxide Field Effect Transistor is once again a different beast and it operates differently from both the bi-polar and j-fet transistor. The MOSFET is constructed in a way that the gate has a memory effect. Applying a voltage one way can latch the source to drain circuit on and inverting the polarity turns it off. (In fact this is how one tests a MOSFET to make sure that is it working). So this is something to watch for and once again, the circuit design is important. Other differences are that a MOSFET can be zapped by static electricity. So proper handling of static sensitive devices applies here. The benefit is that, you can switch fairly high voltages and high currents without taxing your control circuitry.

So if a MOSFET is so great and so simple to use, why not use it in all switching circuits? Good point...The trouble is that MOSFETS are VERY expensive to their bipolar transistor counterparts and if cost becomes a major issue (as with a commercially produced item) one would opt to use bipolar transistors with standard current protection to keep the costs down. A bipolar transistor (and protection resistor) of the same voltage and current would be much cheaper than a MOSFET, BUT you must calculate the value of the protection resistor. Most don't want to be bothered with this...especially those just entering the world of electronics. MOSFETs are just easier to work with.

If you are good with calculating current draws, resistor values and just happen to have access to bipolar power transistors very cheaply, you could use a standard j-fet as a DRIVER to a power transistor and that can keep costs down. But that is extra work and it probably would be simpler to find a good deal or buy a bulk batch of MOSFETS. With companies like Mouser electronics, you could buy a bunch of MOSFETS for a good price.

In conclusion, while the functions of a standard bi-polar transistor and a Mosfet are similar and they both use transistor in the name...The point I was trying to get across is that the two devices operate very differently and if you try to substitute one for the other...you could be headed for trouble and we are talking the release of the magic smoke kind of trouble.

That will be all for today...class dismissed.

JG


----------



## gmacted (Jan 18, 2006)

jukingeo said:


> Getting a little picky now aren't we?
> 
> JG


Not really.

I didn't mean any disrespect by the comment.

I stated in my original reply that depending on the application, one could just use a transistor.

I was using the term "transistor" as a general term. I am well aware of the different types of transistors. Each type of transistor has it's advantages and disadvantages depending on the application.

As a general statement, for switching purposes, one can use a transistor (be it BJT, JFET or MOSFET, etc.). Which one you use depends on your application.


----------



## Dr Morbius (Sep 21, 2004)

CraigInPA said:


> Yes, with the proper resistors and gate chips, you could easily build an 8 port output off your parallel port.
> 
> If you wanted to expand beyond that, you'd probably want to consider something actually designed for this purpose. National and Measurement Computing both make digitial i/o cards that range from 24 to 96 outputs, depending upon model. You can find these on ebay very inexpensively. Many of the ones from Measurement Computing come in two models, normal and high current. The difference is one can directly drive the SSR's (high current version), and the other cannot without swapping the socketed 74LS244's for 74HC244's and installing the extra resistors onto the board. Measurement Computing offers versions with ISA, PCI, and USB interfaces. Typical part numbers are ISA-DIO24, ISA-DIO24H, PCI-DIO24, PCI-DIO48, PCI-DIO96, USB-DIO24H, and USB-DIO96H. Your "missing link" might be software support in vsa, though. Light-o-rama supports these, so vsa might also.


Thanks for the info! I'll look into the i/o boards. VSA accesses the Parallell port directly and each output pin is accessable by a visual interface. Basically it can turn on any one of the 8 output pins and it's duration state can be manipulated by dragging the mouse across the screen at the various "adresses" you preassign at the setup screen. So I don't see why it wouldn't work, unless there is something I'm missing.


----------



## Diaval (Nov 9, 2007)

gmacted said:


> Not really.
> 
> I didn't mean any disrespect by the comment.
> 
> I stated in my original reply that depending on the application, one could just use a transistor.


None taken.

While you and I know the differences in the transistors. Many newbie haunters don't. The last time I used MOSFET and transistor in the same sentence, the poor soul I tried to help, used a bipolar transistor instead....without current limiting resistors. Needless to say he blew a gate out on his controller. Luckily it was ONLY a gate, but it could have been worse.

I guess perhaps I should have stated the MOSFET is a "special" transistor, rather than "like" a transistor. Poor wording on my part.

Anyway, that discussion was really for those who _really_ want to know the differences in the transistors that are out there and that even though they are ALL transistors (as you pointed out), there are very much different and as my instance above, interchanging them can have diasterous results.

Off Topic: Anyway, on a higher note. Loved your MIB. I am always interested in ways to create good props without pneumatics and I really liked what you did with the mechanism. I can see 'borrowing' that idea.

The only improvement I can see is to use heavier chains on the crate. They look a bit thin. Use car towing chains. They make a really nice rattling sound too .


----------

