2
\$\begingroup\$

Most 12v relays I've come across require 4v to switch on. I don't have a voltmeter handy to test my computer motherboards voltage output, and if it did give out +4v and held a long enough duration would it even be possible?

Using C# or any programming language I can send a frequency and duration signal through the motherboard speaker pins so I'd like to use this as a cheap mod to control an actuator.

:)

\$\endgroup\$
1
  • 3
    \$\begingroup\$ This is actually the least terrible newb idea I've heard here. I'd never considered what the PC speaker might be used for electronics wise. Heck I'd forgotten it existed! \$\endgroup\$
    – AngryEE
    Commented Sep 21, 2011 at 21:04

4 Answers 4

6
\$\begingroup\$

A motherboard buzzer takes a lot less current to operate than a relay winding. So it could work for a bit, but it might burn out the driver. In other words, it's the current drive that matters.

You're much better off using the speaker output to drive a transistor (BJT or MOSFET) that switches the relay. Transistors require very little input current to operate. They can also level shift, i.e. drive a large output voltage swing with a smaller input voltage.

Remember the reverse-biased diode across the relay winding, which clamps the voltage when you turn off the relay. Otherwise, the relay winding voltage will head for -4 V or -12 V (the negative of whatever voltage was on it when it was on) and not stop until some part of your chip looks like a forward-biased diode. It's an inductor, which can change voltage instantly but not current.

\$\endgroup\$
3
\$\begingroup\$

As others have said, you will need something between your 4V speaker output and the 12V relay. Not only will the speaker drive most likely not be capable of enough current, it's also not enough voltage.

Another problem is that you can't rely on whether the speaker output is normally high or normally low. It's quite possible this is a small speaker tied between the 5V supply and a low side switch. In addition it is pulsed, but you want to keep the relay on the whole time during a tone (as I understand it).

Here is a circuit that should reliably deal with all these issues. These are all common, cheap, and off the shelf parts. The diode can be any small signal switching type, like the common 1N4148 shown, but many others will do. All three could be Schottky diodes too.

The input is capacitively coupled, so its DC level doesn't matter and it can idle high or low. C1, D1, D2, and C2 form a charge pump that makes a voltage on the left side of R1 when the inupt is actively wiggled. That voltage causes a current thru R1, which turns on the transistor. There is enough charge storage in C2 to keep the transistor on for a little while. As long as the input is pulsed fast enough, the transistor will stay on. The transistor is then a low side switch turning on the relay between it and the 12V supply in your computer. D3 may look like it doesn't do anything, but it's important and leaving it out will eventually fry Q1 and the circuit will no longer work. The relay coil has considerable inductance, so current thru it can't be interrupted instantaneously. D3 provides a safe place for this current to go until it ramps down on its own. Without it, the inductor will create whatever voltage it needs to keep the current going, which will damage Q1.

This circuit should be good enough to drive small 12V relays that require around 50 mA to drive. I showed 5 kHz example tone frequency. Higher is better, since it allows the charge pump to deliver more current into the base of Q1. If you can tell the PC to make 10 kHz out, do that.

\$\endgroup\$
1
\$\begingroup\$

4V is extremely low for a 12V relay, are you sure about that? A more typical "Must Operate" voltage would be 8V to 9V.
Anyway, a PC's buzzer or speaker takes only a few mW, much less than the required power to operate a relay, which will be a few hundred mW. Like Mike suggested you can use a transistor or MOSFET to control the relay. You'll have to rectify (diode) and smooth (capacitor) the signal. This could work, but still is an odd way to control a relay.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ The 4V may well be the "hold" voltage - the voltage needed to hold the contacts in the on position once the switching has happened - typically considerably less than the voltage required to move the contacts in the first place. \$\endgroup\$
    – Majenko
    Commented Sep 21, 2011 at 14:44
  • \$\begingroup\$ @Majenko - True, holding voltage is much lower than "must operate" voltage, though the value is almost never specified (usually just "must operate" and "must release" are spec'd). But OP claims the 4V is the operate voltage ("[...] require 4v to switch on"), which I find hard to believe. \$\endgroup\$
    – stevenvh
    Commented Sep 21, 2011 at 15:03
  • \$\begingroup\$ me too... Unless he's confused with the voltages - a 12V relay could mean a contact rating of 12VDC but operating with a coil voltage of 5V. \$\endgroup\$
    – Majenko
    Commented Sep 21, 2011 at 15:08
0
\$\begingroup\$

Not only does a computer's buzzer require a very small current (typically 50mA at 5V), so won't be able to directly drive the relay, but it is also not a straight DC current.

The speaker will be being driven with a square-wave signal at a 50% duty cycle. The frequency of the square wave determines the frequency of the sound coming out of the speaker.

It would, however, be possible to arrange some form of timed latch system - called a monostable so that as the first pulse of the square wave arrives the latch turns on for a predetermined time. Each successive pulse of the square wave would reset the monostable, so it stays on as long as the speaker is active plus the length of time the monostable is set for. As long as the period of the monostable is greater than the time between the peaks of the square wave (\$\frac{1}{f}\$) then you should get a nice clean on/off signal in relation to the speaker's sound on/off.

The output of the monostable, depending on how it is designed, may first need to be passed through a transistor in order to drive the relay.

A simple system for making a monostable is the time-proven 555 timer. Setting it up as a monostable is simple:

enter image description here

The selection of \$R_1\$ and \$C_1\$ are what determine the period of the monostable output.

\$\endgroup\$

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