Homebrew AD8307 PowerMeter  - Page 1
Forum section: electronics / rf-microwave

author: shadow.dark
author_rank: Contributor
timestamp: August 17, 2021, 06:11:51 am
content: I plan to use ad8307 to make a simple power meter. Of course, Arduino is the best choice for handling control and display affairs. This is the very first version,not any test yet， there may still be BUGs in, and the Arduino program has not been written.I do this all in my spare time. please be patient.I can design and build hardware close to proficiently.But programming is not my strong point. If anyone can provide programming guidance or find any errors and defects in this design, I would be very grateful.I will make improvements based on the test results soon.I had upload it on githubhttps://github.com/absgitter/Arduino-AD8307-RF-Power-MeterI drew all this with EASYCAD. pop in China.

author: bob91343
author_rank: Super Contributor
timestamp: August 18, 2021, 12:10:53 am
content: What is the frequency range of this device? Does it provide a load to the source, or does it measure power to an external load? How much power?

author: radiolistener
author_rank: Super Contributor
timestamp: August 18, 2021, 12:50:25 pm
content: bob91343Frequency range, dynamic range and absolute maximum power limit on the input can be easily found in theAD8307datasheet:- frequency range: DC...500 MHz- dynamic range: 92 dB for ±3 dB Error or 88 dB for ±1 dB Error- absolute maximum rating for input power depends on power supply voltage, for 5V is max +17.95 dBm (0.0625 W).- maximum usable value is about +17 dBm (0.05 W), but I would suggest to not exceed +10 dBm (0.01 W)Regarding to the dummy load, if you want to measure more that 10 mW power, you're needs to use attenuator. For 100 W input power you're needs 100 W 40 dB attenuator. On aliexpress such attenuator will cost you about80 USDSome time ago I experimented with such power metering using ChineseAD8318module,STM32F103C8T6 bluepill moduleand 2x16 LCD module. Works ok.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 18, 2021, 12:56:10 pm
content: I guess it'd be widely appreciated if you posted a simple pdf with the schematics; personally I have no need to install any random cad software of unknown origin"of course" Arduino is not necessarily the best choice; it's mostly doing crap code.the success in using the AD8307 (like in all other logarithmic detectors) lies mostly in a proper impedance matching; but for this we need to see some schematic

author: radiolistener
author_rank: Super Contributor
timestamp: August 18, 2021, 01:11:43 pm
content: I can add, that uploading source code in zip archive on github is just disregarding of gihub functions and uniform bullying of users who trying to see this page.Github is intended to work with source code in plain form, it has code viewer and change tracking features for that. By using zip archive with sources you're just disable it and require user for unnecessary actions (such as download archive and unpack it) just to see source code

author: iMo
author_rank: Super Contributor
timestamp: August 18, 2021, 09:23:17 pm
content: There is a plethora of ad8307 designs on the web as it is almost a vintage chip (24y in production?).It produces 0-2.5V output, thus no prob with interfacing to any MCU. Arduino is just fine.A 50ohm loaded (and some attenuation if required) input coupled via an 1n||100n capacitor makes the job for HF-UHF.

author: Bud
author_rank: Super Contributor
timestamp: August 19, 2021, 12:01:40 am
content: Or use a directional coupler with the coupling ratio designed for a particular range of load, so the coupler's output conforms to this chip input power specification.

author: shadow.dark
author_rank: Contributor
timestamp: August 19, 2021, 12:57:01 am
content: Thank you for your attention, I admit that this design is indeed a bit old-fashioned. But after drawing the PCB, I was still a little excited, maybe I was too excited. Now I have added some drawings in PDF format. I hope it will make it easier for everyone to read. The PCB board is also in hand, thanks to the postman, when the confusion arises again（Many blocks in Wuhan are blocked ）.The price of chips has gone up wildly in the past year, and I may have to use some old components that have been removed from other PCBs. I will install it as soon as possible.As you said, I think the advantage of this thing lies in its flexibility. It can be used with attenuators, directional couplers, and any method you can think of.

author: Berni
author_rank: Super Contributor
timestamp: August 19, 2021, 05:31:14 am
content: I suggest you get a cheep off the shelf arduino dev board and just try doing some stuff with it to get familiar with how programming works. You might also want to watch a few C for beginners tutorials on youtube.There are different areas of programming that you sort of learn seperately. One is simply the language itself, this is knowing how to correctly write a if statement, loop, function etc... Then there are programing paradigms of how things are done in software and what your code actually does inside the CPU. Then there are algorithms that help you get a task done in a faster and more efficient manner (Like fast math with no floating point math unit, statistics, filters, signal processing). There is also about writing drivers, this delves into low level coding stuff of how to properly poke the registers of a peripheral to make it do what you want.The stuff is not that hard once you get it, but you do need to be persistent enough to get trough the significant volume of knowledge required.

author: DeepLink
author_rank: Regular Contributor
timestamp: August 19, 2021, 05:39:24 am
content: You might what to give these projects a look, has a good description of both hardware and softwarehttps://www.changpuak.ch/electronics/Logarithmic_Amplifier_AD8307.phphttps://www.changpuak.ch/electronics/Arduino-Shield-NRVD.php/Hans

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 19, 2021, 10:34:18 am
content: I wouldn't trim the AD8307 externally with pots but use calibration functions within the softwarealso the impedance matching might me mathematically correct, but so many resistors together isn't really good rf-style, since there are 52,3ohms resistor readily availableyour opamp amplification seems too high; 2,5x is at the limit in the upper range from the AD8307 since you reach about 2.2Vout at 0dBm in, what would give you 5.5Vthere has to be done a tradeoff in using the large dynamic range of the AD8307. do you need to go down to ~ -80dBm or can it be higher? for my rfmeter I used the way OZ2CPU showed with his 30dB pad on the input; that reduces the lower end to -50dBm, but you can go as high as +30dBm on the upper side, what is often more useful than the -80dBm at the lower end

