How to check if computer is turned on

lets say when a computer is turned on, its usb port's got power, when it's off, it's usb port doesn't have power.

what do i exactly have to do, to find out whether my computer is on using an arduino? which wires do i connect to the arduino ports (and to what type ports) and how do i program it to find out whether it's got power or not?

thank you :slight_smile:

mouthfulofchocolate:
lets say when a computer is turned on, its usb port's got power, when it's off, it's usb port doesn't have power.

what do i exactly have to do, to find out whether my computer is on using an arduino? which wires do i connect to the arduino ports (and to what type ports) and how do i program it to find out whether it's got power or not?

thank you :slight_smile:

power it with the USB port?

mouthfulofchocolate:
what do i exactly have to do, to find out whether my computer is on using an arduino?

You could buy one of these USB Mini-B Breakout and a USB lead,
then get one of these: Opto-isolator Breakout

Connect GND, 5V from the USB board to GND, IN1 on the opto board.

Then connect HVGND to Arduino GND and, HV to +5V and OUT1 to an input pin on your Arduino.

Then look at the Button Tutorial

Turning on and off your computer will be like pressing a button.

Yours,
TonyWilk

what do i exactly have to do, to find out whether my computer is on using an arduino?

How is the Arduino powered ?