2
\$\begingroup\$

Context: The circuit's main input is a line-level audio signal from a computer. Every time that something loud happens in the audio, I need the solenoid to activate for about 100 ms.

The first circuit is below. I derived much of it from this answer. The voltage source is 12V. I biased the MOSFET so that when the audio line went above a certain voltage (adjustable with the potentiometer), the MOSFET would turn on. Unfortunately, it hardly stayed on long enough to make the solenoid move. (The circle and 400 in parallel with the inductor and diode is an LED.)

Circuit with biased MOSFET

Next, I tried using an op-amp instead for voltage detection and a combination of a diode, a capacitor, and a resistor to keep the MOSFET on longer. When the audio line voltage goes above a certain voltage, the op-amp charges the capacitor, and the MOSFET turns on until the capacitor discharges. I plan to connect the op-amp's positive rail to 12V and the negative rail to ground.

Circuit with op-amp for voltage comparison

This worked well, except for a few concerns:

  1. In the simulation, the inductor's current seems to climb higher and higher every time that the MOSFET is turned on, and it never goes back down. I fixed this by adding a 100 ohm resistor (not shown) in series with the inductor. Is that safe, and are there any potential pitfalls to that approach?
  2. I thought of using a 555 chip to control the MOSFET, with the op-amp output wired to the trigger. However, according to this page, the 555's trigger is active low. Could I simply flip the + and - on the op-amp to make the output off when the audio line voltage rises above the certain value? Is there an advantage to using a 555 instead of the diode, capacitor, and resistor?
  3. How can I tell whether an op-amp will accept 0 V as the negative rail?
  4. Have I committed any electrical no-no's?

This is what the circuit would look like with a 555:

Circuit with the 555 chip controlling the MOSFET

EDIT: Thanks to Andy aka's answer below, I was able to create the next circuit. Q1 is acting like a NOT gate, and it controls Q2. Peaks in the audio input now cause C3 to be charged up, which holds the voltage high for Q3, which is still a MOSFET. The sensitivity is adjustable via R1, and I suppose that the duration of the solenoid activation could be adjustable if R7 were a pot.

Transistor acting as a NOT gate

\$\endgroup\$
  • \$\begingroup\$ Depending on the timing accuracy required, you may do this with a single transistor, diode, capacitor and resistors. No ic needed at all. \$\endgroup\$ – soosai steven Jul 10 '16 at 1:35
  • \$\begingroup\$ @soosaisteven Sorry, but how might that work? I'm afraid of drawing too much current from my sound card. \$\endgroup\$ – wecsam Jul 10 '16 at 1:59
  • 3
    \$\begingroup\$ "Is the 555 necessary here" A 555 timer is never necessary anywhere. \$\endgroup\$ – Olin Lathrop Jul 10 '16 at 11:23
  • \$\begingroup\$ How might it work? Andy Akka has provided the answer below. Input impedance of common bipolar transistor is hundreds of kilo-ohms. Loading effect to the sound card will be negligible. \$\endgroup\$ – soosai steven Jul 10 '16 at 13:47
0
\$\begingroup\$

Here's a link to another answer that should prove useful. Here's the diagram: -

enter image description here

Q1 and Q2 transistors "detect" audio and force a DC level onto C2. C2 holds that voltage and slowly (relative word) discharges via R2. Q3 is just a buffer to drive an LED.

Also, take note that a DC powered solenoid is usually designed to have significant resistance so that it can be powered by a DC voltage without infinite current flowing.

\$\endgroup\$
  • \$\begingroup\$ I would not say that solenoids are designed to have resistance, it is a consequence of their construction. A zero resistance coil would be very useful in some applications. \$\endgroup\$ – RoyC Jul 10 '16 at 9:18
  • 1
    \$\begingroup\$ @oceanp read what I said and I quote "a DC powered solenoid is usually designed to have significant resistance". If it had no dc resistance then it couldn't be powered from DC - it becomes an AC solenoid. \$\endgroup\$ – Andy aka Jul 10 '16 at 17:45
  • \$\begingroup\$ The effect of a solenoid is proportional to number of turns and the current through it. If we had a dc solenoid with lots of turns and little or no resistance we could drive it from a very low dc voltage and get little power loss in the coil. We would be limited only by the rate of current rise proportional to the inductance of the coil. Unfortunately we can afford neither the m^2 cross section of the windings or the superconducting technology to make this happen. DC resistance in a coil happens is a bad thing as it equates to power loss and is a consequence of design tradeoffs. \$\endgroup\$ – RoyC Jul 10 '16 at 18:12
  • 1
    \$\begingroup\$ @oceanp Tell that to all the engineers wanting 12V dc or 24 V dc solenoids. I would also point out that having series resistance is useful for turning off the solenoid more quickly as it dissipates stored energy more quickly and quenches the magnetic field more quickly. If you wish to go on a theoretical tirade about this I'm not the right person to listen to any rantings. \$\endgroup\$ – Andy aka Jul 10 '16 at 18:16
  • \$\begingroup\$ No those engineers want 3.3V or 5V solenoids they cant have them because of practical considerations. I am not the one arguing from a theoretical pov. \$\endgroup\$ – RoyC Jul 10 '16 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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