Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

24volt SSR- microcontroller connection

Status
Not open for further replies.

joshua17ss2

New Member
**broken link removed**
I recently got the relay board above, populated with 20 24 volt SSR's, what i want to do is connect it to a simple microcontorller to allow me to turn them on and off. ive been looking over the board, i think all that require is to connect a control pin to a ground pin, the board has a main power terminal on it. there also appers to be resister networks inbetween the line before the 24 volts reachs the control pins, i was wondering if i could connect it directly to the microcontoller, thinking this wouldnt work and will cost me the controller.
I have H11d2 optocouplers, i was wondering if they would be ok to use as a buffer between my controller and the relays.
i posted the datasheet above that has the schematic for the board
**broken link removed**
those are the relays that came on the board.
Any help and input on this would be greatly apprciated
thanks
josh
 
24V across the pins of a MCU would fry it. Include a 5V regulator.
 
If the relays require 24V to control then you would need a buffer to translate the 5V logic from the uC to the 24V required by the board. Since the board relays aready have optoisolator coupling you could just use a transistor (with appropriate bias resistors) to translate between the voltages. The H11d2 should also work but it's not necessary.
 
Wouldnt using a 5v regulator stop the relays from turning on if placed in the circuit?- they are rated for 15 - 30 vdc control voltage.
I was actually wondering if mabye thats what the resistor network was there for, dropping the voltage low enought to run on a controller.
I am aiming for a very low part count for the connections, thats why i was hoping the optocouples i have extra of would do the trick, connect them to the ground and control and a single resistor on the emitter side and then straight to the controller, provides isolations from the higher voltage and a low part count.
im not sure if the colleter side needs any specific requirements to be meet for triggering and making that connection.

thanks
josh
 
crutschow said:
If the relays require 24V to control then you would need a buffer to translate the 5V logic from the uC to the 24V required by the board. Since the board relays aready have optoisolator coupling you could just use a transistor (with appropriate bias resistors) to translate between the voltages. The H11d2 should also work but it's not necessary.

Any specific Transistor in mind, or just a standard switching transistor

I was thinking of going with the h11d2s because i already have 50 of them in my parts bins, but i wasnt sure if they would need a bunch of parts to connect the 24 volt control pin to the ground pin.

thanks josh
 
Last edited:
joshua17ss2 said:
Any specific Transistor in mind, or just a standard switching transistor

I was thinking of going with the h11d2s because i already have 50 of them in my parts bins, but i wasnt sure if they would need a bunch of parts to connect the 24 volt control pin to the ground pin.
According to the board data sheet, there are 3.3k ohm pullup resistors to the logic voltage (24V in this case) which means you have to sink about 7.2mA to control the relays. The problem with the h11d2 is that it has a gain of much less than 1. The data sheet shows a saturated output of 0.5mA for a 10mA control voltage. Thus you would need about 150mA input for a 7.2mA output however the max allowed input is only 80mA. Thus not a viable option I think.

Any general purpose/switching transistor that has a 100mA, 50V minimum rating should do, something similar to the NPN 2N2222 for example. There are literally hundreds of types that would work.

You would need a base resistor to the logic input signal. For a 5V control, the resistor value should be about 6k ohm (value not critical). The emitter is connected to ground and the collector to the the relay contol line. You need to apply 24V to the board logic voltage input. Remember that the transistor inverts the logic.
 
Would this be a good tutoiral on how i can connect the transistor to the ciruit, just sub the LED for the control pin and ground line, and alter the resistor values alittle.

I just need the simplest connection from microcontroller to relay that there can be. The 2n2222 says its rated for 60 volt max in the data sheet, i might have a bunch of these in my bin aswell.
i will be able to make up some simple ciruits this weekend and give them a try.

im still really new to electroincs, i got the general concepts, still working on the details of building circuits from scratch.
Thanks josh
 
No, only a 5V regulator that connects power to the MCU, not the relays.
 
joshua17ss2 said:
Would this be a good tutoiral on how i can connect the transistor to the ciruit, just sub the LED for the control pin and ground line, and alter the resistor values alittle.
Yes. That's the basic circuit. As I said the 100k ohm base resistor should be changed to about 6k ohm, which also goes to the 5V logic signal.
 
I dont fully understand the purpose of those 3 groups of 3.3 k resistor networks on the control lines are for. i think i understand the board its self, the 1 terminal on the side i connect the 24 volt supply there to power everything, would just connecting the control pin to the ground do the trick, just a direct short between the 2, or does it need any kind of signal.
I just want to make sure i get a first grasp on the information about this board.


thanks josh
 
joshua17ss2 said:
I dont fully understand the purpose of those 3 groups of 3.3 k resistor networks on the control lines are for. i think i understand the board its self, the 1 terminal on the side i connect the 24 volt supply there to power everything, would just connecting the control pin to the ground do the trick, just a direct short between the 2, or does it need any kind of signal.
Yes, it's quite simple. You just short the inputs to ground to turn on the relay. Leaving the inputs open turns off the relay. The relays are current controlled and the resistors determine the amount of current for turning them on (in this case about 6-7mA), thus there is one per relay.

