Cannot Read DC Voltage Value! (RF Application)

I am seeking for a measurement method to read an Analog input using an Arduino Mega. My setup includes some RF instrumentations such as signal generator and power detector. Basically, I feed the power detector with a cw signal, which provides an output in DC voltage type. This DC voltage is in the Millivolts order (checked using Multimeter). However, when the arduino analog input and the ground is connected, serial monitor prints only 0 mV.

To solve this problem, I have tried a few ways as follows:

  • Checking the arduino's all analog input pins whether operational or not. (I have tested using a DC power supply, accurate results are printed properly, thus, arduino board is ok.)
  • Checking all the wirings and the connections. (When the multimeter is connected to the same jumper endings, shows the correct value, but, when the arduino is connected, prints only 0 mV.)

Finally, here is the code I have been using:

const int analogPin = A0; // Analog pin to read the voltage
const float referenceVoltage = 5000.0; // Reference voltage in millivolts (5V for most Arduinos)

void setup() {
Serial.begin(9600); // Start serial communication
}

void loop() {
int rawValue = analogRead(analogPin); // Read raw ADC value
float voltage = (rawValue * referenceVoltage) / 1023.0; // Convert to millivolts

Serial.print("Raw ADC Value: ");
Serial.print(rawValue);
Serial.print("\tVoltage: ");
Serial.print(voltage, 2); // Print voltage with 2 decimal places
Serial.println(" mV");

delay(1000); // Delay for better readability (adjust as needed)
}

Best

Hello suleymantbtk

Welcome to the worldbest Arduino forum ever.

I´ve made cross check. The sketch is ok.

Raw ADC Value: 992	Voltage: 4848.48 mV
Raw ADC Value: 993	Voltage: 4853.37 mV
Raw ADC Value: 994	Voltage: 4858.26 mV
Raw ADC Value: 996	Voltage: 4868.04 mV
Raw ADC Value: 1001	Voltage: 4892.47 mV
Raw ADC Value: 1004	Voltage: 4907.14 mV

Check the wiring.

Have a nice day and enjoy coding in C++.

You say you are measuring a voltage in the millivolt range, the ADC goes from 0 to 1023, split that up across 5V and you get steps of about 5mV. If your signal is less than 5mV you are going to see zero.

Wirings seem ok, but, I will double check. Thanks

Yes I am aware that the resolution value is not that high. However, my reading should vary within 0mV-600mV range (Expected outcome is defined in datasheet, and tested via multimeter).

1 Like

Your detected RF signal may be pulsating at the carrier frequency.

You multimeter does some form of averaging and is giving you a reading, however the Arduino only takes an instantaneous reading.
You might just be unlucky in that the Arduino happens to sample at a low point in the waveform.

Try connecting a capacitor between the Arduino input and GND, so that you are forming a peak detector with the detector. Value does not need to be very high at radio frequencies - try say 10nF to 100nF sort of range.

The Mega has a built-in 1.1volt Aref. Then 600mV could give you enough A/D values.
Add this to setup().
analogReference(INTERNAL1V1);
Leo..

I have tried a variety of capacitance values, unfortunately, didn't solve the issue.

Still not working eventhough I added the line you suggest me above.

Does the voltage level you are measuring look smooth on an oscilloscope ?

Not really, when the input signal amplitude is increased, you can clearly see the oscillations. In this case (under normal conditions), adding a capacitor would help me but it did not. Most reliable measurement method is using multimeter according to the manufacturer. Considering their test setup, multimeter would be enough to test device and DC output.

By any chance, could the issue root from a possible "RF instrument - Arduino" mismatch?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.