I'm looking for a solution to drive the coil of a relay (G7L-2A-X DC24). It requires 24 V, which can be reduced to 50% holding voltage after 100 ms.

My initial thought was to build a generic buck converter circuit with 24 Vin and to drive the MOSFET using a µC programmed to drop the duty cycle from 100% after 200 ms. No feedback since the load is fixed, just finding the duty cycle through trial and error using a multimeter.

I'm wondering if I can simplify this circuit. Is the diode necessary and could I leave out the inductor, as the relay coil itself will have a certain inductance?

I'm also unsure about the values to use for the capacitor (and the inductor, potentially) and about the switching frequency (probably on the higher end? to reduce component size and since switching losses aren't really a concern in a MOSFET this small).

Lastly, just driving the coil with a 50% PWM signal isn't really an option, as I think that would cause too much EMI for the hall effect current sensor next to it. Its datasheet does state that it uses differential probing to minimize interference and my theory is that I can calibrate for any remaining error if the field is constant.

  • 1
    \$\begingroup\$ Constant current (transistor based, or a LDO regulator in series connection) would be low EMI, if you don't mind dumping a significant amount of heat. Something like DRV103/104 is an easy to use PWM driver that also gives an initial boost for the solenoid to engage. There are fancier driver chips along those lines with current sense. For EMI... what is the hall effect sensor doing? Does it operate at a particular frequency? \$\endgroup\$
    – Pete W
    Sep 11, 2021 at 0:30
  • \$\begingroup\$ The obvious solution is to use a 12V part. But the 24V version might be more common and cheaper. The boost converter would be the modern solution or in days gone by you might use a charge pump with a capacitor. The capacitor required might work out much larger than the boost conv solution. As a side note - having a hall sensor close to a relay is an issue. One design i did would sense if the relay was on or off. This was not the intention. Also be aware of the sensor noise floor. \$\endgroup\$
    – Kartman
    Sep 11, 2021 at 1:48
  • \$\begingroup\$ @PeteW The current sensor is an MLX91221. It measures the DC current going through the relay. It's connected to an ADC which samples the output voltage at ~4 MHz and averages every 16384 consecutive samples. \$\endgroup\$
    – Cedric
    Sep 11, 2021 at 7:40
  • \$\begingroup\$ @Kartman I chose the 24 V relay because of its lower power consumption (at holding voltage: 1/4 of the 12 V version, and thus lower EMI). Also, it's still powered by a 24 V rail (it powers other things than just the relay) so I'd need to step it down anyway. As for the current sensor: the relay coil will be permanently energized, I don't mind it affecting the measurements as long as I can calibrate for it. I could mount the sensor on the bottom of the PCB if that helps. \$\endgroup\$
    – Cedric
    Sep 11, 2021 at 7:55
  • \$\begingroup\$ If power consumption matters (I had assumed not because 24V, relatively big relay), the DC/DC / buck / etc is the way to go for that. Seems like with your end application sampling at approx 250Hz (=4Mhz / 16K sample blocks) there's room to run the converter at 25kHz ish and clean up the edges with filtering. Another idea for efficiency is use the buck regulator to control current rather than voltage. Re: external diode - if you don't, it goes into the diode inside the DC/DC... might want external anyway for general transient protection \$\endgroup\$
    – Pete W
    Sep 11, 2021 at 12:52

1 Answer 1


You could set you buck converter to 12V but puth a capacitor between the feedback pin and ground so that it starts passing full power. you'll probably need a resistor in series with the capacitor to prevent voltage oscillations.


simulate this circuit – Schematic created using CircuitLab

but it's probably simpler to to use a series resistor with a bypass capacitor.


simulate this circuit

  • \$\begingroup\$ The capacitor in the first circuit to start at full power is a nice idea, but I'm not sure how this could provide an advantage in my application. I need a µC to control the relay anyway so I think I might as well use it to drive the buck converter as I proposed in the question. \$\endgroup\$
    – Cedric
    Sep 11, 2021 at 8:24
  • \$\begingroup\$ I simulated the 2nd circuit in LTSpice. Using a 24 V, 100 kHz square wave as the voltage source. For the coil, I used a 10 µH inductor (I've noticed changing the inductance doesn't affect the result) with 250 Ω resistance, but the coil voltage looks exactly like the input. Except when I use a much lower capacitor value, then some ugly spikes start appearing which can't be good for EMI. \$\endgroup\$
    – Cedric
    Sep 11, 2021 at 8:27
  • 1
    \$\begingroup\$ @Cecemel maybe a missing freewheeling diode? Concerning Jason's first circuit: if you want to control the relay with a microcontroller, you could use the same GPIO to control the feedback pin (open-drain pin -> pull FB low when switching, set GPIO to high impedance after 200ms). \$\endgroup\$
    – Sim Son
    Sep 11, 2021 at 11:28
  • \$\begingroup\$ @Cecemel why 100Khz? the circuit is for a DC supply. \$\endgroup\$ Sep 12, 2021 at 4:00
  • 1
    \$\begingroup\$ 100kHz is too fast for a relay thaat takes 30mS to operate. \$\endgroup\$ Sep 12, 2021 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.