i'm using a Microwave sensor module 1130 to detect the target (subject about trafic road) using doppler effect and sensor can detect Up to 20m
the signal output of the sensor is very low sow I have amplified by lm385
The amplification is below schema
I used the FFT library to get the frequency and apmilutude
The problem is the operation is not stable
somtimes can detect up to 20m perfectly and somtimes can detect up to 0.5m i don't know why ?
i don't have any idea about the probleme is about the amplification or what ?
is it possible the arduino energy get down randomly
#define FFT_N 256
#include <FFT.h>
int frequency = 0;
int resolution = 9615 / 256;
int maxLogOut = 0;
int u =0;
int amp;
int a=0;
int w =0;
int f =2;
int num=0;
int id = 1;
float g =0.0550454;
String dataString;
uint8_t s=0;
void setup()
{
Serial.begin(9600);
ADCSRA |= (1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0); //set adc prescaler=128
ADMUX = 0x40; // use adc0
ADCSRA |= (1<<ADATE); //enable auto trigger
ADCSRA |= (1<<ADEN); //enable ADC
ADCSRA |= (1<<ADSC); //start ADC measurements
}
void loop()
{
cli();
for (int i = 0 ; i < 512 ; i += 2)
{
while(!(ADCSRA & 0x10));
ADCSRA |=(1<<ADSC);
byte m = ADCL;
byte j = ADCH;
int k = (j << 8) | m;
k -= 0x0200;
k <<= 6;
fft_input[i] = k;
fft_input[i+1] = 0;
}
fft_window();
fft_reorder();
fft_run();
fft_mag_log();
sei();
u =0;
w =0;
f =2;
v =0;
amp = 0;
uint8_t x=0;
for( f =2;f<128;f++)
{
if ( fft_log_out[f]>x)
{
x=fft_log_out[f];
w=f;
}
}
u = w*resolution; // frequnecy
amp = 2<<(x/16); // amplitude
v=g*u; // vitesse
}
