I have an school project in wich I have to measure and print the frequency , low voltage and high voltage of an square wave signal like the one in the image. I searched the web and i find lots of codes and examples for frequency measurments but i don't know how to do the low and high voltage measurments . The signal frequency is about 400 Hz . I am using a arduino uno v3 board.
Please help me find a way to do this measurments , thank you.
Do you know how to measure voltage with the Arduino's analog-to-digital converter?
Do you understand the relationship between frequency and time?
Do you know how to measure time in milliseconds or microseconds? Or, how to find the time between two events?
I searched the web and i find lots of codes and examples for frequency measurments
The idea of programming isn't to copy the solution from someone else.... The idea is to apply what you've learned to solve a new problem.
Take it one step at a time... Measure voltage & find the high voltage.... Find the low voltage... Find the timing & frequency...
P.S.
HINT - With the default 5 Volt reference, the Arduino's 10-bit analog-to-digital converter maxes-out at 1023 with 5V, and it will read 512 at 2.5V. (That's assuming no error and a perfect 5V power supply... In the real world it might be a few counts off.)
HINT - At 400Hz, one full-cycle takes 1/400th of a second. That's 0.0025 seconds. (It will be helpful to convert that to milliseconds or microseconds.)