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.

Solenoid noise resets microcontroller

Status
Not open for further replies.

lloydi12345

Member
Hi, I have a project which controls a pressure valve. I'm using PIC18F4620 to control it. The problem is that everytime I activate the relay through an optoisolator the microcontroller restarts.

View attachment 65410

The opto isolator just acts like a transistor since I haven't found any transistor here yet. I'm controlling the relay with 31Vdc, a rectified voltage from 24Vac. Everything uses the same power source. The relay used was MY4N from OMRON.

Everything works fine when the solenoid is not connected to the relay so I guess it's with the solenoid.

By any means do you think I could clean out EMF produced by solenoid? :)

Regards,

lloyd
 
Thanks for the replies. I'm using MY4N relay from OMRON.

Here's the circuit.

On the 6 pin connector (SV3):
Pin1-24Vac
Pin2-24Vac
Pin3-24Vdc (It's actually approx 31Vdc)
Pin4-pin of Speaker(other pin is connected to 24Vdc)
Pin5-pin of Relay for Gas valve(other pin is connected to 24Vdc)
Pin6-pin of Relay for Solenoid valve(other pin is connected to 24Vdc)
 
Last edited:
So do you mean I will connect 1n4004's cathode to the inductor's output and anode to 470uF positive pin?

Inductor ----|>|---- 7805
 
Hi,

I had a ordinary home box fan trigger the "on change" pins on a PIC one time. Instead of looking into it electrically however i changed the program to make it be able to deal with getting faux on change interrupts. The fan was of course completely isolated from the PIC chip because it plugged into its own AC outlet. So the pin must have been able to pick up the inductive spike when the fan was turned on or off. Funny if i wanted it to do that it would probably take a week to get working :)

I never had one reset though and i've operated in some pretty noisy environments. But other folks have had the same problem with the on change interrupts as you can read on the MC site.
 
Last edited:
A reverse diode across the solenoid may be needed.
Hi ronv, sorry but this is not possible on designing the circuit since I can't modify the internal electrical connections where solenoid is available.

The ASCII diagram looks right, but the cathode is on the right (to the 7805) the anode is on the left.
Oops sorry I interchanged cathode and anode, yeah the diagram it is
Hi,

I had a ordinary home box fan trigger the "on change" pins on a PIC one time. Instead of looking into it electrically however i changed the program to make it be able to deal with getting faux on change interrupts. The fan was of course completely isolated from the PIC chip because it plugged into its own AC outlet. So the pin must have been able to pick up the inductive spike when the fan was turned on or off. Funny if i wanted it to do that it would probably take a week to get working :)

I never had one reset though and i've operated in some pretty noisy environments. But other folks have had the same problem with the on change interrupts as you can read on the MC site.
Yeah, if only I could have different power supply this would never be a problem. Can you link me to the discussions there on micrcohip that could help me?

I have seen this link: **broken link removed** I haven't tried it yet.

Also, I will be trying later disabling brownout reset on the PIC.

I hope at least one on the to do list would solve my problem.

Is it possible to have separate grounds in just a single power supply? maybe creating another rectifier bridge diode? to get another power supply and ground for the noise?

Thank you guys. I hope to have more suggestions.
 
From what you've said, it's not the relay but the solenoid that's causing the reset. I would assume that it's the high current through the relay dropping the rail rather than the inductive kickback. What is the resistance of the solenoid? Increasing the cap on the supply may help, or as you said, use another bridge rectifier to power the solenoid -- provided that your transformer can supply sufficient power.
 
Hi ronv, sorry but this is not possible on designing the circuit since I can't modify the internal electrical connections where solenoid is available.

Hmmm. That's to bad -- All those arcs and sparks on the 24 volt line.
Maybe a zener or TVS diode across the relay contacts.
Make sure the relay contacts and solenoid ground come directly from C10 and not thru other traces on the board.
 
Hi ronv, sorry but this is not possible on designing the circuit since I can't modify the internal electrical connections where solenoid is available.


Oops sorry I interchanged cathode and anode, yeah the diagram it is

Yeah, if only I could have different power supply this would never be a problem. Can you link me to the discussions there on micrcohip that could help me?

I have seen this link: **broken link removed** I haven't tried it yet.

Also, I will be trying later disabling brownout reset on the PIC.

I hope at least one on the to do list would solve my problem.

Is it possible to have separate grounds in just a single power supply? maybe creating another rectifier bridge diode? to get another power supply and ground for the noise?

Thank you guys. I hope to have more suggestions.


Hi again,


As others have suggested, it could be as simple as the power rail being pulled down when the coil is energized. Did you try a bigger cap on the power supply rail for the uC chip alone? That could solve the problem right there. It sounds like a simpler problem than the on change pin problem.
 
Last edited:
Do you have any decoupling caps right at the uC pins? I see three 0.1 uF caps at the output of the 7805. Where are they actually positioned on your PCB?

I would suggest one of them by pins 11-12, and another by pins 31-32. And at least 10uF of electrolytic at the output of the 7805.
 
Thank you for your inputs. I replaced 1n4148 with a metal oxide varistor and it helped a little. The problem was solved after I rerouted the ground connection of the relay to C1's ground.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top