Detect input DC 5v/9v

Currently I have a wireless kit that includes a transceiver and remote that turns on or off a single power plug. Attached to that is a DC 9v 950mA adapter.

That DC adapter can be turned on or off using the remote.

I am wondering if there is a way for my newly bought arduino to detect if that DC adapter is on or off.

Thank you and sorry if this question is too noob.

Thank you for such a simple and detailed reply.

So lets say I connected it the way you described, but without any sort of resistor, would that fry the arduino cihp? or at the very least, do damage that are permanent?

And what is the max voltage I can input into the digital pins at 1mA without damaging the board?

Also does it matter which side I connect the resistor to?

Thank you again and sorry for the noob to the extreme.

Ah, thank you very much of the in depth analysis.

The entire system consists of a wireless kit (key fob and the transceiver), DC adapter, arduino duimanlove and a motor control shield.

When I press ON button on the key fob, the transceiver responds by giving the attached DC adapter (9v 950mA) electricity. And when I press the OFF button on the key fob, the transceiver will stop giving the DC adapter electricity.

I would like arduino to somehow detect when the transceiver/DC adapter is turned on and rotate the motor attached to the motor control shield forward. And when the transceiver/DC adapter is turned off the motor will rotate backwards.

Sorry for giving all the information late, I thought I could save the people's time so I put in the minimum information possible.

Would that system be safe?

Once again, thank you for your time in reading, analyzing, and providing answers for a noobie.

The DC adapter in the system acts like a button. When electricity is passed through the DC adapter and into the arduino digital pin, it is on. When electricity is off, the DC adapter would have no electricity, and by reading the digital pin again, arduino will know it is off.

Oh, sorry. Before arduino, it was powering a motor that can directly get power from the adapter.

Thank you very much. And yes the adapter shows which is + and which is -.

Thank you for clearing up all my questions. =)

If there is no other load on the wall-wart, you might want to also put a 1K (~10 mA load) resistor across it to drain down the filter capacitor -- otherwise the filter capacitor may have enough charge in it to keep the arduino input pin high for a while after it is "off".

Attached to that is a DC 9v 950mA adapter.

Danger, Will Robinson!

Many 9V supplies are unregulated. Unregulated supplies produce a much higher voltage when not loaded.

Better solution: connect two 10K (or so) resistors like you were making a voltage divider. Connect the base of any old NPN transistor to the junction of the resistors, the emitter to ground, and the collector to a digital input (with the internal pullup enabled).

When the 9V is on, the collector of the transistor will be pulled low. When the 9V is off, the transistor is off, and the internal pullup of the Arduino will take the input high.

With this setup, you don't need to worry about how high the switched 9V supply voltage goes (well, unless there's a catastrophic failure that dumps raw AC into the output, or somesuch): the input to the Arduino won't go any higher than the Vcc on the internal pullup.

It's cheap, easy, and safe.

Sorry but I believe I have mis-led everyone about the use of the wall-wart (DC Adapter).

The function of the DC Adapter is to act like a button (ON and OFF). Nothing will be loaded onto this 9V 950mA DC Adapter. The whole circuit consists of only the DC Adapter going through the arduino.

When the DC Adapter has electricity passing through the arduino board, arduino would do the function ON. When no electricity is detected from the DC Adapter, arduino would do the function OFF.

As explained, I will connect two 10k resistors between the + side of the DC Adapter (9V 950 mA) and an Arduino digital input pin. Then connect the - side of the DC Adapter into the arduino ground GND. Or is there something else that I am suppose to do? Maybe in addition to this?

Thank you for picking me up from the lost sea. =)

xcow just said there was no other load, other than the Arduino input.

With no load, the 9V wall wart probably outputs 12V or more. You need to up the size of your current limiter to not less that 15K and you should have a resistor to present a 20mA or so load.