# Relays and Mosfets

**URL:** <https://forum.arduino.cc/t/relays-and-mosfets/909219>\
**Category:** Motors, Mechanics, Power and CNC\
**Created:** [September 26, 2021, 2:16pm UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219 "2021-09-26T14:16:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarvesh3121](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sarvesh3121/32/374244_2.png) [@sarvesh3121](https://forum.arduino.cc/u/sarvesh3121)\
**Post date:** [September 26, 2021, 2:16pm UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/1 "2021-09-26T14:16:29Z")

</div>

My Ebike motor controller has two wires for which are 5V when measured  
When short them my controller is switched ON  
I want to use arduino to switch it on off.  
What type of relay should i use for this or will be done without a relay as it is 5V?

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [September 26, 2021, 2:33pm UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/2 "2021-09-26T14:33:22Z")

</div>

Could You make a little drawing, schematics, and post it?  
Connecting two 5 volt, likely by pullup resistors, makes no sense.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [September 26, 2021, 4:44pm UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/3 "2021-09-26T16:44:19Z")

</div>

Is one of the wires connected to chassis Ground? If so, connect the OTHER wire to an Arduino pin. Use HIGH for 'not connected' and LOW for 'connected'.

Be sure that the Arduino ground is connected to chassis Ground.

---

<div class="post-metadata">

**Author:** ![DVDdoug](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dvddoug/32/671533_2.png) [@DVDdoug](https://forum.arduino.cc/u/DVDdoug)\
**Post date:** [September 26, 2021, 5:09pm UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/4 "2021-09-26T17:09:13Z")

</div>

> [@sarvesh3121](#):
>
> When short them my controller is switched ON

Is there normally a regular switch?

> [@](#):
>
> I want to use arduino to switch it on off.

A relay is an electrically-controlled and electrically-isolated switch so it's the most foolproof way to replace a switch in an "unknown" circuit.

The Arduino can't directly drive a relay coil so the easiest solution is to buy a relay board that has a driver circuit built-in.

---

<div class="post-metadata">

**Author:** ![sarvesh3121](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sarvesh3121/32/374244_2.png) [@sarvesh3121](https://forum.arduino.cc/u/sarvesh3121)\
**Post date:** [September 26, 2021, 7:47pm UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/5 "2021-09-26T19:47:33Z")

</div>

I've hooked up a relay now but the problem is the relay is constantly on and not switching LOW.  
I'm using basic digital write command to switch the relay

---

<div class="post-metadata">

**Author:** ![slipstick](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@slipstick](https://forum.arduino.cc/u/slipstick)\
**Post date:** [September 27, 2021, 6:50am UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/6 "2021-09-27T06:50:17Z")

</div>

Then you've not connected it correctly or your code is wrong. If you post the code and a simple connection diagram it may be possible to help but I'm not good at guessing what you might have done.

Steve

---

<div class="post-metadata">

**Author:** ![anon35827816](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anon35827816](https://forum.arduino.cc/u/anon35827816)\
**Post date:** [September 27, 2021, 6:53am UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/7 "2021-09-27T06:53:02Z")

</div>

> [@sarvesh3121](#):
>
> I've hooked up a relay

Just a relay, or a relay _module_? Please show a picture/link.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 26, 2022, 6:53am UTC](https://forum.arduino.cc/t/relays-and-mosfets/909219/8 "2022-03-26T06:53:57Z")

</div>

Closed on March 26, 2022, 6:53am UTC

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