3
\$\begingroup\$

I have a latching solenoid that operates on 2vdc (at the lowest) all the way up to (as I have tested) 9vdc - the minimum amount of current I have tested it with is 0.01A (which is the lowest my benchtop power supply with provide).

EDIT: The side of the solenoid reads DC3v 25ms 0.02-0.8MPa.

To operate the solenoid it has two leads, apply voltage across the leads in one direction to actuate it in one direction and then apply voltage across the leads in the opposite direction to actuate it the other way.

I want to control this solenoid via a nodemcu ESP8266 and I have confirmed that the 3.3v pin to ground will actuate the solenoid, but I cannot for the life of me figure out how to get this operating without using relays.

I feel like at 0.01A 2vdc minimums that I should be able to set a pair of digital pins as outputs and trigger one of them high and the other low to make the circuit flow, but this does not appear to make the solenoid trigger. I have tried all kinds of different configurations of transistors to make this work and I still come up empty handed. Short of making my own H-bridge (which I tried, but I am unable to sort out correct combinations of resistors/diodes/transistors to make it work since I am still learning) do you guys have any suggestions for how I could accomplish this in the simplest way?

NOTE: I know I can do this off of a pair of relays easily, which I have done and tested - but this is an exercise to see how to get this working without them using, for instance, transistor logic for fun.

I know I can buy an off the shelf H-bridge motor controller board and make this work, but that isn't really the exercise I have given myself here.

I have been banging my head against a wall for the last few days trying to sort out how to do this and have come up empty handed, so that's why I am here haha

\$\endgroup\$
6
  • 7
    \$\begingroup\$ Why don't you want to take the time to learn how to make/use an H-bridge? This sounds like the right approach and you will probably end up there if you start designing from scratch. Otherwise, show us the "configurations of transistors" you have already tried and explain why you rejected them...no sense in giving you answers that you will immediately discard. \$\endgroup\$ Commented Aug 22, 2022 at 18:10
  • 4
    \$\begingroup\$ What is the rated voltage of the solenoid (ie. what should it operate on, by design)? \$\endgroup\$ Commented Aug 22, 2022 at 18:13
  • \$\begingroup\$ @ElliotAlderson I wish I could show the configurations I have tried but I have literally tinkered so much on this that I cannot possibly remember all of what I have tried haha. I would love to learn how to properly build an H-bridge but all of my googling brings up how to build it for a motor and is pretty hard to follow. \$\endgroup\$ Commented Aug 22, 2022 at 18:15
  • 1
    \$\begingroup\$ @SpehroPefhany the side of the solenoid reads DC3v 25ms 0.02-0.8MPa - I'll update the question to reflect that \$\endgroup\$ Commented Aug 22, 2022 at 18:16
  • \$\begingroup\$ Did you measure the coil resistance? These solenoids typically need a lot more current for a short time. Expect 0.5 - 1A here for 25 ms. So you need a H-bridge anyway. If it really needs 10 mA only, it should act using 15V and 1 kohm in series with the coil. I would be surprised. \$\endgroup\$
    – Jens
    Commented Aug 22, 2022 at 19:17

3 Answers 3

5
\$\begingroup\$

Here is a simple building block that could provide part of what you need. I'll leave it to you to figure out how to complete the circuit to drive your solenoid. (This is my first time using the schematic editor - I usually use LTSpice).

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
3
  • 1
    \$\begingroup\$ hmmm, is this intended to be one half of the circuit? I'm unsure which of the three connection points in this diagram is meant to go to what \$\endgroup\$ Commented Aug 22, 2022 at 20:09
  • \$\begingroup\$ I could just tell you, but it's very simple and the node labels should tell you how to hook it up. Try simulating it or building it and let us know where you have problems. \$\endgroup\$
    – PStechPaul
    Commented Aug 22, 2022 at 20:50
  • \$\begingroup\$ the step source on the left represents the NodeMCU, by the way \$\endgroup\$ Commented Aug 22, 2022 at 22:20
4
\$\begingroup\$

You can use a push-pull emitter follower H bridge. Almost any NPN and PNP transistor will do, they don't even have to be complementary types. K1 is the relay coil. C1 conducts when either side of the bridge is turned off - it is a snubber, together with K1's internal resistance. A resistor may need to be added in series with C1, since K1's resistance may be on the low side in a 3.3V coil.

