MCU reset when relay is on, dip in supply

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
594
I have to drive ac load through relay by micro controller. Problem is MCU reset as power dips when relay is on or off.
Relay contact is 220Vac/50Hz. My circuit is follow:

1. TO power the MCU I have +5V supply from SMPS of 2A(current is more than enough).
2. There is separate isolated 12V in circuit.
3. MCU pin drive opto, which Then turn on relay by 12V which turn on/off the laid.
4. problem is there is huge dip in supply which caused MCU reset. Although I have isolated 12V & 5V supply.
I have placed a diode in series of +5V also, no effect.
Huge parallel capacitors 1000uf/470uF/10uF/0.1uF very close to MCU supply but no effect.
There is free-wheeling diode on relay & relay card is separated from MCU board, jumper wires connect two boards.

5. One thing I have noticed that there is dip only when load is connected across relay, if load is disconnected then there is no dip in supply, relay turn on/off correctly.
If I connect load across it even a zero watt bulb even then dip happens

6. I dont understand that when +5V & +12V are isolated then why there is dip in +5V supply? There is huge spike across +5V supply.
7. I haven't tried snubber across the relay load contacts, since it is ready made relay board.

What could be the problem.
 

ericgibbs

Joined Jan 29, 2010
18,848
hi,
Incorrect routing and assignment of 0V , ground paths is a common problem.
How are the 0V lines connected from the power supplies to the various modules.?
Do you have a photo of the project you could post.?

E
 

crutschow

Joined Mar 14, 2008
34,428
I also suspect some sort of grounding problem.
It would seem the two circuits aren't as isolated as you think.
Is the 12V ground totally separate from the 5V ground?
What type of power supply generates the 12V?
 

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
594
It is a spike. Max voltage goes upto 25V or so & dips to -10V or so when checked on CRO. THough I have long ground probe of CRO around 30cm. Attached is the screenshot.
I will paste the schemtic also. But isolated smps +5V powered MCU drives +12V opto which then drive a relay. SMPS is 3.5A.
If I disconnect the load no spikes however even if small bulb is connected there is reset problem.
Relay are of OMRON with free-wheeling diode on it.



Problem is there is lcd(20x4) connected which start showing something giberish. Although MCU keeps on operating i.e driving outputs/input led/switch.
I have assumed that MCU reset since I see gibbberish on LCD.
 

Attachments

Papabravo

Joined Feb 24, 2006
21,225
We are nine posts into this thread and still no schematic diagram. I feel that I need to impress upon you the need to lead with a schematic when you have a problem, otherwise help may be a long time in coming if at all.
 

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
594
1. Attached is the ckt.
2. I had found that in actual board while making ground of +5V & +12V are shorted together.
Relay is on other board then MCU itself.
I have noticed that its not the MCU which gets reset but first a line get printed in gibberish which printed ok if load is not connected. Then everything printed on lcd is gibberish.

Load is a bulb of around 15W.
I have two ckts one uses PIC16 other uses AT89C51, both misbehaving in same way.
And problem occurs only when load is connected if load is removed & relay is turned on/off then there is no problem.
In my above post I have shown the spike in MCU supply(though CRO ground lead is large.)
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,087
Agree, there seem to be some missing components. Now, when I review the original question:
I have to drive ac load through relay by micro controller. Problem is MCU reset as power dips when relay is on or off.
Relay contact is 220Vac/50Hz. My circuit is follow:
and that circuit that has now been provided. There is optical isolation. So, I wonder whether the AC load (a motor?) is so much that it causes lights in the building to dim when it comes on. That with a poorly regulated 5-V supply could cause the MCU to reset.

How big is the AC load? What is it? Do the building lights dim when it comes on?

EDIT: As an experiment, try running your MCU from a separate battery pack.

John
 
Last edited:

ScottWang

Joined Aug 23, 2012
7,400
Already 14 posts, but still can't get into the point, should we lock the thread temporary until the TS reread all the posts and mentioned points, and prepared the completed schematic and click the report button to continuing the discussion?
 

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
594
1. Attached are the images of project.
CRO probe photo has very small ground wire on it for measurement.
All CRO photos are taken through it.
One of PIC has lcd problem which is shown.

Wire from +5V smps runs around 75cm before going to board.

2. Earlier I had left lcd(20x4), pins D0-D3 left floating. I am using lcd in 4 bit mode. But then I short them & grounded them, I saw problem even rises more & lcd hangs more.

3. Due to these spikes many times AT89C55 hangs but PIC didn't hang it keeps on operating, I have disabled PIC's BOR. But in both cases lcd shows gibberish or all black lines as in attached pics.


4. Attached is the ckt. Its not exact pin to pin. But connections are like this only.

5. Tomorrow I will try by placing a series diode after +5V then a ferrite bead & then decoupling cap of 10uF. Bith in +5V & for +12V.
Also will placed EMI filter capacitor in parallel i.e a 0.15uF cap & 1M in parallel at 220Vac input of SMPS.

Then will note the results.
 

Attachments

nerdegutta

Joined Dec 15, 2009
2,684
4. Attached is the ckt. Its not exact pin to pin. But connections are like this only.
Why have you connected VCC (U17s PIN 40) to ground? With an electrolytic capacitor?

then decoupling cap of 10uF.
Is this a little bit high for a decoupling cap? Other circuits I've seen use 0.1uF ceramic capacitors.

I'm not able to do anything useful with the pictures. Too dark and out of focus.

Already 14 posts, but still can't get into the point, should we lock the thread temporary until the TS reread all the posts and mentioned points, and prepared the completed schematic and click the report button to continuing the discussion?
I think the TS will make a proper schematic, and clear enlightened pictures.

Time will show. :)
 

ScottWang

Joined Aug 23, 2012
7,400
LED1 -- It is a indicator for the status of relay.
Q1 -- Choose a Ic current big than 3 times of relay.
R3 -- Adjust the values according to the current of relay.
R2 -- It is a pull low resistor to turn off the Q1 quickly.

PC817 to drive 12Vrelay_ScottWang.gif
 
Top