author: shadow.dark
author_rank: Contributor
timestamp: August 23, 2021, 01:18:02 am
content: About the52,3ohms resistor:I will use my HP8714 to measure the input impedance and find the best matching combination. I just set aside four 1206 positions.About the OPAMP:I will recalculate it .Thank you.Now I have realized the first shortcoming of the design, maybe I should add a calibration source for it.Another idea is to leave out the interface between multiple boards, Generally speaking, good ideas always come too late .Unfortunately, I have been very busy recently, My colleagues have been forced to work from home, and the efficiency of the company has dropped severely. There also has some problems with components deliver , and the assembly work originally planned for the weekend had to be postponed.What needs to be explained is that I do not intend to commercialize this thing, so it will not become another crappy Chinese kit.

author: markus_jlrb
author_rank: Regular Contributor
timestamp: August 23, 2021, 10:44:43 am
content: @shadow.dark,enjoy the work and your ideas and do not be disappointed by nag. feedback.The way is the goal and if you like in addition to share your work this will improve your karma ;-)Markus

author: geggi1
author_rank: Frequent Contributor
timestamp: August 23, 2021, 10:40:04 pm
content: I made some thing similar many years ago.You should make some kind of smoothing for the measurements if you want to measure on SSB signals, because the readings will be all over. You can do the smoothing in the software or just use a simple RC circuit.

author: bob91343
author_rank: Super Contributor
timestamp: August 24, 2021, 11:15:39 pm
content: So we start with a tantalizing topic, Homebrew Power Meter. But it can only handle 60 mW so we need a calibrated attenuator or sampler to work with a few Watts or a kilowatt. Such an device will cost more than the power meter.Measuring power is tricky unless the SWR is 1:1. In my ham station, that is usually the case, so my power meter solution is an old fashioned HP 410B to measure the voltage and then compute the power mentally. It's also more rugged and can withstand overrange powers.I am not criticizing the OP design. It is probably the answer for many bench measurements. I may even build one eventually.

author: shadow.dark
author_rank: Contributor
timestamp: August 25, 2021, 07:12:14 am
content: Sorry BOB, this may disappoint you a bit. Maybe I didn't give it a good name. For KW or W class power measurement, I have a BIRD 43. (Of course, like most of my instruments, it is also second-hand purchased from places like EBAY). So my original purpose was to measure tiny power.(Measuring small power is atlest helpful for receiver debugging) Although I also have a spectrum analyzer Agilent N9020A,But it is too heavy for my toolbox.

author: geggi1
author_rank: Frequent Contributor
timestamp: August 25, 2021, 09:42:11 am
content: Don't use the slope adjustment its better to do this in software. Depending on where you tap the RF there will always be a frequency dependent component.Here is a code i made some years back. It was meant to be used with a 30dB power tap or attenuator. There is no smoothing of the input and no frequency compensation.Id does also enable serial print to PC.Code:/*RF_pwr_meterReads an analog input on pin 0, converts it to voltage, dBm and W and prints the result to the serial monitor.Dublicate result to LCDThe hardware are based on the AD8307 log amp( power detector) see page 21 fig 41 in the datasheet.*/#include <LiquidCrystal.h> // include the library code:LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the library with the numbers of the interface pinsvoid setup() { // the setup routine runs once when you press reset:Serial.begin(9600); // initialize serial communication at 9600 bits per second:lcd.begin(16, 2); // set up the LCD's number of columns and rows:lcd.setCursor(5, 0); // (note: line 1 is the second row, since counting begins with 0):lcd.print("LA9XNA"); // Print a message to the LCD.lcd.setCursor(1, 1); // (note: line 1 is the second row, since counting begins with 0):lcd.print("RF-Power meter"); // Print a message to the LCD.delay(2000); //Delay 2 seklcd.clear(); //clear display}void loop() { // the loop routine runs over and over again forever:float sensorValue = analogRead(A0);// read the input on analog pin 0:float voltage1 = sensorValue * (5.047 / 1023.0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):float voltage = voltage1/2; // divide by two because of 2x opamp on inputdouble dBm=(40*voltage-40); // calculate dBmdouble Pu= pow( 10.0, (dBm+30) / 10.0); //pwr in uWdouble Pm= pow( 10.0, (dBm) / 10.0); //pwr in mWdouble Pw= pow( 10.0, (dBm-30) / 10.0); //pwr in W// Serial.print(voltage); Serial.print("V");Serial.print(dBm);Serial.println("dBm");lcd.setCursor(0, 0);lcd.clear(); //clear displaylcd.print(dBm);lcd.print("dBm");lcd.setCursor(0, 1);if (dBm <= 0) goto PrintPu; // jump to print uWif (dBm >= 30) goto PrintPw; // jump to print W//Serial.print(Pm); Serial.println("mW"); // print mWlcd.print(Pm);lcd.print("mW "); // print mW on LCDPrintPu : // print uW// if (dBm <= 0) Serial.print(Pu); if (dBm <= 0) Serial.println("uW");if (dBm <= 0) lcd.print(Pu); if (dBm <= 0) lcd.print("uW ");PrintPw :// print W// if (dBm >= 30) Serial.print(Pw); if (dBm >= 30) Serial.println("W");if (dBm >= 30) lcd.print(Pw); if (dBm >= 30) lcd.print("W ");delay(300); //Delay 500ms