{"id":356,"date":"2015-07-30T16:10:24","date_gmt":"2015-07-30T14:10:24","guid":{"rendered":"http:\/\/pa0rwe.nl\/?page_id=356"},"modified":"2024-07-07T15:32:55","modified_gmt":"2024-07-07T13:32:55","slug":"rf-miliwatt-meter-oz2cpu","status":"publish","type":"page","link":"https:\/\/pa0rwe.nl\/?page_id=356","title":{"rendered":"RF MiliWatt meter"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1507 size-medium aligncenter\" src=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter5-600x273.jpg\" alt=\"\" width=\"600\" height=\"273\" srcset=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter5-600x273.jpg 600w, https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter5-768x350.jpg 768w, https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter5-1024x467.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p style=\"text-align: center;\">Arduino version of the AD8317 mW meter<\/p>\n<p align=\"left\"><a href=\"https:\/\/nl.aliexpress.com\/item\/NIEUWE-1-st-AD8317-Module-RF-Power-Meter-Logaritmische-Detector-Power-Detectie-1-10000-mhz\/32959414538.html?spm=a2g0z.search0104.3.128.5a1721d88E5GhO&amp;transAbTest=ae803_3&amp;ws_ab_test=searchweb0_0%2Csearchweb201602_3_10065_10068_319_317_10696_10084_453_454_10083_10618_431_10304_10307_10820_10821_10301_537_536_10843_10059_10884_10887_100031_321_322_10103%2Csearchweb201603_2%2CppcSwitch_0&amp;algo_pvid=e1fcf7f5-2e32-4704-abf2-5449f8fb50db&amp;algo_expid=e1fcf7f5-2e32-4704-abf2-5449f8fb50db-20\" target=\"_blank\" rel=\"noopener noreferrer\"><i><span style=\"color: #0000ff;\">AD8317 at Aliexpress.com\u00a0<\/span><\/i><\/a><br \/>\n<em><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ad8317.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">AD8317 Datasheet<\/a><\/span><\/em><\/p>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21\" src=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2015\/07\/updated.gif\" alt=\"\" width=\"44\" height=\"12\" \/> \u00a0 Downloads:\u00a0\u00a0 <a href=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2024\/07\/AD8317_mWmeter_Web.zip\"><span style=\"color: #0000ff;\"><em>AD8317_mWmeter.zip<\/em><\/span><\/a> \u00a0 <b>Note:<\/b> This file contains 2 versions: one for a <strong>2&#215;24<\/strong> character LCD and one for a <strong>2&#215;16 I2C display. <\/strong>I also added the <strong>Bounce2<\/strong> lib.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Updates<br \/>\nVersion 1.6\u00a0<\/strong><\/span>Due to an error in thinking, the error correction was calculated based on the input + the set attenuation. That wasn&#8217;t right. The error correction is now calculated based on the real input signal strength.<br \/>\nThe display also indicates with a &#8216;c&#8217; when the error correction has been used.<br \/>\n<span style=\"text-decoration: underline;\"><strong>Version 1.5\u00a0<\/strong><\/span> The Minus (-) sign before the attenuation value is removed.<span style=\"text-decoration: underline;\"><strong><br \/>\n<\/strong><\/span>It is now possible to reset the calibration value for one band only.<br \/>\n<strong>Version 1.4<\/strong>\u00a0 The error values \u200b\u200bare included in the measured power value and removed from the display. This ensures that the value on the display more closely matches the actual measured value. The datasheet of the AD8317 was used to determine the error values.<br \/>\n<strong>Version 1.3<\/strong>\u00a0 The Error values are updated according the datasheet. This error value is displayed.<\/p>\n<p>The <span style=\"color: #0000ff;\"><em><a style=\"color: #0000ff;\" href=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/11\/rf_meter_schematic.jpg\" target=\"_blank\" rel=\"noopener noreferrer\">schematic<\/a><\/em><\/span> \u00a0 of the mW meter ( 2&#215;24 version). The 2&#215;16 character display is controlled by I2C on pin A4 (SDA) and A5 (SCL)<\/p>\n<p align=\"left\">\u00a0After many years of using the OZ2CPU HF meter, I switched to the Arduino and the AD8317. This had two reasons: the PIC compiler was no longer efficient enough to compile the software without errors and I wanted to be able to take measurements up to 10GHz. This resulted in a new design in the Arduino Nano but using the display layout of the OZ2CPU HF meter.<\/p>\n<p>In first instance I used the sketch of Joost Breed because he uses the average of a lot of measured samples in a second to display the power.\u00a0 That gives an accurate and stable display as well.<br \/>\nSecondly I added a calibration method to calculate the SLOPE and INTERCEPT by two measurements on -10 and -40 dBm. By this method you get a much accurate measurement over the complete dynamic range. For details please read the AD8317 datasheet. The calibration is done for 8 bands (HF, 4m, 70cm, 23cm, 13cm, 9cm, 6cm and 3cm) and the calculated SLOPE and INTERCEPT is stored in EEPROM.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Note:<\/strong><\/span> To be able to measure more accurately, it is wise to leave the input between -10 and -40 dBm. Add additional attenuators to the input of the meter if necessary.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Menu functions:<\/strong><\/span><br \/>\n&#8211; Set attenuation to 0, 10, 20, 30, 40 and 60 dB\u00a0 (stored in EEPROM)<br \/>\n&#8211; RF Power meter (default function)<br \/>\n&#8211; Calibration -10 and -40 dBm for each band\u00a0 (stored in EEPROM)<br \/>\n&#8211; Read calibration data for all bands<br \/>\n&#8211; Default Calibration data for the selected band (Reset calibration)<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Calibration procedure<br \/>\n<\/strong><\/span><\/p>\n<ul>\n<li>Start setting the calibration value for the selected band to default (see below)<\/li>\n<li>Select the band you will calibrate<\/li>\n<li>Push the Menu button<\/li>\n<li>Select Menu item 7 (calibration)<\/li>\n<li>Set your RF generator to -10 dBm<\/li>\n<li>Push the Select button<\/li>\n<li>Set your RF generator to -40 dBm<\/li>\n<li>Push the Select button.<\/li>\n<li>Calibration completed.<\/li>\n<li>Check the calibration and if not OK do it again.<\/li>\n<\/ul>\n<p><strong><span style=\"text-decoration: underline;\">Setting Calibration value to default<\/span><br \/>\n<\/strong><\/p>\n<ul>\n<li>Select the band you will set to default calibration data<\/li>\n<li>Push the Menu button<\/li>\n<li>Select Menu item 9 (Zero Band Cal)<\/li>\n<li>Push the Select button.<\/li>\n<li>Default calibration of the selected band is completed.<\/li>\n<li>Start calibration<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Hardware:<br \/>\n<\/strong><\/span>As you can see on the picture below the hardware is pure and simple..\u00a0 It consists of (from left to right) the 5V power supply,\u00a0the Arduino Nano, the AD8317 module and a 2&#215;24 character module.<br \/>\nFor the 2.048 Volt reference you can use every reference chip you like. Some parts do need a serial resistor, some do not.<\/p>\n<div id=\"attachment_1508\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1508\" class=\"size-medium wp-image-1508\" src=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter6-600x540.jpg\" alt=\"\" width=\"600\" height=\"540\" srcset=\"https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter6-600x540.jpg 600w, https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter6-768x692.jpg 768w, https:\/\/pa0rwe.nl\/wp-content\/uploads\/2019\/01\/rf_meter6-1024x922.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><p id=\"caption-attachment-1508\" class=\"wp-caption-text\">Insight view<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arduino version of the AD8317 mW meter AD8317 at Aliexpress.com\u00a0 AD8317 Datasheet \u00a0 Downloads:\u00a0\u00a0 AD8317_mWmeter.zip \u00a0 Note: This file contains 2 versions: one for a 2&#215;24 character LCD and one for a 2&#215;16 I2C display. I also added the Bounce2 lib. Updates Version 1.6\u00a0Due to an error in thinking, the error correction was calculated based [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-356","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=\/wp\/v2\/pages\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=356"}],"version-history":[{"count":66,"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=\/wp\/v2\/pages\/356\/revisions"}],"predecessor-version":[{"id":2059,"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=\/wp\/v2\/pages\/356\/revisions\/2059"}],"wp:attachment":[{"href":"https:\/\/pa0rwe.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}