In this design you turn on the relays by sinking the current from the 3.3k ohm resistor through the control terminals of the relay to ground (which can be done by a transistor). Applying 5V to the transistor base resistor turns on the relay, 0V to the transistor base resistor turns off the relay.
 
Last edited:
Awesome i think i fully understand what need to be done to get this working for my purposes, you have been a big help. thanks for being patient with me

thanks
josh
 
ok i managed to go thought my parts bins and the resistors that i have in stock are 2N3906 PNP transistors, they apper to be rated for 40 volts which is well over the 24 im using, and the emitter is rated at 5 vm the power disipation is rated 300mw, this would appear to fit the bill for what im doing.
ill give it a shot and see what happens
 
transistor selection

I looked thought the data sheet for the 2N3906 pnp transistor, it looks like it can switch the voltage, it also says that the emitter base it 5vdc, does that mean that i can do away with the resistor on the control side the connects to the microcontroller. or does that resistor provide a specific function other then altering the voltage similar to resistrors used on led's

I also had one question about making the circuit, the ground pin on the transistor is shared correct, the ground of the 24 volts will connect to it and the 5 volt ground off my controller will connect to this as well, since the ground line is 0vdc this is safe, then all i have to do is send the microcontroller pin to high to activate the transistor and inturn switch the selected relay. Is this the general concept.

does NPN or PNP type matter?

Thank you
josh
 
joshua17ss2 said:
I looked thought the data sheet for the 2N3906 pnp transistor, it looks like it can switch the voltage, it also says that the emitter base it 5vdc, does that mean that i can do away with the resistor on the control side the connects to the microcontroller. or does that resistor provide a specific function other then altering the voltage similar to resistrors used on led's

I also had one question about making the circuit, the ground pin on the transistor is shared correct, the ground of the 24 volts will connect to it and the 5 volt ground off my controller will connect to this as well, since the ground line is 0vdc this is safe, then all i have to do is send the microcontroller pin to high to activate the transistor and inturn switch the selected relay. Is this the general concept.

does NPN or PNP type matter?
NPN or PNP certainly matters, they are opposite polarity. The NPN operates with a positive voltage on the collector and base, the PNP with negative. You need an NPN similar to a 2N2222.

If you notice, the 5V base-emitter voltage is in the "Absolute Maximum Rating Section". That's the maximum reverse voltage you should apply to the base-emitter junction. The normal forward-biased base-emitter voltage of an operating silicon transistor is about 0.65V (similar to a diode). You thus definitely need a base resistor to establish the desired base current.

Yes, the emitter pin of the transistor would go to the shared ground.
 
6V is the base-emitter reverse (negative) voltage maximum rating which of no concern in this application, since you will never reverse bias the base.

The current needed to switch the transistor ON is determined by its current gain (Ic/Ib). To turn on a transistor with low collector-emitter voltage, a current gain of 10 is typically used (see Vce(sat) data on pg.2 of the data sheet) . Thus the 7mA collector current for this application would require a base current of 0.7mA. With a 5V control signal and a typical 0.65V base-emitter voltage (see Vbe(sat) data on data sheet), the base resistor required value is (5-0.65)/0.7mA = 6.2k ohm.

The base resistor value is not critical and can easily be +/- 20% of nominal with no significant change in operation.
 
test

I build the circuit, and connected everything, sketeched up my schematic, i put it all on the breadboard, i only had a 4.7 Kohm resistor so i went with that i think it might be causing the problem when i apply 5 v nothing happens but i noticed that when i touch the base pin or the resistor attached to this base pin the relay turns on. other then the value of my resistor what could be causeing this to happen.
thanks josh
 
joshua17ss2 said:
I build the circuit, and connected everything, sketeched up my schematic, i put it all on the breadboard, i only had a 4.7 Kohm resistor so i went with that i think it might be causing the problem when i apply 5 v nothing happens but i noticed that when i touch the base pin or the resistor attached to this base pin the relay turns on. other then the value of my resistor what could be causeing this to happen.
thanks josh
It doesn't make sense. The resistor value should not be a problem.

Where are you applying the 5V? It should be connected to one end of the base resistor and the other resistor end connected to the transistor base. If so, then touching the base or base resistor should have no effect. Sounds like something is floating or you're missing a ground connection, perhaps between the 5V supply and the relay circuit? Remember the current always has to have a return path to the source.

Please attach a schematic of how you've connected it.
 
That is the basic lay out i used. the i had the resistor connected to the base, and the 5 volt supply connected to the resistor, the ground from the relay and the supply shared the emiitter, and the 24 v control line to the collector.

i used a 5volt power supply to sub for the microcontroller at the moment, i just used a momentary switch in line with the base

thanks josh
 

Attachments

  • tranload.gif
    tranload.gif
    3.1 KB · Views: 193
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top