Monitoring HDD activity, can it be done?

I have a keyboard with an "extra" LED that has no use. It's currently interfaced with Teensy 2.0 and works fine. 3 of the four LEDs are Caps, Num, and Scroll Lock but the 4th had no use ATM.

I've also rearranged my desk so I can no longer see the HDD light on my PC case - I know I could direct wire but that would be messy, so I am wondering if there is a way in the Teensy code, to "poll" the computer for info on the HDD LED state?

I'm guessing no, but I did find out how to make the "locks" lights work by checking the bits of the keyboard_leds variable in usb_keyboard.h, so maybe??

(deleted)

The LED shows electronic activity on the disk drive control circuit. Even the lowest level of software, the drivers, know nothing about the LED, nor do they care. So, even if you had vast experience with WIN NT software you could still not determine the LED status.

Paul

If you use Windows, then you know that it is almost always thrashing the disks. So, if you assume that the HDD light is on, you are almost always correct.

What about using a photo-transistor or a light dependent resistor (LDR) to "watch" the HDD LED and, via your Arduino, make another LED blink?

...R

Given that for all sorts of reasons 'Windows' may access the hard disks at seemingly random intervals, why is it helpful to be able to view the HDD LED ?

My notebook often is blocked by disk activity, so that also for me the disk LED is useful information.

At the software level there must exist a disk usage API, for the Task Manager and similar tools.

At the hardware level some alternatives have already been posted, like sensing the HDD LED light or voltage.

Paul_KD7HB:
The LED shows electronic activity on the disk drive control circuit. Even the lowest level of software, the drivers, know nothing about the LED, nor do they care. So, even if you had vast experience with WIN NT software you could still not determine the LED status.

Paul

That's a bit of a "strict" interpretation of what I wrote. Some thing triggers that LED in, that something is commanded by the OS, therefore if you can tell what command caused the LED to trigger, and can monitor that command you can, in effect, tell the status of the LED.

I offer as example that there is at least one app that will put an HDD "light" in your status bar, and even flash a "lock" LED of your choice on the keyboard, but I don't like having such things running on my PC.

It is therefore obvious that ON THE PC, UNDER THE OS, it is absolutely possible - it therefore should be possible to have an applet running under Windows that sends messages to a USB connected device and cause some activity to occur.

My real intent was to find out if that could be accomplished WITHOUT having software on the host machine, in a similar manner as determining the LOCK LED status.

The LOCK LED is under full control of the OS. If you find equivalent messages for HDD activity, sent from the OS to the KBD, you can use these for the HDD light.

TG626:
That's a bit of a "strict" interpretation of what I wrote. Some thing triggers that LED in, that something is commanded by the OS, therefore if you can tell what command caused the LED to trigger, and can monitor that command you can, in effect, tell the status of the LED.

I offer as example that there is at least one app that will put an HDD "light" in your status bar, and even flash a "lock" LED of your choice on the keyboard, but I don't like having such things running on my PC.

It is therefore obvious that ON THE PC, UNDER THE OS, it is absolutely possible - it therefore should be possible to have an applet running under Windows that sends messages to a USB connected device and cause some activity to occur.

My real intent was to find out if that could be accomplished WITHOUT having software on the host machine, in a similar manner as determining the LOCK LED status.

Fair enough!
Do you have any memory reserved for disk cashing? Do you know how that is used? Access to the cash is for all disk reads and writes. IF the requested 4k disk block is not in the cash, an new 4k block is read for that data. If on writing a disk record that will fill a 4k block, that block is written. Those are the only times a physical disk access is made. There is NO other relationship between physical disk access and a programs file read/write.

Do you recall shutting down your computer with programs still running? You are usually reminded to shut down the programs so you won't loose the data that was written. I see WIN 10 has changed so the message to tell a program to shut down also flushes the disk cashes. Now we don't see the warning.

So, I don't see your reason for wanting to know about physical disk activity.

Paul