Hi all! I'm trying to come up with a solution for a friend. He wants and LED meter for his HDD activity on his computer. Basically I want to know how I would go about taking the input form the HDD LED pin (3v) and read it with an Arduino so that the faster the signal is switched the higher the bar graph will go?
I would perhaps start with using the pulsein() command and see if you can get some readings, how wide the LED on pulses are and get a feel for frequency.
Then maybe map the duration of the pulse to how high up you make the bar graph display.
For example, if duration was <10mS, turn on one bar
11ms-50mS, 2 bars
51ms-100mS, 3 bars
101ms-200ms, 4 bars
201-300ms, 5 bars
etc.
Of course, that approach will always lag the actual performance.
Another approach might be to read the state of the input pin every 100uS, and as long as is it high for some amount of time, turn on a bar and if still high another amount of time turn on the next bar, etc. Then turn off all bars when the state is detected as off.