Arduino A.G.C

Control is in you hands. Decay time, fall time, rise time, values

Arduino Nano C++ Main Loop@10Khz

AD8307 Logarithmic detector, DC to 500 Mhz

12 bit MCP4725 DAC output to AD603 I.F.

Video with AGC voltage drop while input signal is increasing

This is Work in Progress !

5/5
Arduino Nano is fed by AD8307 logarithmic detector, straight into analog input pin. AD8307 is tied to Audio DSP output to act only within selected Bandpass.
5/5
I am gonna use this DAC despite Arduino analog output, simply coz Arduino is PWM output and it's PWM freq sucks , max 900 Hz. MCP4725 is 12 bit DAC and it is R/2R, some delay introduced via I2C bus.

10 Dec 2022 - AD8307 added

Entire breadboard is USB powered so it get some noise
96dB range Log detector
  • Ad8307
  • Arduino Nano
  • MCP4725 DAC
  • Programable custom timing
  •  

Github code

Still a project, not yet implemented !

For the sake of Google indexing, I will keep this page as a separate post for a while, until some extensive tests and trials are done for a new homebrew transceiver to worth a dedicated page.

In this post, I will present with further details what a simple yet efficient AGC can do using both dark side and light side of the Force, software and hardware. This AGC cannot solve RX bad design, depending by the amount of noise produced by RX stages, AGC can be more or less efficient !

The aim is to use audio detection where AGC response is set by Audio DSP filter, as philosophy, there is no contest advantage when AGC is brought down by unwanted signals nearby, therefore the aim is to make it as selective as I can.

Audio DSP should produce 2V pp with no clipping, also a 200 microvolts signal when antenna port is disconnected, in order to keep 2V / 0.0002V  = 10^4  voltage ratio. DB is always a formula of 20 log10 from V1/V2, so a minimum of 80 dB range is achieved from log10(2/0.0002) which is 4, multiplied by 20 thus 80 dB, but only when entire RX noise presented to AD8307 is 200 microvolts and peak audio signal is  minimum of 2 V with no sine alteration. In real world, a 120dB AGC will be needed but right now I try to do analysis, understand and build a 80 dB one, ok ?

So a common AD8307 is fed by audio signal and its output voltage is within 0.3  – 2.3 V in relation with 25mV/ dB to get 80 dB range.  This output voltage goes to Arduino nano for sampling where via I2C another DAC produces a proportional voltage value. What arduino does , it gets instant AGC dropdown while is slowly recovering via software, which can be upgraded for specific needs. Right now it only does instant peak IF adjust and slow recovery, yet a lot of code functions to be added.

The output of DAC controlled by Arduino gets into a substracting mode OPAMP who is set with IF needs accordingly , in my case 2 x AD603 who respect same 25mv per dB but biased at 5.6 V for max gain but kick off occurs at 5 V , so there is plenty of room to play with values without getting unpleasant wobbling signals.

Another advantage of software AGC is that if using 2 x AD603 I.F. stages, with 2 Volts produces by detector as per 80 dB , just half of it is needed to drive 2 x 40 dB stages, otherwise instead of a linear response as 1dB raise/ 1dB ATT , you will get a ratio of 1dB raise/2dB ATT which clearly is to be avoided. So a simple C++ formula is enough to compensate this problem which will be translated into a very aggressive AGC which leads to a very unpleasant Audio output. A simple resistive divider would suffice, but “where is the beef ? “, no fun and no automated control would be at your hands, right ?  

What become very obvious from the beginning, was the fact that AD8307 was picking some big additional noise if Arduino input is not fed via a low pass filter, also Arduino 5V and OPAMP 12V rail should be also filtered using a 20 ohm series resistor and a large 10000 microfarads capacitor. PCB ground plane, stray inductors or capacitors should be careful designed to avoid all above, after all AD8307 is a 96 dB detector, quite sensitive I would say. Also a strong shielding around AD8307 is needed.  

It is almost 01 o’clock in the morning, got tired so another story next time !

CUAGN and 73’s !

 

16 December 2022

started from scratch

Just for testing purposes, I have built a FR4 shielded case to observe if intrinsic noise picked by AD8307 is from “Ugly weekender spider soldering style ” or other cause.  Also I went deeper wih 5V rail filtering. Oh boy, what a difference ! Instead of 0.5 V output with no input signal, I got 0.237 V output after shielding, so another 10 dB recovered from noise. Make sure the AD8307 purchase is from a legit source, not a cheap knock off !

As per Arduino Nano datasheet , an AnalogRead() cycle takes about 100 micro seconds , so only that will render it as 10 Khz measure time. With all other functions and callbacks, probably entire loop cycle will take a wee bit  longer, will be measured in a future post !