Can I make an Arduino nano work like a relais

I am thinking of using the Arduino nano, that reading a signal from his analog input, and sometimes send this input as it is to the output, and sometimes to cut it....

So why I don't use a relais you may think. The problem is that I have made all the connections to the project in the box, and there is no space, I will have to rebuild it, something I want to avoid...

So can I use the Arduino nano's pins as relais?

Thank you....

No, it won't work like that. You will have to either use a relay or a transistor.

Ok relais, I understand it, but transistor? How can this work?

Research 74HC4066.

Paul__B:
Research 74HC4066.

Can it support up to 5 kHz signal? I mean, I won't have any problems with distortion, slew rate etc, right?

The output pin of any of the Arduino boards is minimal you should not pull more than a few milliamps how much power are you looking for on the output?

alex5678:
Can it support up to 5 kHz signal? I mean, I won't have any problems with distortion, slew rate etc, right?

This is the first you mention these requirements. Please do not waste other people's time. If there are more details and requirements please get that out now before anyone else wastes time talking to you without complete information.

So what are you trying to do, really?

Just relay a signal?

Switch the power to some other device?

5 kHz as such is no problem but there are different approaches, depending on the actual requirement. An electromechanical relay is anyway out if you're looking at a 5 kHz on/off signal, they're far too slow for that.

alex5678:
Can it support up to 5 kHz signal? I mean, I won't have any problems with distortion, slew rate etc, right?

I think everything you asked for and need to know is in the datasheet that was provided in reply #3.

alex5678:
I am thinking of using the Arduino nano, that reading a signal from his analog input, and sometimes send this input as it is to the output, and sometimes to cut it....

Coming back on this again, trying to understand what's going on.

You have an analog signal, when it's above a certain value switch on the output, when it's below a certain value switch off the output, right?

If so it sounds what you need is a comparator (either dedicated or OpAmp wired as such) for triggering on/off around a rather specific voltage, or a Schmitt trigger, which has hysteresis built in so you get a bit less spurious switches. You may need an amplifier and/or voltage divider to get to switch at the desired level.

Then the output signal can in turn be used to switch a transistor or MOSFET to switch power to whatever load you want to switch, if needed.

Sorry for the delay...

I have an input with signal 1, I want this signal 1 to go to output as it is, but sometimes I want the signal 2 go to output (produced by Arduino) and when signal 2 exists on the output, signal 1 does not exist on the output. And when signal 1 exists on the output, signal 2 does not exist on the output.

Please see attachment...

Thank you

So what is the exact nature of this input signal? You only mentioned analogue and 5 kHz.

wvmarle:
So what is the exact nature of this input signal? You only mentioned analogue and 5 kHz.

Signal 1 is from telephone line...300Hz - 5000Hz,
Signal 2 is a signal produced by the Arduino...

Also, I want to ask this: If I set a pin of Arduino nano as OUTPUT, and I send 5 Volts to this pin from another circuit, could I cause any damage to the Arduino/pin?

Thank you...

alex5678:
Signal 1 is from telephone line...300Hz - 5000Hz,

That is a voice signal or the ring signal?

How do you plan to turn this in a 0-5V signal the Arduino can read? Phone lines produce pretty high voltages, 50-80V or so.

In what way does this have to be relayed? Exactly as is, or does the presence of a signal on that input have to produce a digital output signal?

What is this "signal2" supposed to be?

What is on the listening end of this "Signal1/Signal2" output?

Also, I want to ask this: If I set a pin of Arduino nano as OUTPUT, and I send 5 Volts to this pin from another circuit, could I cause any damage to the Arduino/pin?

Yes - that 5V is not the same as the Arduino's HIGH 5V output so the two voltages will fight each other. If the Arduino's output is set to LOW it's even worse. At the very least you should add a current limiting resistor (at least 250Ω to limit the current to a safe 20 mA, but depending on what you're really trying to do you may want to increase that value to 10k or more).

I'm assuming that these two circuits share grounds.

OK, enough of this dragging information out bit by bit. Why don't you just give the COMPLETE picture now?

alex5678:
Signal 1 is from telephone line...300Hz - 5000Hz,
Signal 2 is a signal produced by the Arduino...

Also, I want to ask this: If I set a pin of Arduino nano as OUTPUT, and I send 5 Volts to this pin from another circuit, could I cause any damage to the Arduino/pin?

Thank you...

the correct answer is that we cannot know. you have withheld information on power.
what is that 5v signal ? if it is a 1mA signal from some sensor or other device, then the Arduino will damge THAT device.
if it is a 200mA signal then it will damage the Arduino.
again, what power levels are to taking about. So far nothing makes any sense because the complete information has not been presented.
if you want to isolate the two circuts, that is easy to do.
if you have low power signals, you need to know what will happen on each end when it is brought high or low while it is low or high.
the specs of the arduino are plain and simple. each pin has a power limit for supplying power or receiving power.

I upload a better attachment. I believe I should use 2 buffers for not inputing the sinusoid signal back to the A,B pins of the Arduino...

The relais is controled from the nano. So I need sometime to have the sinusoid signal on the output C,C', and sometime to ouput the PWM (produced from the Arduino) on the output C,C'...

What do you believe?

Thank you...

This poster either needs to come on out with all the details of what he is building and stop trying to play coy with us or he needs to move on and forget it. There's no way we can help with this vague handwaving of a description. Right now he is just wasting our time.

OP: You need to tell what you are building. Not this vague notion of signal 1 and signal 2. But actually describe what this is and what it is supposed to do. Give us the big picture, non-technical description. Maybe from that we can figure out what it is that you really want or need.

8d3b25cec5bf2408bddb6b103cd483ee2bd0edd0.jpg

Sadly this is if anything, worse nonsense than the original attachment (below)!

412ab07153a346d7cbd0e1b4b35ff8d2f564083f.jpg
In summary, clearly you have no idea what you are doing. Yes, the "XY problem" yet again!

Fascinatingly enough, the people here actually "get their kicks" from solving problems for others. It is just one side of human nature. But it is frequently like herding cats!

The only vaguely specific mention here, is a "Signal 1 is from telephone line". Despite your terrible ability to describe your problem, it seems you wish to alternately send the audio from your "telephone line" or a tone from the Arduino, to another device. And you do not comprehend the intricacies of this requirement.

The most revealing requirement is not "technical" at all. You need to reveal the purpose of the project - why you want to do it at all. Most of the technical aspects will actually "drop out" of knowing the answer to this crucial, "non-technical" question. :astonished: