the arduino listens for a specific program that is running on my windows system.
When that program is running it will switch the HDD on, and when the program is no longer running. The arduino will then power off.
Unless the program is designed to do something that specifically talks to the Arduino down a serial port then there is nothing the Arduino can "listen to".
Are you sure you want to mess with that.Is this to lower power usage or to try to make the drive last longer.Windows has user configurable drive sleep settings. External drives also have programmed sleep settings. Note that mechanical drives not only have a limited amount of running hours, but also a limited number of start/stops.Maybe better to invest in a Solid State Drive.Leo..
I suspect it would be hard to find a better way to cause the PC to crash. Leave it to the PC to manage its own disks....R
Even tho the drive is in a hot swappable bay? I have not had any issues with windows when powering on an of the drive by the hot swap bay.
Maybe program the Arduino to drive a servo to push the switch on the hot-swap-bay?...R
I could do that, but it would look untidy to me.
You seem to have inadvertently provided some information that is at variance with your Original Post which said "I like to add a power switch to a HDD". I think it was reasonable for me to assume that there was no existing switch.But now it appears that there is in fact an existing switch that could be operated with a servo.It is much easier to make sensible suggestions when you provide full information....R
I did not include that information for a reason, because I don't want the arduino to control the drive by a physical button on a drive bay. As this would not meet the aesthetics.