Relay not switching

Thread Starter

Lavanya.R

Joined Dec 9, 2014
24
Hello Team,

I have designed a circuit in which the microcontroller's 8 pins for output control: 4 pins are assigned to relay outputs and the other 4 pins are used as general digital outputs. I have now fabricated the PCB and started testing.

The issue I am facing is that the digital outputs are working correctly, but the relay output section is not triggering the load. I connected a capacitive proximity sensor as the test load — when the relay is activated, the sensor should power ON for testing purposes. However, the sensor does not turn ON, not sure relay itself is triggering

I am unable to identify the root cause of this issue. I am attaching the circuit schematic here. Could anyone please review it and provide some insights or suggestions on what might be wrong?

Thank you in advance for your support.

Relay section
1764921602453.png

digital output section

1764921641571.png
 

MrChips

Joined Oct 2, 2009
34,626
In the digital output section, the opto-coupler transistor is configured as a common emitter amplifier. Why did you do it differently in the relay section, i.e. the transistor is configured as a common collector amplifier?

A common collector amplifier has a voltage gain of less than 1.

Try reducing the value of R1, R3, and R15.
 

MisterBill2

Joined Jan 23, 2018
27,159
Aside from there being a resistor across the relay to waste part of the drive current, there is also a resistor in series to limit the base drive, also reducing the relay current.
In a power control switching scheme the transistor is supposed to be driven into saturation! What I see assures that will not happen.
In a transistor switch controlling a DC relay I have NEVER seen a relay coil shunted by a resistor, unless there is another series load that requires more current.
IN ADDITION, the pale blue lines and text are a challenge to read. The text inside the flags is impossible to read.
 

sghioto

Joined Dec 31, 2017
8,633
I am unable to identify the root cause of this issue. I am attaching the circuit schematic here. Could anyone please review it and provide some insights or suggestions on what might be wrong?
Showing a single relay control circuit for clarity.
Observe polarity on the inputs to IC4 with respect to Cathode and Anode.
Change values of R15 and R43 as listed.
R73 removed, not needed.
Transistor Q13 is overkill, a 2N3904 or equivalent is sufficient.
K1 relay is listed as a 24Vdc type on the schematic. I'm assuming that is an error, the correct part# is G5Q-1A4-DC5V if using a 6.2 volt supply. The relay can handle the higher coil voltage from the spec sheet.
1764968954684.png

1764968796764.png
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,159
The circuit in post #4 should work. Both resistor values may need adjusting to allow the required current flow in each of those circuits.
 

Thread Starter

Lavanya.R

Joined Dec 9, 2014
24
Showing a single relay control circuit for clarity.
Observe polarity on the inputs to IC4 with respect to Cathode and Anode.
Change values of R15 and R43 as listed.
R73 removed, not needed.
Transistor Q13 is overkill, a 2N3904 or equivalent is sufficient.
K1 relay is listed as a 24Vdc type on the schematic. I'm assuming that is an error, the correct part# is G5Q-1A4-DC5V if using a 6.2 volt supply. The relay can handle the higher coil voltage from the spec sheet.
View attachment 360045

View attachment 360044
Hi sghioto,

Sorry for the delayed response, and thank you for the helpful input. To confirm, the relay being used is a 24 V model, part number G5Q-1A4-EU DC24.
 

sghioto

Joined Dec 31, 2017
8,633
Then the tag QVDC/6.3C is 24Vdc?
If that's true then R15 and R43 can be changed back to 10K.
Most likely the problem was the incorrect polarity on the input side of IC4.
 
Last edited:

Thread Starter

Lavanya.R

Joined Dec 9, 2014
24
Then the tag QVDC/6.3C is 24Vdc?
If that's true then R15 and R43 can be changed back to 10K.
Most likely the problem was the incorrect polarity on the input side of IC4.
Yes, the relay coil voltage (QVDC) is 24 V. This 24 V supply powers both the relay outputs and the regular digital output section. On the input side, the I/O pins of the controller are used, with the alternate even-numbered pins connected to ground.
 

Thread Starter

Lavanya.R

Joined Dec 9, 2014
24
Is the circuit working now?
After further review I see that the inputs of IC4 are actually non polarized, designed for DC or AC control.
Meaning that the circuit in post #1 should be working as designed.

View attachment 360216
I also expected it to work, but in practice only the digital output section is functioning. The relay section is not switching. I connected the proximity sensor’s positive to the NO terminal and 24 V+ to the COM terminal, with the sensor’s negative connected to 24 V−.
 

panic mode

Joined Oct 10, 2011
4,864
the very first image in the thread should work. values are also ok. to diagnose it, measure voltages at pins 1,2,16,15 of the optocoupler both when D22 is true, and false.
 

AnalogKid

Joined Aug 1, 2013
12,043
In the digital output section, the opto-coupler transistor is configured as a common emitter amplifier. Why did you do it differently in the relay section, i.e. the transistor is configured as a common collector amplifier?

A common collector amplifier has a voltage gain of less than 1.
In both schematics, the opto output transistor is acting as a saturated switch, not a linear amplifier. The nice thing about having no base connection is that an opto can act as a non-inverting saturated switch.

ak
 

AnalogKid

Joined Aug 1, 2013
12,043
What is the reason for having a resistor in parallel with each relay coil?

Also, check the two transistor pinouts. The 2ST31A pin *number* sequence is different from that of the MMBT3904.

ak
 

MisterBill2

Joined Jan 23, 2018
27,159
Another possibility, one that caused me a considerable amount of grief at the time, is that diode across the relay coil might possibly be a reversed connection. So before giving up, remove the diode. Contrary to the belief of some folks, not having that diode across every inductance will not result in the end of the world.
And an incorrect polarity of that diode WILL CERTAINLY prevent correct circuit operation. Your alternative is to do some voltage checks to see just what is happening.
 
Last edited:
Top