How to drive 12V solenoid lock without noise - Page 1
Forum section: electronics / beginners

author: Darlington
author_rank: Contributor
timestamp: October 09, 2024, 01:45:02 pm
content: I'm designing a board to be able to drive 12V powered electronic locks. Now not having the ability to precisely define the type of electronic lock used and its specifications I have doubts about the design. I would like to eliminate the noise that are generated when soilenoids are handled, e.g., EMF backs, etc., which could reset a MCU.So I had in mind to opto-isolate the outputs, but that would be quite unnecessary since my purpose is to use one power supply to derive the supply voltages for MCU and auxiliary voltages and the solenoid supply. I thought an isolated DC DC converter might be a solution, but it is too expensive. The solenoids are driven by a ZXMS6006DGQ-13, and the maximum current available will be 1.5A.Does anyone have any ideas?

author: Zero999
author_rank: Super Contributor
timestamp: October 09, 2024, 01:50:32 pm
content: What noise? Just put a freewheeling down in reverse parallel with the solenoids. Job done.

author: Darlington
author_rank: Contributor
timestamp: October 09, 2024, 01:56:01 pm
content: Quote from: Zero999 on October 09, 2024, 01:50:32 pmI have read on internet and in many forums that even adding a flayback diode can result in spikes that reset the MCU? Is it true?

author: Phil1977
author_rank: Frequent Contributor
timestamp: October 09, 2024, 02:10:47 pm
content: A very efficient way to prevent electrical noise is to slow down the switching.Sometimes it already helps to increase the gate resistor of the FET to artificially make it slower. Of course this increases its dissipation and so you should only do it if the FET is sufficiently oversized.If that´s not enough you can drive a PWM ramp from 0 to 100% and vice versa instead of hard switching. This of course generates lots of noise on the PWM frequency and on its harmonics, but you can filter these frequencies and it prevents sudden spikes or pulse noise.Some magnetic actuators need higher current if they are switched slowly.

author: Zero999
author_rank: Super Contributor
timestamp: October 09, 2024, 02:13:29 pm
content: Quote from: KKK on October 09, 2024, 01:56:01 pmWhy would that be unique to an inductor?Switching any large load can potentially do that.Adequate decoupling on the MCU's supply rail will help avoid noise. The fact that the MCU is powered off a regulated supply and the solenoid on the unregulated supply will help a lot.

author: Darlington
author_rank: Contributor
timestamp: October 09, 2024, 02:20:26 pm
content: Unfortunately, I cannot add a second power supply and thus decouple the power supplies. I thought a different way could be implemented to limit noise

author: Zero999
author_rank: Super Contributor
timestamp: October 09, 2024, 02:30:19 pm
content: Quote from: KKK on October 09, 2024, 02:20:26 pmNo one said anything about adding a second power supply.EDIT:Going by what you've written, you must already have two power supply voltages, because you have a microcontroller, which presumably runs of ≤ 5V and the solenoid runs off 12V. If the regulator powering the microcontroller is working properly, then hardly any of the noise on the 12V rail will pass through to the microcontroller's power supply rail. For example the LM7805 has a power supply rejection ratio of 80dB, which is a factor of 103, so 5V spike on the input will only be 5/103= 500µV on its output.https://www.ti.com/lit/ds/symlink/lm340.pdf

author: Seekonk
author_rank: Super Contributor
timestamp: October 09, 2024, 02:38:03 pm
content: I would just slow down the FET with a cap and resistor. Put a diode in series for faster turn on in parallel with another resistor to make the turn off slower.

author: PGPG
author_rank: Frequent Contributor
timestamp: October 09, 2024, 03:04:44 pm
content: Quote from: KKK on October 09, 2024, 02:20:26 pmI use relays for such output (even the same power source is used) and instruct installer to make lock circuit having no common part with controller supply circuit (going through separate wires just from supply).If you drive output(s) with no isolation in your device (for example with OC outputs) than at least (-) connection from supply to your device has the common wire with lock circuit and whole lock(s) current(s) (10 or more times higher than your circuit supply current) travels (with its on/off changes) through your GND just under your microcontroller.

author: Darlington
author_rank: Contributor
timestamp: October 10, 2024, 11:05:51 am
content: Quote from: Zero999 on October 09, 2024, 02:30:19 pmExactly. I have the 12V voltage coming from an AC-DC power supply. This voltage is lowered to 5V (auxiliary voltage), and to 3.3V for MCU. Even through the effect of the LDO I would still have the possibility of some noise coming back from the GPIO pin not through the power rails. Maybe I am misunderstanding when you talk about “decoupling.” To me decoupling means that there is no some relationship between the two supplies neither between the grounds.

author: Circlotron
author_rank: Super Contributor
timestamp: October 10, 2024, 11:24:32 am
content: If you're only switching 12 volts, as well as the diode across the solenoid, put several K of resistance in line with the mosfet gate, and in particular, a 1uF film cap from source to drain. The cap especially will calm things down a whole lot.Putting a diode across the solenoid will clamp the voltage spike, but you are still interrupting a flow of current in a matter of nanoseconds, so there will be some degree of high frequency ringing from the stray inductance and capacitance that might find its way into bad places. A big fat cap across the mosfet makes for a much more gradual decrease of current.

author: Terry Bites
author_rank: Super Contributor
timestamp: October 10, 2024, 02:59:49 pm
content: A clansman huh?

