Notifications
Clear all

AC power meter for HiFi audio system

19 Posts
5 Users
6 Likes
1,505 Views
(@lobster)
Member
Joined: 4 years ago
Posts: 6
Topic starter  
Posted by: @mike650

@will  Those AC voltage and AC current sensors appear to be meant for power line frequencies,  (50 or 60 Hz)  It's  unlikely that they will be accurate for a wide frequency range such as audio (20 to 20 kHz).

 A speaker's impedance (AC resistance) will vary over frequency.  With a good speaker, say a 3 way system you should have a fairly constant impedance over frequency but it won't be perfect.  Especially if there's a resonance- the impedance will rise at the resonant frequency.

The RMS voltage squared divided by the speaker's estimated impedance will be the estimated power. Anything better would be hard to measure accurately because the impedance is not perfectly constant over frequency. 

YEP! This is it!  That >The RMS voltage squared divided by the speaker's estimated impedance will be the estimated power< would be good enough.
Now all I need to know is how to measure the RMS voltage with an arduino.

 

@all, thank you very much guys !!!


   
Ron reacted
ReplyQuote
(@mike650)
Member
Joined: 3 years ago
Posts: 10
 

@lobster Here's a possible RMS circuit,

https://circuitdigest.com/tutorial/true-rms-to-dc-converter-using-ad736-ic

The DC output would connect to an Arduino analog input.

 But keep In mind it won't be isolated from your audio circuit. In other words you're Arduino will have a direct connection to your audio amplifier. That may or may not work for you.


   
Ron reacted
ReplyQuote
(@mike650)
Member
Joined: 3 years ago
Posts: 10
 

@lobster The next question is: do you want to measure music power?  If so,  then you will need some form of averaging.  The next question is how to display the measured value. Bar graph displays or analog meters are commonly used for this purpose. These can be driven by the  Arduino using a PWM output.  The Arduino would take the rectified DC, calculate the power,  average it, and then send it to the  PWM output to an analog display. 


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1684
 

Hi @lobster,

  As you have probably already realised, there are a number of "gotcha's" waiting for you, and I advise you proceed cautiously, as a mistake could result in the demise of your HiFi amp.

Note these are only suggestions to look into ... I accept no responsibility for any actions you decide to take!

This is only a few things .. there are others! :

  1. Regarding the pair of 'speaker' wires from each channel. 
    • In some cases, one wire will be the '0V' line (with respect to the amp's power supply) and the other will be driven positively and negatively by the amplifier. The '0V' line maybe connected to the mains earth. (I would not trust any colour coding or markings on the amplifier to determine which wire is which!)
    • Alternatively, both wires may be 'actively' driven, in opposite directions. Thus to move the speaker cone forward, wire A may be driven positively, whilst wire B is driven negatively - and vice versa to move the cone backwards.
    • (Unless you examine the circuit, you cannot be sure either output wire is actually at the same '0V' level as you expect.)
    • An analogue to digital converter commonly has a single input pin (per channel), the other pin being the '0V' line, which may be connected to mains earth.
    • Clearly, connecting an 'earth pin' from the A-D converter to an actively driven HiFi amp speaker output pin is inviting expensive problems!
    • A possible approach to consider is putting a 'instrumentation amplifier' at the front of your A/D converter. If you haven't come across this term before, start with https://en.wikipedia.org/wiki/Instrumentation_amplifier for a general description. Essentially, the two input wires present a high impedance, which means a relatively large resistor can be inserted in series. Then, you can be reasonably sure, any current flows to your HiFi amp are limited to a very small value and unlikely to worry it. Furthermore, as the two input wires are both 'sensitive', it should be fine with either of the two configurations I described above.
  2. Audio signals are notoriously difficult to accurately measure:
    • They cover a wide frequency range .. e.g 20 Hz to 20 kHz, with complex waveforms. Single 'clean' sine waves are rare exceptions!
    • They have a very wide dynamic range. If you have a 'volume' control calibrated 0 to 10, which has been designed so that each step of 1 appears to be an equal increase in volume, then in terms of electrical and audio power, then each step is doubling of power.
      • Hence if 0 to 1 implies 0 to 10mW, to 2 is 20mW, 3 is 40mW, 10 is 5W
      • (This assumes the amplifier and speakers, as well as your ears, can handle all 10 steps without driving into an overload situation.)
    • Hence, if you want to measure over a range of conditions, either your A/D converter needs a high resolution or (more commonly) you arrange two or more 'scales' and use the processor to choose the most approprate scale.
  3. If you are using a processor, then you may not need a 'specialised' RMS chip ... processors can do the awkward squaring operation, but make sure the processor you pick is 'fast enough'. In principle you need to sample at least twice the highest frequency ... 20 kHz would imply 40 kHz sampling, but in reality your errors will  probably be small if you regard most of the audio material is some way below 20 kHz. I haven't checked, but I would guess something like an ESP32 would be a better bet than some of the common Arduinos. Other processors are also available .... 
  4. Sampling signals with a high frequency content can result in 'weird' measurement effects .. check out Nyquist theorem if you are not familiar. In simple terms, consider building a low pass filter into 'front end' before it is sampled by the A/D ... it might only be a resistor/capacitor ... NB I frequently see people suggesting/using software, usually an averaging algorithm, to try to remove  the aliasing effects caused by inadequate filtering of the signal sent to the A/D ... it doesn't work!! Unless a well established theorem is false, it is impossible to untangle the mess!
  5. Many recent amplifier designs use PWM (pulse width modulation), as it is much more efficient. I suspect some HiFi amps will avoid it, but probably not all. If so, your signal may have 'spikes' at a frequency well above 20 kHz. these definitely need to filtered before reaching your A/D. The cure is basically the same as the previous point ... but failing to do sufficient filtering is even more likely to give crazy results!

Good luck with your project, and please take care!

Dave


   
habanero-gh and Ron reacted
ReplyQuote
Page 2 / 2