Here i am using ad8362 with ardunio uno as emf radiation detection ...
my connection ..
UNO ----> AD8362
5v -----> vcc
GND -----> Gnd
A1 ------> VOUT
Please help me to build the emf detection using ad8362 .. you can find below code...
const int ad8362Pin = A1; // AD8362 analog output
const int buzzerPin = 8; // Buzzer digital pin
const float vRef = 5.0; // Reference voltage
const float adcMax = 1023.0; // Maximum ADC value (10-bit)
// AD8362 parameters
const float slope_mV_dB = 50.0; // 50mV/dB scale factor
const float vIntercept = 1.1; // Intercept voltage at -52dBm
const float intercept_dBm = -52.0; // Intercept power level
// Antenna parameters
const float antenna_area_cm2 = 10.0; // Antenna effective area in cm²
const float antenna_efficiency = 1.0; // Assume 100% if unknown (0.0-1.0)
// Detection threshold
const float EMF_THRESHOLD = 10.0; // Threshold in µW/cm²
const float HYSTERESIS = 1.0; // Hysteresis to prevent flickering
bool buzzerState = false;
void setup() {
Serial.begin(9600);
pinMode(buzzerPin, OUTPUT);
digitalWrite(buzzerPin, LOW);
}
void loop() {
// Read and convert ADC value
int rawADC = analogRead(ad8362Pin);
float vSense = rawADC * (vRef / adcMax);
// Convert to dBm
float dBm = intercept_dBm + ((vSense - vIntercept) / (slope_mV_dB / 1000.0));
// Convert dBm to mW (properly handling negative values)
float mW = pow(10.0, dBm / 10.0);
// Calculate power density (µW/cm²)
float uWcm2 = (mW * 1000.0 * antenna_efficiency) / antenna_area_cm2;
// Hysteresis control for buzzer
if (uWcm2 > (EMF_THRESHOLD + (buzzerState ? 0 : HYSTERESIS))) {
buzzerState = true;
digitalWrite(buzzerPin, HIGH);
}
else if (uWcm2 < (EMF_THRESHOLD - (buzzerState ? HYSTERESIS : 0))) {
buzzerState = false;
digitalWrite(buzzerPin, LOW);
}
// Serial output
Serial.print("Raw ADC: ");
Serial.print(rawADC);
Serial.print(" | Voltage: ");
Serial.print(vSense, 3);
Serial.print("V | dBm: ");
Serial.print(dBm, 1);
Serial.print(" | mW: ");
Serial.print(mW, 6);
Serial.print(" | EMF Density: ");
Serial.print(uWcm2, 2);
Serial.print(" µW/cm² | Buzzer: ");
Serial.println(buzzerState ? "ON" : "OFF");
delay(200);
}
Take a look into the datasheet of the AD8362 and look for application examples.
Looks like only the controller powering is missing. Start by using USB powering.
i didn't find the application example .. i am little bit confusing in data sheet and physical device pin out are different ( i am using Tru Pwr detector ad8362)...
can you please help me out..
Such examples are commonly presented at the end of the datasheet or in separate application notes.
What is the problem, the difficulty? Posting a link to the exanct circuit You have is customary….
here i connect the vout to the A0 , vcc to the 5v ardunio uno , coming to the ground >> if connect the ground emf density values become zero , without ground connection i am getting values ... and here ground and all edge with holes as shown in image ..are ground i check with mutimeter those edges and ground is shorted..
const int ad8362Pin = A1; // AD8362 analog output
You have the output of the AD8362 module connected to pin A0 of the Arduino, however your code is expecting it to be connected to A1.
Change either the wiring or the code, so that the pin you connect to is the one you mention in the code.
It's typo mistake , I used A1 only as shown in image ..
Looks like you made the same typo in both post #1 and post #5. You should be more careful.
I see you've edited post #1 to make my post #6 look wrong.
Good job I quoted what you originally said.
let me correct , i connected vout to A1 ... how to figure out this issue ... any ideas about this .. please share.
If you are getting readings with the GND not connected, then this is just a leakage current through the AD8362 getting to the Arduino analogue input.
Any readings that you get in this condition will be totally meaningless.
The GND of the AD8362 module must be connected for the IC to be powered and to output a voltage.
If you are getting no output with the GND connected then it is probably because there is nothing to measure.
Is that a brand name for the chip on a circuit board? OR are you just using the chip on a circuit board of your design? Either way, show us a schematic of your project.
No ground, no circuit. No circuit, no path for electrons to flow. No path for electrons to flow, nothing works. Electricity 101. Covered in the first lesson on the first day.
And you haven't just stuck those Dupont connectors through the holes and assumed that it would somehow magically work, right?
Where did you get the values for Intercept voltage and Intercept power level from?
Looking at the AD8362 datasheet, the intercept voltage should be -60dBm, and the intercept voltage 0V.
I do not have an AD8362 module.
I used an Arduino Uno R3, and I simulated the AD8362 output using a Function/Arbitrary Waveform Generator to test the code.
Using your figures, for a 3V output from the AD8362, the Serial Monitor indicates:
Raw ADC: 609 | Voltage: 3.002V | dBm: -14.0 | mW: 0.040094 | EMF Density: 4.01 µW/cm² | Buzzer: OFF
Using the figures from the datasheet, for a 3V output from the AD8362, the Serial Monitor indicates:
Raw ADC: 609 | Voltage: 3.002V | dBm: 0.0 | mW: 1.007128 | EMF Density: 100.71 µW/cm² | Buzzer: ON
For 3V input to the Arduino, the power indicates 0dBm, which agrees with the 'fig16' graph above.
There is a big difference between the 4µW/cm² that your code indicates for 3V input, and the 100µW/cm² using the datasheet values.
Not the same as pointed out by
@van_der_decken .
Have you got some simple code, no threshold or stuff like that, that JUST reads the 8362 and outputs the Analog input to the IDE serial monitor.
If not then do so, this will simplify troubleshooting.
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Tom....
