Turning on PC speakers whenever there is music playing

If you’re like a lot of people, most of the time your computer speakers are on without actually playing any music. This wastes a bit of power, and [Bogdan] thought he could create a circuit to cut down on that wasted electricity. The result is a very tiny auto-on circuit able fit inside a pair of speakers.

The circuit is built around the ATtiny13, very nearly the smallest microcontroller available with an on-board ADC. When music is played on the computer, the ATtiny senses a bit of voltage in the audio line and switches a relay to power the speaker.

Of course, there is always the problem of music with a high dynamic range; if the sound played from the computer has too low of a volume, the ATtiny might turn the speakers off even if music is playing. [Bogdan] solved this problem by adding a timer to his code; if nothing is detected by the ADC for three minutes, the speakers turn off.

Comments

  1. tulcod says:

    This feature is integrated in many modern audio chipsets, like my Intel HDA laptop chipset.

    • bemis says:

      You’re correct, though the difference here of course is that he is powering off “external” speakers.

      Presumably this is a typical external speaker set which is plugged into a power brick or has some transformer built into it, this circuit is just switching that on/off.

      I didn’t notice if he did any analysis of the power consumed before/after. So do the speakers actually consume much less power on (but silent) vs. off (but still plugged in). How much add’l power does this small circuit consume.

      Switching his external amplifier to something more efficient (like Class-D) might make more sense from power saving point of view.

      • Bogdan says:

        The circuit here is powered from a computer’s usb port. The relay turns on the whole amplifier(including transformer). So when it’s off, the power consumption is zero.
        The circuit itself consumes less then 10mA (Tiny + LED) when monitoring the signal. And it is totally off when the computer is off.

      • Isaac says:

        I’ve got an old set of analog 5.1 computer speakers. When on but no audio you can turn it up and listening carefully you hear the static noise. Anyway, it pulls around 15W with no audio.

      • Isaac says:

        It should be noted a lot of (all?) laptops implement this. My two year old laptop does a reasonable job of capturing fast mouse click buzzes etc then going back to ‘sleep’. I’d be curious to know how they do it (in software?).

      • foo says:

        I’ve thought about building something like thi for a while. My surround sound system draws 40w on standby, 50 on but silent.

        The difficulty for me is the circuit would need to recognise a signal not just on analogue audio lines, but also coax and optical digital lines; I suspect any simple circuit would damage the audio signal.

  2. bemis says:

    Nice idea. As a person who works for a PC audio company–this the same concept as power management for the audio chip itself (power it off when not in use). We of course have the ability to actually know when the OS is attempting to play or record audio, but otherwise it’s about the same.

    Reducing pop’s and missing fractions of a second of the audio from the start-up (particularly very short sounds, like the click of a mouse on a folder) is somewhat of a challenge under the best circumstances, so I would imagine it is here too, but probably not one that matters to Bogdan.

  3. fiveseven says:

    Yey, another fellow Romanian. One question, though: why the uC? Is it really the most practical solution for an envelope detector with long release time/hysteresis?

  4. sagkj says:

    but modern speakers take < 1W while idle so why bother?

    • Bogdan says:

      Maybe modern speakers that use class D amplifiers, or those that are really low power(like 2-3W each)
      Hi-fi amplifiers are class AB/A and will consume a lot more, especially if they are high power.

  5. Toe says:

    The three minute “fix” may work for music fading /out/, but not /in/.

  6. Aaron says:

    Assuming the 20-watt speakers on my desk right now (powered up, thank you), and the average $.10/KWh BGE charges residential customers (this is at the office, so probably it’s running a bit cheaper, but why not make a generous estimate?):

    .02KWh * ~$0.10/KWh = $.002/h * 24 = $0.048/day.

    Rounded up, it’s costing me not more than five cents a day, or $.70 per two-week pay period, to leave my speakers on 24/7. Dunno what Bogdan’s using, but it doesn’t look from the pix like they’re all that much bigger than these old chunky ones I’ve got, so it can’t be eating that much more unless he’s powering them from an incredibly inefficient wall-wart supply. (You know, like I’m doing!)

    Neat hack, tho.

    Also, before twenty people babble at me about how fun can’t be valued in dollars and cents, &c., &c. ad naus. — no argument. But “burning a lot of power” seems like it might be significantly overstating the case. (I’m also curious how the parts cost amortizes over the cost of the power this hack will undoubtedly save. Again, yeah, I know, how awful of me to think about mere money in a context like this one. Still curious, tho.)

    • Bogdan says:

      I did the math before building it. I was curious too.
      The amp burns 15W doing nothing. For 10 hours of power wasted per day this is about $6 per year. It costed me about $3 in parts to build the circuit.

      • Aaron says:

        Fair enough. In my case, leaving the speakers on costs not more than $18.20 a year — which, coincidentally, is about a dollar less than my gross pay per hour.

        $3 in parts? You must buy in bulk.

      • kendall14 says:

        This should also extend the life fo the speakers as leaving them on 24/7 is no doubt putting unneeded stress on the components.

      • Aaron says:

        Dunno, kendall14. The ones I’m talking about haven’t been powered off, except during outages, for well over half a decade; they were at least six or eight years old before I started using them, and they’re still going strong. It may be that the built-in amplifier shuts off when it’s not getting a signal…

        (I’d also note that, while again it’s a neat hack, it wouldn’t actually help with the speakers I use, since thye’re powered by a wall wart — whether the amp is powered or not, the wall wart’s still sucking power as long as it’s plugged into the wall. That doesn’t appear to be the case for Bogdan’s speakers, judging by what appears to be a transformer next to the protoboards in his picture, but it’s worth noting all the same.)

      • Bogdan says:

        I do buy parts in larger quantities, but not extreme ones. Tiny13 drops to about $1 per piece if i buy at least 5.
        SMDs drop to about $1 per 100 0805 resistors, a little more for caps.
        5×7 cm boards are $4 per 10 pcs on ebay.

      • tgtomm says:

        @Kendal114 – Not entirely true, it is switching on and off that causes most wear on electronic components due to heating and cooling causing thermal stress. There have been quite a few studies into this effect including some done by google about the hard drives in their huge data centres

  7. Joe Citizen says:

    Only problem I see here is when you think you’ve got the sound turned off while watching porn so wife doesn’t hear and then all of a sudden….

  8. kalleguld says:

    I had a set of external speakers with this built in. Problem was that they took about a second to turn on, so all the small windows sounds (getting an IM, etc.) wouldn’t play.
    And my current sound system takes even longer to turn on.
    But maybe I could adapt something like this to switch between a low power speaker for “windows” sounds and my primary system.

    • Bogdan says:

      I actually used a 3s timer specially to avoid turn on because of the sounds. On my computers they are usually turned off, but some “escape”.
      A good idea is to use a small amplifier, powered directly off the USB and switch between this one and the power one when there is music/movies.

  9. omg says:

    @Aaron
    While working an hour of your life each year for nothing may not bother you and the cost savings seem minimal, think large scale and multiply the wasted power by millions. And the effects of generating this power, too..

  10. lwatcdr says:

    This could also be used to automatically switch between sources sources.
    Say you feed all the in’s to the A2D and then once you detect a level you do a scan on all the inputs until you find the one is on and switch it to the speakers and turn them on. To save power you could use a schmidt trigger to wake the chip from sleep as well.

  11. Joe says:

    May I humbly suggest the 3 minutes is extended to 4 minutes 33 seconds. Three minutes is insufficient to render John Cage’s masterpiece correctly. ‘Playing’ 4’33” with the speaker switched off would be like performing the piece without an orchestra. That this is unsatisfactory needs no explanation.

  12. vic says:

    My speakers have such feature built-in and I’m constantly fighting with them to turn on, especially when the sound is very low. But it’s definitely better than leaving them on constantly. When you add all the devices in a house that never really turn off you add up to a lot of wasted energy.

  13. John U says:

    A finger of fudge for the first person to do this with an op-amp and a handfull of passives. Tiny or not, this didn’t need a micro.

  14. Phil says:

    As others have noted already this seems like a bit overkill for the amount of power it saves.

    I did note in the replies that it was mentioned that these speakers are USB powered. That means the savings are almost in the noise level. Your computer’s power supply uses pretty much the same amount of power when an additional load (the speakers) are turned on. It is not a linear relationship.

    What does make sense is powering your speakers via USB, or some other tap off of the computer’s power supply and eliminating an external brick. Bricks are far less efficient than power supplies, they’re (generally) powered 24/7, and always consume a little power when they’re plugged in.

    I added a 12V power jack to my computer’s case (just tapped it off of a spare power connector) and wired a simple cable from that jack to my speakers. While the speakers receive power whenever the computer is turned on, it’s still far less power than the original brick which came with the speakers.

    • bogdan says:

      Read again. Speakers are NOT usb powered. They have a 2x22w amplifier. However the control circuit is powered from usb since the speakers are used for the pc.

      • Phil says:

        So how are the speakers powered? A wall-wart or a power supply with an on-off switch?

        If you actually switch the AC power source completely off (no ‘vampire power’) then this circuit makes sense. But if the transformer’s still connected to an AC outlet then it’ll continue to draw power 24/7 whether or not there’s any sound – and whether or not the computer’s even on.

        I’ve replaced wall-warts which power accessories for my computer with jumpers which connect to my computer’s 12 volt power supply. That way the accessories only draw power when the computer’s on.

      • bogdan says:

        Indeed, i did not provide enough info. The speakers themselves are passive, driven by an amplifier, which is in a separate box, also containing the required transformer. The circuit was mounted inside the box and it switches the mains, meaning that there is absolutelly zero power consumed by the amp when off.

  15. Interesting project.

    My desktop speakers have an internal transformer and the power switch is after the transformer, ie not on the mains side, so I imagine they’re still drawing power when off.

    I’ve thought about wiring in a switch on the mains side but I can’t find any specs for the speakers.

  16. John Cage says:

    I think that turning off after only 3 minute is a bad idea. That means it will cut out 3/4 of the way though 4’33”!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,048 other followers