2

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

wecsam
  • 125
  • 5
  • Depending on the timing accuracy required, you may do this with a single transistor, diode, capacitor and resistors. No ic needed at all. – soosai steven Jul 10 '16 at 01:35
  • @soosaisteven Sorry, but how might that work? I'm afraid of drawing too much current from my sound card. – wecsam Jul 10 '16 at 01:59
  • 3
    *"Is the 555 necessary here"* A 555 timer is never necessary anywhere. – Olin Lathrop Jul 10 '16 at 11:23
  • 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. – soosai steven Jul 10 '16 at 13:47

1 Answers1

0

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.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • 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. – RoyC Jul 10 '16 at 09:18
  • 1
    @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. – Andy aka Jul 10 '16 at 17:45
  • 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. – RoyC Jul 10 '16 at 18:12
  • 1
    @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. – Andy aka Jul 10 '16 at 18:16
  • 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. – RoyC Jul 10 '16 at 18:28
  • @Andyaka The circuit seems to turn the LED on whenever there's any audio instead of just when the audio is loud. However, I was able to get some ideas from your answer, so I came up with another circuit. I'll edit my question to include it. – wecsam Jul 11 '16 at 06:36
  • @wecsam you adjust R3 to desensitize the circuit as per the text in the link to the original answer. If you wish to desensitize more add a resistor from base to emitter of Q1. – Andy aka Jul 11 '16 at 08:29
  • @Andyaka Ah, okay, that did it. Thanks. I changed R3 to a 1M resistor and R2 to a 3M resistor to get the effect that I needed. – wecsam Jul 12 '16 at 03:14