18/01/2021 To 24/01/2021
Studied previous semester works
Identified new deliverables and objectives of the project
Discuss the improvements must do with the supervisors
Studied final circuit schematics diagrams done in previous semester.
2. Studied power circuit done in previous semester
3. Main circuit PCB Designs
4. Signal Processing (Arduino)
#include <MovingAverageFilter.h>
MovingAverageFilter movingAverageFilter(20);
MovingAverageFilter movingAverageFilter1(20);
MovingAverageFilter movingAverageFilter2(20);
float input;
float output;
float caltime;
float initialarray[2] = {0.0,0.0};
float currentarray[2];
float dy;
float dt;
float derivative_output;
float output1;
float initialarray1[2] = {0.0,0.0};
float currentarray1[2];
float dy1;
float dt1;
float derivative_output1;
float output2;
float output3;
float threshold=450.0;
int peakcount=0;
int k=0;
float peak = 0.0;
float time1=0.0 ;
float time2=0.0;
float time3= 0.0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
input = analogRead(A0);
float z = (5.0*input)/1023;
caltime = millis();
output = movingAverageFilter.process(z); // here we call the fir routine with the input. The value 'fir' spits out is stored in the output variable.
currentarray[0] = output;
currentarray[1] = caltime;
dy = currentarray[0]- initialarray[0];
dt = currentarray[1] - initialarray[1];
derivative_output = dy/dt;
initialarray[0] = currentarray[0];
initialarray[1] = currentarray[1];
output1 = movingAverageFilter1.process(derivative_output*150);
currentarray1[0] = output1;
currentarray1[1] = caltime;
dy1 = currentarray1[0]- initialarray1[0];
dt1 = currentarray1[1] - initialarray1[1];
derivative_output1 = dy1/dt1;
initialarray1[0] = currentarray1[0];
initialarray1[1] = currentarray1[1];
output2 = movingAverageFilter2.process(derivative_output1*150);
output3= output2*75;
if (k!=1){
if(output3 > threshold){
peak = threshold;
k= 1;
time1=millis();
}
}
if(k==1){
if(output3 < 425){
peak = 0.0;
peakcount = peakcount +1;
k=0;
time2=millis();
}
}
Serial.print(output3);
Serial.print(",");
Serial.println(z*127);
}