# Open Relay when USB connected

**URL:** <https://discourse.agopengps.com/t/open-relay-when-usb-connected/870>\
**Category:** PCB\
**Created:** [23 January 2020 08:13 UTC](https://discourse.agopengps.com/t/open-relay-when-usb-connected/870 "2020-01-23T08:13:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juliennorth](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@Juliennorth](https://discourse.agopengps.com/u/Juliennorth)\
**Post date:** [23 January 2020 08:13 UTC](https://discourse.agopengps.com/t/open-relay-when-usb-connected/870/1 "2020-01-23T08:13:09Z")

</div>

Hello,

I am finlasing PCB V2.  
Wuld it be possible that the big relays activates when USB is powered instead of using a switch ?

Thx

---

<div class="post-metadata">

**Author:** ![Larsvest](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/l/50afbb/32.png) [@Larsvest](https://discourse.agopengps.com/u/Larsvest)\
**Post date:** [23 January 2020 12:44 UTC](https://discourse.agopengps.com/t/open-relay-when-usb-connected/870/2 "2020-01-23T12:44:38Z")

</div>

Someone made this drawing. In your case Digital out(s) would be the 5v pin on the arduino.  
But you must cut the 5v supply from pcb to nano, else the power will not turn off again, when you take out USB.  
I think the D3 on pcb does the D1 job in this schematic.  
Text beneath belongs to schematic:

You need a diode across the relay coil to handle back EMF or you may destroy the transistor. Ignore the LED in this picture

[![enter image description here](https://discourse.agopengps.com/images/transparent.png)](https://i.stack.imgur.com/EY82R.png)
