i want to use arduino as a automatic switch

i want to use arduino as a automatic switch that that short circuit two pins after a time (eg: 15 seconds ) :slight_smile:

i have 2 wires that are connected to 2 different pins on the arduino board and I need to short circuit them for 1 sec but it has to short circuit after 15 seconds when arduino is turned on , and i want to loop this

i need the code :wink:
ASAP , i need the code for my project by tuesday
. :roll_eyes:

another way without the relay,
by using a transistor or something that gets on after 15 seconds? and the transistor as a switch,,
the transistor has to be turned on after 15 seconds
all i need is the code

need the coding,

Help appreciated

You cannot use the arduino to connect wires together. It is not a switch.

You will need to connect a controllable switch (relay) to a single wire of the Arduino. When the Arduino pin is high (5V), it would close the switch, and when the Arduino pin is low, the switch would be open.

It terms of code, the millis() command tells you how many milliseconds have occurred since the Arduino has started. Also, the delay() command allows to to wait a certain number of seconds. You could use these commands to time things.

ps: You will not get this done by tomorrow. If this is an assignment for University, you should have started before today.

is there another way without the relay,
by using a transistor or something that gets on after 15 seconds? and the transistor as a switch,,

reply
thollu

Sure. You may be able to use a transistor, but if you just need to connect two wires together, that's a more complicated way to go.

can u help? :roll_eyes:

can u post the code ? :wink:

Sorry, no.

I have given you hints about what you need to look into. Assignments are given so that you learn. It would be unfair to others to post the answers for you.

it is not an assignment or a test, just a simple project ,i only need the coding,
please can u help :frowning:

Look at the functions I mentioned earlier. They are the functions you will need to do the timing.

The forum is here for people to help and guide you, not do your work for you, whether it's for University or not.

thollu:
can u help? :roll_eyes:

can u post the code ? :wink:

Do I get the diploma if I do the work?

arduinodlb:
Sure. You may be able to use a transistor, but if you just need to connect two wires together, that's a more complicated way to go.

Maybe not, it might be an AC signal.

FWIW, your "project" sounds very suspicious.

arduinodlb:
FWIW, your "project" sounds very suspicious.

Why?

To me it sounds like he's hacking a remote control, which has been asked a million times here.

fungus:
To me it sounds like he's hacking a remote control, which has been asked a million times here.

He is however, as is so common, failing the comprehension test which is - explain what you really want to do, rather than how you imagine you want to do it, but wouldn't be asking if you actually knew.

Hacking a remote control requires a transistor and a multimeter to figure out which way to connect it. Actually, much simpler - a 74HC4016 in which case you can do up to 4 buttons and don't care which way round to connect the terminals.

Paul__B:
He is however, as is so common, failing the comprehension test...

No argument there. This forum needs a great big sticky saying:

"Please tell us what you want to achieve, not what you're doing".

(Actually this applies to every tech forum on the entire Internet)

arduinodlb:
You cannot use the arduino to connect wires together. It is not a switch

Why not?..

The current should be limited via a resistor (or the button would short it out too) if so the arduino could indeed be used as a switch.