Can I use DC power to act as a switch without having to use any transistor?

Hello awesome community,

I'm wondering if I can use just DC power supply as a input signal to act as a switch
ex: Send a SMS once power is down.
So without having to use a transistor to do the switching work I wonder if I can use just DC power to detect switch status
can I?

It's not absolutely clear what you are asking. But I think the answer is yes. If the DC power supply is 5V, you can connect it directly to an Arduino input pin (assuming a 5V Arduino). I assume the Arduino will be powered by a battery so that it can send this SMS? A common ground will be needed between the battery and the power supply.

If the input will be floating (not connected to a known state) when the DC is not connected, the input will need a pulldown resistor or false readings will be possible.

1 Like

What is want is to use grid power converted to DC to power the Arduino at the same time use that same power to act as a switch
ex: DC power will be use as an input signal lets say pin No:2 so once grid power is no longer supply to pin 2 Arduino will send a SMS (drawing power from the battery pack)

If I can do that how the input will be?
So far I have use (INPUT, INPUT_PULLUP, PULSEIN) non of that has work

If I can do that how the input will be?
So far I have use (INPUT, INPUT_PULLUP, PULSEIN) non of that has work

Post your schematic. INPUT should work. As @groundFungus says, you will need to attach an external pull-down resistor to the Arduino digital input pin.

In this I am still using a external switch at the moment (Pin:2 and GND)

Just found out that the board is not function well when I connected to external power. so that's why. Anyway thanks guys.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.