schematic

simulate this circuit – Schematic created using CircuitLab

When GPIO1 and GPIO2 are at the same level, K1 sees same potential across and the currents across it will decay away. When GPIO1 and GPIO2 are at different levels, current is driven across K1 from supply to ground, in a direction determined by which GPIO is high.

There are always two diode drops (2xVbe) in series with K1 in the circuit above. If you'd want to avoid that, then two push-pull common emitter stages in an H-bridge arrangement will work:

schematic

simulate this circuit

Q5-Q8 switch the GPIO voltages to bases of Q1-Q4. The latter are common-emitter amplifiers. The voltage across K1 is the rail voltage minus 2 x saturation voltage of Q1-Q4/Q2-Q3.

The above circuit can also work from a single 3-state GPIO port: to turn K1 off, GPIO has be configured as an input:

schematic

simulate this circuit

\$\endgroup\$
6
  • \$\begingroup\$ THIS seems like it might be the solution for me - I will try this tonight and report back...thank you! \$\endgroup\$ Commented Aug 22, 2022 at 21:05
  • \$\begingroup\$ I see you put NPN on top, making this an emitter follower in both directions and preventing shoot-through concerns. Convenient, though it means you can barely get 2 volts across the coil. I don't really understand the second circuit. \$\endgroup\$ Commented Aug 22, 2022 at 22:21
  • 2
    \$\begingroup\$ @user253751 The bases of Q5-Q8 are fixed at 1/2 the supply. Now zoom in on one amplifier pair, say, Q4-Q5 for example. When GPIO2 pulls low, Q5 turns on, which turns Q4 on too. Else, they both turn off. Similar for the low-side pair. The modification at the end is to connect the second input to the opposite output instead. Because the amplifier on each side is inverting, this works as if both GPIO's were always complimentary. Setting it Hi-Z (input) doesn't pull either direction, so it floats to somewhere around the base voltage with everything off. Then likewise on the other side. \$\endgroup\$
    – AaronD
    Commented Aug 23, 2022 at 4:47
  • 1
    \$\begingroup\$ Q5-Q6 and Q7-Q8 are classic building blocks that interface logic signals with current-driven stages. They act as current switches. Very useful to have in the toolbox. \$\endgroup\$ Commented Aug 23, 2022 at 18:45
  • \$\begingroup\$ I upvoted this because it offers a way to achieve rail-to-rail outputs, as well as a way to control the output from a single pin. However, it adds a level of complexity that may not be necessary. Certainly a circuit that is good to know about. \$\endgroup\$
    – PStechPaul
    Commented Aug 24, 2022 at 6:22
3
\$\begingroup\$

If you feel like living a little bit dangerously you can try a 74LVTH125

schematic

simulate this circuit – Schematic created using CircuitLab

This should give you typically around 3V across the coil @10mA so it should drive the coil properly.

If you want belt and suspenders, attach 4x 1N5819, one from each side of the relay coil to GND and one to 3.3V, reverse biased of course.

\$\endgroup\$
5
  • \$\begingroup\$ While I appreciate this, I am trying to do this entirely with discrete off-the-shelf components and no relays - I already have a two relay solution that works more than fine as it is, but the challenge I'm trying to figure out is how to do it without relays. No sense in purchasing a 74LVTH125 when I can do it with a couple cheap relays on my bench already, you know? \$\endgroup\$ Commented Aug 22, 2022 at 19:37
  • 4
    \$\begingroup\$ RLY1 is a placeholder for you solenoid. \$\endgroup\$
    – Mattman944
    Commented Aug 22, 2022 at 20:10
  • 2
    \$\begingroup\$ What Mattman said. You can't get much simpler than a single off-the-shelf logic chip. \$\endgroup\$ Commented Aug 22, 2022 at 20:12
  • \$\begingroup\$ @SpehroPefhany OHH gotcha - sorry I should have realized that on my first look haha - in that case that would definitely be the /simplest/ solution for sure \$\endgroup\$ Commented Aug 22, 2022 at 21:02
  • \$\begingroup\$ If you'd like a little (actually a lot) more output current, maybe look at some dual MOSFET drivers, like mouser.com/datasheet/2/268/MCHPS05668_1-2520584.pdf \$\endgroup\$
    – PStechPaul
    Commented Aug 22, 2022 at 23:55

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.