This article details a practical project using Arduino technology that provides instantaneous power output readings, converting measured Volts to Watts with a specific load resistance as the output of the amplifier is changing.
I have always had an interest in electronics, especially related to audio. For most of my life, lack of funding has driven my creativity. With three children involved in sports, activities, and heading to college soon, I find myself underfunded yet again. The following project was spurred by desire and lack of money!
Testing power amplifier output is a given when building your
own amp or repairing one. Converting Volts (V) to Watts (W) with your specified
load resistance (R) using the formula is easy enough, but it’s not
an instantaneous reading. As you calculate, the output of the amplifier is
changing. I wanted instantaneous readings, so I started looking at options.
There are older distortion analyzers that can switch modes and provide a W
reading, but then you lose your distortion reading. There are analog meters on
some equipment that are scaled for W and then there are a few mid to high-end
true RMS benchtop meters that have a mode to measure W. A quick note about
benchtop meters and their modes. Most have a way to measure decibel-milliwatts
(dBm) for a given value (normally 500 or 6000). This is not for W at 20, 40, or
80. Very few meters have the software to perform
while also allowing a user
to select the R.
So where does this leave me? I am not able to replace my current RMS benchtop meter with a different model. I don't want to pick up another distortion meter just to read W. What about building a unit that can measure V, then perform some math to convert it to W and finally display it on a screen? That doesn't seem too difficult, right? So, I thought I would just build something to expand my test equipment collection. Photo 1 and Photo 2 show the front and rear views of the finished project.
To Begin
I knew I needed some sort of microprocessor to perform the math and display data. Hello Arduino! The Arduino platform can measure and control inputs/outputs in the analog and digital domains. There are Wi-Fi adapters, Bluetooth adapters, plus many more input/output sensors available for a myriad of projects. Most importantly for my project, there are several types of displays. There are OLED, LED, and LCDs of various sizes and resolutions. If I could figure out how to read the input value, convert V to W via a math function and then show the final W reading on the display, I would be all set. Should only take a few hours to get this up and running… once I learn how to program and build the code!
Arduinos are based off the ATmega328P by Atmel, using 8-bit technology, running at 16MHz clock speed with 32KB of flash memory. Obviously, this is not blowing away the laptop I am using to craft this article. But it does provide a standard platform for creativity and millions of projects have been created using this hardware. The Arduino forum is fantastic and there are videos on YouTube going through tutorials for the code and how to connect various input/output devices. The common model names are Arduino Uno, Arduino Nano, and Arduino Mega. The Uno and Nano are very similar except for their physical size. They have eight analog pins and 14 digital pins with additional pins being configurable. The Mega has an increased footprint and additional analog and digital pins. All models have an onboard 5V regulator so you can supply 9V DC to 12V DC and thus have a stable 5V output (via the 5V output pin).
For analog-to-digital conversion, all the boards have an internal 3.3V reference available. If you want to use an external reference voltage, you can provide it via the AREF input pin. Power can also come from the USB connection, but the 5V is not as stable when you load up output devices. Arduino offers a starter kit with an Uno board, components, jumper wires, a small breadboard, accessories, and a hardcopy book stepping you through various projects. The starter set also helps to introduce the code as you go through the projects in the kit.
Project disclaimer: I am not a coder and have never been. I took one class in college and was not fond of programming. Showing my age a bit, HTML was not widespread during my college years. I don't even recall the languages we were using in that coding class. Here I am years later getting over my dislike of that college course to create a piece of test equipment for my bench.
Arduino
Let's begin with the Arduino. It was not hard to connect the
Uno board via USB to my Windows 10 laptop and download the Arduino Integrated
Development Environment (IDE). You need to set the communication port via your
Windows Device Manager so you can communicate with your board. MAC users follow
similar steps for iOS. I began by stepping through projects in the starter kit.
The first project in the kit is "Blink." It takes you through the
code to blink the onboard LED. Then you can expand to an external LED on the
breadboard. Within the Arduino IDE, the code for each project exists in the
project library. You can load the code for each project or type it yourself.
Your choice, your speed, and your comfort level. It really is that easy. I
progressed through the other projects and was most interested in getting to
projects using the Liquid Crystal Display (LCD) Throughout the progression, I
learned about the analog and digital pins used for input/output. Once I reached
the point of reading the value of an analog input voltage and displaying that
value on the LCD, I thought I was all set. Using a voltage divider and
potentiometer to vary the input voltage is a great way to test code and see the
results on the display. I even built code for the formula and could display
and
at the same time.
Figure 1 shows a flow diagram of the design with some button options. There are also common code examples for button load states, math conversion from the input signal and decimal to string conversion (called Dtostrf). I have a plan, and I am making strides learning the Arduino IDE. However, I am a long way from the finished product.
At this point, I need to mention the analog-to-digital converter (ADC) capabilities of the Arduino. The ADC uses 10 bits, which provides 1024 steps of resolution at 4.88mV per step. Our maximum input voltage to the Arduino is 5V. We are going to need some scaling for our input signal. But wait, I have been testing using DC voltage to test the code and display information. What about AC voltage? Here I can expand the electronics portion of this project.
The Electronics
Because audio signals are sinusoidal and not DC, I need to convert the sine waves to a DC value. This stopped my progression for a few days. I searched the web and looked in some older electronics books that I use for reference. Converters looked daunting and not very accurate. Then I came across Analog Devices LTC1968; Precision Wide Bandwidth RMS-to-DC Converter. Wow, what a simple 8-pin device to suit my needs using a single 5V DC supply. There is one exception. The maximum input is 1V peak AC. The LT1968 also works with non-sinusoidal signals as well and you can measure bursts and other unique signals. Reference the datasheet for additional details. UGH, so more scaling to get a suitable signal for another stage of the input. Scaling is a lot easier than building your own RMS converter and I just assumed this was just a trade-off in project design.
Time to perform some simple math for our scaling. I would like the input range to be up to 300W, which is approximately 49V AC. I decided my maximum input was 50V AC. If we divide this value by 50, we get 1V AC, which reaches our maximum input to the RMS converter. After converting to DC, we have a maximum output of 1V DC. To take advantage of the full scale of the Arduino ADC, we multiply by a gain of 5. Please reference the schematic shown in Figure 2.
Looking at channel one, R1, R2, and R3 make up the divide by 50 input scaling. U1 is the LTC1968 RMS converter. C1 on the output of the converter is a high-quality film capacitor. The datasheet explains the reason for this averaging capacitor, and I found 10µF was the best value for my circuit. I used a high-quality Panasonic Polyester capacitor for this application. Half of U2, then R4, R5, and R6 make up the gain of 5 circuit for this channel. The output of U2 goes directly to the analog input pin A0 of the Arduino for channel one and input A1 for channel two.
The Circuit Board
This project also has another first for me, designing my own circuit board as shown in Photo 3. Since the LTC1968 is in a surface-mount MSOP 8-pin package, it needs to be soldered to a board. I could have used an MSOP/SOIC adapter board to give me some working room with a prototype board.
With all the jumper wiring required to make everything connect on a prototype board, it was easier to lay out a circuit board. I used EasyEDA web-based software to create the schematic and then design the board from all the component points on the schematic. The learning curve was relatively easy, and EasyEDA uses standard components from various suppliers. The components have datasheet details available and physical footprint information for the board layout. One nice option is to have them stuff the board if you do not want to solder surface-mount devices. I chose not to have my boards stuffed, and used leaded components everywhere except for the LTC1968. I knew in advance that I would be using one board to test components for final values and possibly cut traces for testing. Therefore, I only had bare boards delivered.
The cost for the minimum five bare boards was very reasonable and using leaded components made assembly easy. Figure 3 shows the circuit board layout. Components and solder pads are shown in black. Red lines are top layer traces and blue lines are bottom layer traces. The power and ground traces are larger than signal traces. I used a left- to-right flow, input on the left and output on the right. Having Arduino as a part of the board just made sense for a few reasons:
1) I had the physical space to use a Nano board on the main PCB
2) I could power from a single external wall-wart supply using voltage regulators on the main PCB to supply the Arduino power and create a very accurate analog reference 5V supply for the Arduino ADC
3) I reduced wiring to and from the Arduino inputs/outputs. Looking at the power supply on the board, it has a 12V DC regulator (U4) to power the Arduino board VIN. From the 12V supply, there is a LM317 regulator (U5) set to 5.000V DC. This is fed to the AREF pin and provides the 5V reference for the ADC along with powering the LTC1968 devices.
I didn’t go crazy with the LM317 circuit. It is very low current, and I have zero drift on the output voltage. All buttons and display signals connect to the board as well.
The Next Steps
Here I am with a circuit board full of components, I have code to calculate some values and a small display. All set? Not really. I found the small display to be too small. The basic LCD screen is a 16x2 display. This means it is 16 characters wide with 2 rows. You cannot fit much on this size display. Do I scroll the display so I can read everything I want to see? Or maybe have it toggle between information sets. Neither were ideal. I had to think about everything I wanted on the display. I knew the primary information to view was Watts. It would be nice to see Volts too. And what if I change my load to a different value? How do I display the load?
How do I control this? I ended up using two buttons and logic states. The first button is labeled "LOAD." This allows me to switch between 4Ω and 8Ω, the standard loads when testing amplifiers. Press and release the LOAD button to switch values. Push and hold for two seconds and you enter the 2Ω load mode. The top row display characters show you the load value and the second row provides the channel identification and the third row displays Watts reading.
The second button gave me the option to expand measurements even more. This button is labeled "VOLTS" to show Volts on the fourth row below Watts. Pressing and holding for two seconds locks the screen to display volts continuously. Press and hold again for two seconds removes the voltage reading. Pressing and holding for five seconds switches the meter into single channel mode to calculate Watts at 8Ω, 4Ω, and to display Volts. I realized that with only one load resistor, the other value is a theoretical number and not truly measured. Again, press and hold for five seconds to exit.
I also added some code to display "Maximum Voltage, Reduce Input" when 48V AC is exceeded. One more fun feature I added at power up was a scrolling display to introduce the "Audio Watt Meter" with my initials and 2024 behind them. Photo 4 shows my breadboard prototype with the original 16x2 display and the larger 20x4 display. Photo 5 is a combined image showing the 20x4 display with Watts and then Watts and Volts.
The Finished Product
At this point, I was happy with my software and hardware. Now it was time to put a final version into an enclosure.
For the finished product, I used a Bud Industries IP-6131 enclosure. This provided enough physical space for the 4.5" circuit board and the 20x4 display. The front includes the display, the power switch, and two push buttons. There is nothing special about the power switch or the push buttons. I usually pick switches, buttons, and other mechanical components based on my personal preferences.
The rear of the enclosure has two sets of banana jacks for the signal inputs, DC power connector, USB port to communicate to the Arduino for updates if necessary, and lastly a ground jack. The ground jack is necessary to provide an earth ground to the DC part of the circuit. The Arduino has a ground circuit connected to the power supply ground. The rear panel ground connector is capacitively coupled to circuit ground via C15 to eliminate high-frequency noise. The rear panel ground is connected to a suitable ground point on your signal generator, distortion analyzer, or other grounded test equipment. The AC input signal is not ground referenced in this meter and will not affect amplifier performance.
Inside the enclosure, the circuit board is mounted to the bottom half with mounting points provided in the case mold. The display assembly is mounted using some thin aluminum perforated strips I purchased at my local big box hardware store. The enclosure base plastic is thick enough to countersink small, tapered head screws that hold the homemade bracket for the display. Photo 6 shows the inside assembly of the board, display, and other hardware.
Calibration and Startup
You need a calibrated 4-to-5-digit meter to correctly set up this circuit. Why calibrated, you ask? To accurately set the divide by 50 adjustment and accurately set the gain of 5 adjustment, you need to have a meter that reads accurately for at least 3 decimal places, which is the milliwolt (mV) range. Your meter must be accurate in the AC and DC range. I used a 5V, 1kHz stable source to calibrate everything in my circuit. 5V AC divided by 50 is 100mV AC. Then after DC conversion, a gain of 5 is applied, you have 500mV DC. Your DC value going to the Arduino will be calculated by the ADC and then displayed accordingly. In theory, you should see 5.00V AC on the Arduino display.
Accuracy matters because you most likely have multiple meters in your fleet. Which one is accurate? Unless you have a voltage calibrator idling on your bench, you will never know. I could write a whole article about meter accuracy, but I would rather not. Take a 9V battery and connect it to all your meters at the same time. Look at the readings! Don’t contact me to pay your therapist’s bill. Years ago, I decided to send certain meters out for calibration. I don’t calibrate every year.
For projects like this, I made sure to have my bench meter calibrated and I borrowed another bench meter that was calibrated a few years ago as a reference. Both readings were well within 10mV of each other for AC and DC values. Once you have your divider and gain adjusted, your meter will be linear throughout the input voltage range. Photo 7 shows my calibrated meter and Arduino meter displaying 5V from an amplifier on the test bench.
Personal Reflections
I want to share what I learned during the course of this project. My opinions in the following sentences are personal reflections and they are both positive and negative. Code is complicated. Some people grasp the concepts easily. I do not. My code is a bit hacky. Forum members were able to help me clean up several sections and solve some challenges I ran into along the way. Regarding online video tutorials... They show basics, and some give you code to copy. To make the code perform the exact way you desire, it will take time. Think of it as a large puzzle and you must put all the pieces together.
Arduinos are electrically noisy, especially noticeable in the low ADC bit range. I found soldering all the Arduino board grounds to the same ground plane was necessary to minimise noise. In my prototype, I have grounds all tied to the same point. In the final version with the circuit board, all the grounds connect to the ground trace that travels through the component layout. Being able to control the code allows you to customize everything—even small things such as your best load values. I have several test loads. The load set I use most often was accurately measured, and in the code, I was able to set the exact value. My 8Ω load is 8.11Ω. Therefore, the software has the value of 8.11 in the V² / R = W calculation. Similar for the 4Ω load.
The displays were frustrating. The code to convert the math results to a display string with two decimal places took quite a bit of reading and testing. Also, the fact that the Arduino code runs in a loop (meaning the code starts at line 1 and goes to the last line and starts over), which can make routines and display streaming difficult. Yet another learning curve. The final comment about displays involves the sizes and resolutions. As mentioned earlier, a 16×2 LCD is rather small.
Designing around a 20×4 display was better, but not great. I tried some OLED displays, but the resolution was difficult to set up for the size of the physical unit. Unfortunately, the physical mounting size of the LCD assembly is much larger than the visible area. This necessitates a taller enclosure, which I find less appealing. I am still looking for a different display that is large enough to view values but does not require a large physical footprint. Additionally with LCDs, they require multiple wire connections. There are eight data lines, power, ground, read/write and a few more. I utilized I²C connectivity with code to support the I²C protocol. This reduces display connectivity to four wires. In the schematic and on the board layout, you will see I2C from Arduino A4 and A5. I use the 5V supply from the onboard Arduino regulator to power the display and the fourth wire is ground. Regarding the 10-bit ADC resolution, having 4.88mV of resolution is good enough for my project, but I wanted better resolution.
After some reading, I was able to implement code that has the Arduino oversample the input value and I could customize the speed of the sampling, averaging and number of bits of resolution. I implemented code that uses 12 bits for 1.22mV resolution. The gentleman that published an article on this code never responded to my request to include his information here. If you have more interest, search the web for oversampling Arduino ADCs.
Closing Thoughts
In conclusion, I am very happy with my new Audio Watt Meter. I learned all about the Arduino platform, took some small steps to get over my dislike of coding, and created my own circuit and accompanying circuit board. These are the kinds of strides an ambitious project should encompass. And now the real tweaking begins for the next version.
I implemented better low signal measurement using modified code with relay switching. Perfect for low-wattage single-ended amplifiers. I also thought about a rotary encoder to adjust the load resistance if I switch test loads.
Am I planning to sell this as a kit? The answer is no. There are a few limitations for this to be a successful kit. Everyone's test loads are slightly different, and I would have to program for the exact resistance for proper results. And even more important for the kit builder is trying to calibrate without an accurate reference meter. Every DIYer should try to build this on their own with the foundations I provided. You will succeed with a nice piece of test equipment and lots of satisfaction. Go get yourself an Arduino kit and start programming. Your creativity is limitless.










0 Comments