Новости:

Форум Infotex WeaponMod

Последние сообщения

Страницы: 1 2 [3] 4 5 ... 10
21
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от DAFdriver 29 Марта 2024, 18:56:23 »
Уменя пока вот так (схема нужна) :                                                   

  /*
 This sketch uses the Adafruit i2c/SPI LCD backpack
 and shares some code from Adafruit
 ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )
 
 Sketch produced by Mike Richards (G4WNC) for publication in the August issue
 of Practical Wireless magazine in the UK
 www.g4wnc.com
 
 
  The LCD Backpack connections:
 * 5V to Arduino 5V pin
 * GND to Arduino GND pin
 * CLK to Analog #5
 * DAT to Analog #4
 
 * The AD8307 voltage output connects to the Arduino A0 pin
 

*/

// include the library code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Initialise the variables
int value = 0; // Used to store the raw reading from the ADC
float vout = 0.000; // Holds the true value of the ADC output voltage
float powerdB = 0.00; // Calculated power in dBm
float pWatts = 0.00; // Calculated power in watts
float slope = 39.44; // Slope of the AD8307 log output (Default = 40)
float intercept = 47.0; // 0V intercept point (Default = 44)
float refVolts = 2.499; // Measured value of the 2.5V external reference

// Connect to the LCD via i2c, default address #0 (A0-A2 not jumpered)
//LiquidCrystal lcd(0);
LiquidCrystal_I2C lcd(0x27,16,2);  // Задаем адрес и размер дисплея
 

void setup() {
   // Start by setting-up the pin configurations
  lcd.init();
   analogReference(EXTERNAL); // Set the Arduino to use an external reference for the ADC
   pinMode(4, OUTPUT); // Digital pin 4 is used to supply power to the voltage reference
   digitalWrite(4, HIGH); // Make sure pin 4 is high
   pinMode(A0, INPUT); // Enable the first (A0) input to the ADC
  // set up the LCD's number of rows and columns:
  lcd.begin(20, 4); // Set 4 lines of 20 characters
  // Print a message to the LCD.
  lcd.setCursor(0,0); // set the cursor to the top left, line 0 column 0
  lcd.print("  Power "); // Message on the top line of the display
  lcd.setBacklight(HIGH); // Turn the backlight on to make the display visible
  //Now print the measurement labels
  lcd.setCursor(0,1); // move the cursor to the first position on the 2nd line
  lcd.print("Meter  "); // print the label
  lcd.setCursor(0, 2); // Move the cursor to the start of the 3rd line
  lcd.print("Power (dBm): "); // Print the label
  lcd.setCursor(0, 3); // Position the cursor
  lcd.print("Power (Watts):"); // Print the label
}

void loop() {
   
  value = analogRead(0); //read the ADC and store the result in value
  vout = (value*refVolts)/1023; // Convert the ADC result to volts in vout                                                                                                                                                                     
  powerdB = (slope*vout)-intercept; // convert the voltage to dBm in 50 ohms
  pWatts = pow(10.0,(powerdB -30)/10.0); // convert dBm to watts
  lcd.setCursor(13, 1); //Move the cursor to the 13th position
  lcd.print(vout,3); // Display the AD8307 voltage
  lcd.setCursor(13, 2); // Position the cursor
  lcd.print("       "); // Print spaces to clear the last result
  lcd.setCursor(13, 2); // Position the cursor
  lcd.print(powerdB,1);// Display the power in dBm
  lcd.setCursor(15,3); // Position the cursor
  lcd.print("     "); // Print spaces to clear the last result
  lcd.setCursor(15,3); //Position the cursor
  lcd.print(pWatts,1);// Display the power in watts
}
22
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от DAFdriver 29 Марта 2024, 11:26:29 »
АДшка пришла , но получу лишь завтра . Нужна схема и скетч. Я просто включил инициализацию дисплея и написал шрифт .
23
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от Koshak 29 Марта 2024, 05:38:33 »
По сути уже можно подключить ADшку и готово  :D
В коде нужно поправить калибровки.
24
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от DAFdriver 28 Марта 2024, 21:25:25 »
дисплей работает
25
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от DAFdriver 28 Марта 2024, 17:56:08 »
26
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от Koshak 28 Марта 2024, 05:13:39 »
У меня ADшка ещё в пути...
Какой аттюнеатор купил?
За основу возьму этот код, подрихтую его под себя  :-):
Извините, вам запрещён просмотр содержимого спойлеров.
27
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от DAFdriver 27 Марта 2024, 19:00:56 »
Пришло все , но AD8307 могу получить ллишь в субботу ( почта работает до16.00 а я до 17.00)
28
Приборы / Re: Измеритель мощности 1-8000MHz
« Последний ответ от DAFdriver 26 Марта 2024, 20:45:26 »
Ардуинка и нагрузка прищли , жду остальное
29
Приборы / Re: GPSDO Murzik
« Последний ответ от Koshak 24 Марта 2024, 08:55:52 »
Приехали кварцы на 25MHz, разброс и добротность у них гуляет ппц. Отобрал три штучки )))
Для удобства сортировки кварцев, занёс в таблицу Excel. Последний столбец уровень сигнала с тестового генератора, косвенно можно оценить активность кварца.
30
Приборы / Re: GPSDO Murzik
« Последний ответ от Koshak 24 Марта 2024, 08:33:19 »
Оформил в корпус, в качестве задней панели печатная плата с шелкографией.
На Али покупал здесь https://aliexpress.ru/item/1005005401526420.html


Страницы: 1 2 [3] 4 5 ... 10