author: BrokenYugo
author_rank: Super Contributor
timestamp: October 10, 2024, 03:42:23 pm
content: Consider a username not affiliated with terrorism.https://en.m.wikipedia.org/wiki/Ku_Klux_Klan

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 10, 2024, 03:46:16 pm
content: Decoupling is more about placing capacitors in the vicinity of sensitive electronic components.In this case some filter between the 12V and the 3.3V LDO for the MCU will help and bigger capacitance after the LDO will also help in reducing problems. The extra capacitance helps when the solenoid is turned on and a voltage drop may occur. The filter will reduce rippling through of spikes when the solenoid is turned off.As suggested by others the freewheeling diode should be incorporated.Feedback through an IO pin might happen in extreme cases where there is enough signal coupling on the connection with the pin. With the ZXMS6006DGQ-13 in between the IO pin and the solenoid, I doubt this will be a problem.The ZXMS6006DGQ-13 already provides switching, rise and fall time delays, to not worry about any fast transients. According to the datasheet 18us rise time and 15us fall time. It is an interesting chip for sure.P.S. Why the negative attitude about his username. Has been addressed before and does not add anything to the thread.Quote from: Terry Bites on October 10, 2024, 02:59:49 pmQuote from: BrokenYugo on October 10, 2024, 03:42:23 pm

author: Darlington
author_rank: Contributor
timestamp: October 10, 2024, 03:48:44 pm
content: Quote from: BrokenYugo on October 10, 2024, 03:42:23 pmI had never thought of this!!! Sorry, I will contact the moderators to change my username!

author: xvr
author_rank: Frequent Contributor
timestamp: October 10, 2024, 03:55:53 pm
content: I've done project that control 8 12V solenoids from MCU. No any problem with solenoids (except that they were a little bit weak, so I have to add voltage booster circuit). Solenoid consumes about 0.8A and was connected via wires of length 10-50 cm.https://github.com/xvrxvr/EventCalendar

author: Zero999
author_rank: Super Contributor
timestamp: October 10, 2024, 08:04:19 pm
content: Quote from: Circlotron on October 10, 2024, 11:24:32 amUnfortunately that would result in a large spike when the MOSFET turns on and short circuits the capacitor. The normal way to do that, is to add a resistor in series with the capacitor to limit the current. RC snubbers are also used in place of a diode, not as well as. In this case 33R in series with the capacitor will be enough to limit the voltage to below the MOSFET's 60V rating, as long as the capacitor is big enough to not charge up too much, from the stored energy in the inductor and 1µF seems reasonable enough.Quote from: BrokenYugo on October 10, 2024, 03:42:23 pmQuote from: Terry Bites on October 10, 2024, 02:59:49 pmPlease bear in mind the original poster's first language is not English and they had no idea what it means. No doubt something we say in English will translate to something bad in another language.Quote from: KKK on October 10, 2024, 03:48:44 pmBy all means change it, if you like, but your username didn't offend me. I knew it was nothing to do with an American terrorist organisation.

author: Circlotron
author_rank: Super Contributor
timestamp: October 11, 2024, 02:26:50 am
content: Quote from: Zero999 on October 10, 2024, 08:04:19 pmA current spike won't be a problem with a reasonable amount of resistance in series with the gate. The slower turn on will take care of that. And 12 volts in 1uF is only 0.144 mJ anyway.

author: Zero999
author_rank: Super Contributor
timestamp: October 11, 2024, 04:32:06 pm
content: Quote from: Circlotron on October 11, 2024, 02:26:50 amNote that the original poster is not using an ordinary MOSFET, but a device with lots of protection built-in. The input current can be up to 400µA, which means the resistor can't be too higher value.Heck, it's rated to clamp up to 490mJ, so will be fine with no suppression, as long as the inductance of the solenoid is below 200mH.https://www.diodes.com/assets/Datasheets/ZXMS6006DGQ.pdf

author: inse
author_rank: Super Contributor
timestamp: October 11, 2024, 08:17:29 pm
content: No native speaker, too but the nickname got me irritated as well

author: Zero999
author_rank: Super Contributor
timestamp: October 11, 2024, 09:16:39 pm
content: It's not so much language but culture. I'm not surprised there are places where few have heard of the KKK.I do find it odd that it's taken over six months, 22 posts and nine threads from the OP before anyone being offended by their username, especially given at least one of those who've complained here have responded to their other threads.

author: Phil1977
author_rank: Frequent Contributor
timestamp: October 13, 2024, 07:12:31 am
content: As a non-native speaker I just don't search for problematic abbreviations, because Germany has its own set of forbidden letters."SS" seems to be no problem for the USB-committee but would be unthinkable for any locals name - at least inside the civilized circles. (It stands for "StaatsSchutz", the former ministry of violence of the Nazi-party)

author: Roehrenonkel
author_rank: Frequent Contributor
timestamp: October 13, 2024, 08:13:02 am
content: Hi Phil1977,you seem mixed-up:https://de.wikipedia.org/wiki/Schutzstaffel

author: Xena E
author_rank: Frequent Contributor
timestamp: October 13, 2024, 08:41:00 am
content: Quote from: KKK on October 10, 2024, 03:48:44 pmWe shouldn't let the adoption of acronyms and pre existing words be owned by hate organisations, as before long everything we say will be taboo somewhere in the world.Please let's not subscribe to the"you can't say that"snowflake subculture making others responsible for our own expectations, thats just being ignorant: I'm sure that the member KKK chose the username innocently.X