Hello. I have a project for my last semester and I need your help guys. I have to design and build an active power filter for harmonics. This project consists of two circuits. The power circuit consists of an inverter which is controled by the control system. I am using an "arduino due" for sampling signals from both the inverter and the control circuit. My problem is sampling with arduino. I tried the code below and tried to print the results with the serial port. Then I made a graph with excel and the output sigmal was very different from the input signal. So, what am I doing wrong? The photo shows the input signal which going to arduino.
CODE:
void setup()
{
Serial.begin(9600);
analogReadResolution(12);
}
void loop()
{
Serial.print(analogRead(A0));
Serial.print("\n");
}
I haven't tryied this serial speed. I 've tried 14400 and the result was something like chinese, I don't know how to explain it. So I thought that increasing the speed is meaningless.