Pages: [1]   Go Down
Author Topic: How to operate a set of LEDs from an input  (Read 611 times)
0 Members and 1 Guest are viewing this topic.
Leicester, MA USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
Arduino newbie
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Thanks!
Logged


Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23743
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you going to make it like the Windows Task Manager, Performance tab kind of display?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Leicester, MA USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
Arduino newbie
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you going to make it like the Windows Task Manager, Performance tab kind of display?

That's exactly what I want it to do
Logged


Leicester, MA USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
Arduino newbie
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

bump
Logged


New Jersey
Offline Offline
Faraday Member
**
Karma: 48
Posts: 3417
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As KE7GKP says - start by trying to read the led pin (with resistor) into an Arduino input. Worry about the output and associated calculations later.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23743
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://arduino.cc/en/Reference/PulseIn

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: