make arduino complete a circuit from a different source

I need my arduino uno to complete a circuit from another source but only if it is receiving a certain voltage. Sorry if this has been asked before or if this posted in the wrong section. I am fairly new to arduino so i apologize if this is a stupid question :slight_smile: :wink:

I think we need a more detailed description of what you are trying to do.

A relay is an electrically controlled (and electrically isolated) switch, so a relay can be used to switch a “different circuit” such as power line voltage.

The Arduino can sense/read voltages between 0 and 5V, and your software can “make decisions” based on this voltage. If the voltage is higher, you can us a voltage divider (2 resistors).

I want to use the arduino as a switch to complete a circuit but only if it receives a greater than or equal to x voltage

ali10163:
I need my arduino uno to complete a circuit from another source but only if it is receiving a certain voltage.

DVDdoug:
I think we need a more detailed description of what you are trying to do.

ali10163:
I want to use the arduino as a switch to complete a circuit but only if it receives a greater than or equal to x voltage

That's just your opening post worded slightly differently; it adds no info for us.

i am using a dc motor to generate the voltage i need it to go through the arduino and complete a "different circuit" and the voltage must be greater than or equal to the voltage. I do not know how to explain better

what voltage is the dc motor, and what voltage is the different circuit?

i am just using the dc motor to generate the voltage that makes the arduino complete the circuit. The other circuit operates at around 20v

And eventually you will disclose what voltage the dc motor will generate?

But assuming it’s <5 or can be divided to <5, just analogRead() it and compare the reading to 1023 (ie 512 will be 2.5V etc). This code shows how that’s done with a pot; your input will replace the pot’s centre wiper, and you’ll need the other side of the motor to Arduino ground.

If the if test passes, or fails, control a digital pin to open or close a relay perhaps through an optoisolator. Some relay cards have optoisolation built in.

So basically it’s as pointed out in Reply #1.

Btw I'm not qualified to say if it's wise to connect a motor working as a generator direct to an analog pin- I don't know if there are spikes and such. Others will be better able to comment. Maybe some other components are required, I can't say.

The voltage the motor generate varies depending how hard the the motor is going to be working but it will probably around 5v to 10v

i need it to receive a voltage that is greater than or equal to 7v

Well if it can go up to 10V you could use a divider with equal resistors to halve that. Then 10V will actually be 5V and show up as 1023 with an analogRead(). Then 7V will be halved to 3.5V and show up as 716. Use that as the threshold in an "if".

This what DVDDoug actually said right at the start of this thread.