I made a simple circuit to control a 12V DC electromagnet, I used an arduino board to control a relay module that turns on a 12V/2A DC power supply that consequently turns on the electromagnet.
Sometimes the relay remains stuck closed, I read that the contacts can weld shut due to too high current.
The electromagnet absorbs 300mA, can the inrush current when the power supply is first switched on weld the contacts?
Hi @Katoz
direct current in relay contacts, can generate "flashes" that damage the contacts.
Place a capacitor in parallel with the relay contacts to damp these arcs and can "stick" the contacts.
I believe a .1 uF capacitor will be more than enough.
Hmmm no not really, but the magnetic effect of the magnet might not be confined to the magnet itself.
Even considering that you have placed the magnet sufficiently far away for it not to influence the coil of the relay. the contacts may still be magnetically holding onto each other.
Don't really know what to say other than, you could try and make the relay switch the magnet 'off' or in other words, connect it so that when the relay is in rest the magnet is connected, and the relay pull the contacts loose/ The force of that may be enough to do so and is probably more than the force spring has to pull the arm to the other side.
The relay modules that the usual suppliers provide (usually with Songle relays or the like) are very inexpensive, so I wouldn't expect the relays to be very high quality. Perhaps try another one or just go straight to using a MOSFET.
300mA@12V is not going to weld any contacts. Just relax. Make sure you have a flyback diode on the load though. There is no "inrush" to an inductive load.
No such thing. An electromagnet is an inductor. An inductor is the very opposite of inrush current, the current builds up relative slowly.
There may however be an brief spark ("arc" for currents much higher then you cite) but while this does tend to some extent to damage the contacts, the contacts must actually separate for an arc to happen, so that would not tend to weld them either.
How do you know it is stuck and how did you "un-stuck" it then?
What is happening is the electromagnet does not like the current to change. When you first turn it on the current ramps up (no inrush)
However when you try to turn the electromagnet OFF the electromagnet wants to keep the current flowing. To do this the electromagnet generates a voltage in an attempt to keep the voltage flowing. This voltage can be very high and can be enough to eventually damage contacts.
A solution would be to put a diode across the electromagnet. The diode should be connected such that the diode will not conduct when the electromagnet is being powered.
I know it’s stuck because it doesn’t click and I checked the contacts: the NO contact it’s closed and vice versa.
I tried tapping the relay while arduino was sending the signal to activate the relay, it didn't work so any suggestions are welcome.
I'm starting to think these relays suck and it’s not a current problem
Some time ago the relay stuck, I don’t know how and I don’t remember how I fixed it. It could have been even a software issue but I seem to remember it happened right before I changed the 230V electromagnet with the 12V DC one plus the power supply.
Last week I wanted to add a 5V fan to the other relay but it it wasn’t working so I changed the entire module.
In the new module the fan relay was working but the other relay wasn’t, after a couple of tries it started working but shortly after it was stuck in the closed position
I apologize for the confusion but I had not paid enough attention when there was the problem and I'm starting to remember details.
It happened a couple of times in the past but it wasn’t stuck.
If I remember correctly the relay was staying closed but because the Arduino board was sending a constant signal for some reason. If I turned off the Arduino board, the relay opened and as soon as I turned on the Arduino again, the relay closed.
The same thing happened last week, the relay opened and closed a couple while I turned the arduino board on and off but this time the relay stuck closed
Hi,
Can you please post a circuit diagram of your project, including power supplies?
Can you post a picture(s) of your project so we can see your component and wiring layout?
What model Arduino are you using?
It sounds like sometimes you have the controller lockup, this could be due to wiring picking up switching transients when operating the solenoid.
You have got ALL the 12V solenoid wiring AWAY from the controller and its wiring?
How are you powering your UNO?
I tried but you can't tell anything from the photos
A NodeMCU ESP8266 ESP-12F board
The 5V power supply which powers the board, the board itself and the relay module are in a electrical box, it's not that packed but maybe the 230V could create some interference.
The 12V power supply/solenoid are 1 meter away from the electrical box, there is only one limit switch nearby which I use as an input
yes, I use this in the configuration function
// initialize the relay pin as an output:
pinMode(relay, OUTPUT);
digitalWrite(relay, 1);
Hi @Katoz
Your "schematic" shows that you are turning off the 220V that feeds the primary of your 12V source.
When turning off the relay, the power supply output can still have 12V for a while and thus keep the solenoid activated.
Turn off the 12V output that goes to the solenoid.
OK, in summary, if it was only one relay, then it is possible that it is faulty and tending to mechanically stick.
However, if it releases with the power turned off, than that simply suggests the logic is holding it closed.
Now, you show the relay controlling not the solenoid but a power supply powering the solenoid. If this is a switchmode (lightweight, cool) unit then it most certainly does have an "inrush" current to charge the input capacitor and is operating at mains voltage, not the 12 V. It might be better to switch the 12 V DC and put a diode across the solenoid (in the direction that does not conduct when it is powered). Possibly safer as we do not always trust those relay modules!
"Wiring dress" to prevent relay switching impulses crashing the microcontroller is a whole separate topic.