Can I use Arduino to record a signal?

Can I use Arduino to record a signal?

Or do I need to use a more general purpose computer to do the recording and then upload the data to Arduino?

I hope you know what you mean by 'signal' so is it possible you can describe this 'signal' for us ?

A PWM fan signal.

A PWM fan signal.

You can read a PWM fan signal, as a digital signal, learning when the square wave goes high and low, or as an analog signal (possibly needing a low-pass filter (resistor and capacitor)) to determine the perceived voltage level.

As for recording that data, how much? For how long? Where?

This kind of signal is best “recorded” by monitoring changes. Continually measure the frequency and duty cycle, send a notice down the serial port only when it changes.

When you say 'record a signal' did you want to save a bunch of data for future playback or analysis? Many Arduinos have very limited memory space

I'm thinking of recording the signal "as it is". I know of the memory limitations on the Arduino, thus why I was asking whether I should stream the signal to a general purpose computer and use e.g. pyserial for reading the data and Python for writing it to a file.


my particular confusion is about, whether Arduino can record and pass the data forward "as it is", because I've only used the pulseIn() function, which merely times the HIGH and LOW pulse widths.

Perhaps I need to use analogRead()? But the PWM pins aren't analog?

My confusion is also about the pulseIn() in the sense that I'm not sure how many bauds of sample rate should I use for passing it through the serial port and what kind of "timeout" (second parameter in pulseIn()). I believe these affect the resolution of what I'm able to capture.

my particular confusion is about,....

My confusion is a lot more basic.

What, exactly are you trying to do?
What is it that you want to record? "A PWM fan signal" is meaningless.
What is generating the signal that you want to record?

What is the purpose of recording it - knowing that will help us to suggest the most suitable solution.


I don't think it will be practical to send the pulse times at anywhere near normal PWM frequencies (hundreds to thousands of cycles per second, two transitions per cycle. Do you really need to know the length of each half of each cycle so you can reproduce the signal?