# 1.8v GPIO controlling 5v 10mA solid state relay

I have a Crouzet 84 134 900 solid state relay that I need to control with a 1,8V GPIO output from a Gumstix Overo Summit expansion board. I've tried the circuit drawn up for me in this answer, however my voltages are different and I don't know how to change it to make it work in my current situation.

I tried to modify the values using this "transistor calculator", and it said I needed a 100 ohm resistor instead of the 160 ohm. But when coupled to the relay, switching the GPIO output made no difference, the relay always got 5V and enough current to be on.

The GPIO output gives me 1.8V and 0.1mA. I have a power supply of 5v 2A available. The solid state relay requires 3-32V and 10mA. I have a few 2N4401 and 2N2222 available. Can I do this with the components I have, or is it a too great amplification for the transistors or something?

• Can you post a schematic of how you have set it up? Jan 25 '12 at 19:28
• The 1.8V digital output can only source 100 uA? Are you sure? Jan 25 '12 at 19:29
• What do you have each of the relay inputs (pins 3 and 4) connected to? Jan 25 '12 at 19:32
• @OlinLathrop I'm not sure. I was unable to find a specification, but that's what I measured. I followed this answer and got it working for a small IC, but the relay requires more current to work than what that circuit provides.
– jfax
Jan 25 '12 at 19:55
• @OliGlaser i.imgur.com/VGEAs.jpg
– jfax
Jan 25 '12 at 21:02

You say you followed Olin's circuit first, but then in the comments you say you tried Russell's circuit. Which one did you use for the relay?

I ask because the two circuits are different. Olin's circuit has the SSR input diode in series with the transistor (i.e. pin3 to V+ and pin 4 to collector) and is driven from the base. Russell's circuit has the input diode in parallel with the transistor (pin 3 to transistor collector and pin 4 to ground) and is driven from the emitter (common base)

Pinout of SSR for reference:

Assuming your GPIO current capability is really more than 100uA (very likely) then Olin's circuit should work if connected correctly.

One more important question - are you switching AC od DC with the relay?

EDIT - thanks for the schematic. According to that you have it wired incorrectly as suspected. Have a look at Olin's schematic again, notice the SSR is between V+ and transistor collector, not V+ and ground. Make changes as suggested and it should work fine.

• Oh shoot. Why the hell did I connect it to ground? Been thinking too much I/O lately. Thanks a million for noticing!
– jfax
Jan 25 '12 at 21:26
• However, when getting that part right, I can only measure 1.3uA from the GPIO port and barely 0.1uA for the relay when the GPIO is high. Relay's still not lighting up...
– jfax
Jan 25 '12 at 23:35
• Sounds like there is something up with your GPIO port then. Are you sure it's set to output and not something like input with weak pullup? To confirm it's not your transistor setup, apply a known 1.8V source to the gate and see if it turns on. Jan 25 '12 at 23:39

Basic transistor laws for a BJT.

Collector Current = Base Current * beta


beta is the "amplification factor" for the transistor you can get from its datasheet.

You're going to put a resistor in series with your base current. Think of the base to emitter as a diode that gives you a 0.7V drop (check the datasheet if you want a more exact/specific value for your transistor). You are applying a voltage (V_pin) to that resistor to allow a current to flow. The voltage drop that resistor will see across it is effectively (V_pin - 0.7) assuming your transistor's emitter is connected to ground with respect to V_pin. And if you have a base resistor of size R_base, by extension you will have a base current of (V_pin - 0.7) / R_base.

So you know you can get a certain current (I_collector) to flow through your collector emitter junction by choosing R_base by the following formula:

R_base = beta * (V_pin - 0.7) / I_collector


So now you want a certain voltage out. Lets say you have V_high volts to source from. Well you know you can generate a desired current by the formula above by picking R_base. Now all you have to do is pick a resistor in series with your V_high that will give you your desired voltage drop at I_desired - using plain old Ohms Law V = I * R.

R_collector = (V_high - V_out_desired) / I_collector


To recap:

1. Pick a transistor (this gives you beta and some maximum limitations)
2. Pick a smallish base resistor (this determines I_collector)
3. R_collector is determined by R_base, V_high, and V_out_desired.

My circuit would look like this:

• Thanks for this great explanation! Cleared all my questions about transistors too!
– jfax
Jan 25 '12 at 21:29
• no problem, glad I could help! Jan 26 '12 at 1:16