Arduino Nano connected to VIN and USB at the same time

Hi there

I'm new to Arduino and i'm currently trying to learn coding and microelectronics. Currently, i'm working on my first small project, a solder fume extractor, which requires a Arduino Nano 33 BLE Sense to control a 5V PWM fan.

Because the 5V PWM fan is drawing more Current than the Arduinos +5V Pin can provide (I think), i'm using a separate 5V Power Supply that supplies the fan as well as the Arduino on VIN.
Now to develop the program, i obviously need the Arduino connected to my PC via USB, which also supplies 5V to the Arduino. Since i also need the Fan for testing, i also need to power the fan, which in turn also powers the Arduino on VIN.
Now there would be multiple power sources connected to the Arduino. Is that a problem?

I tried to draw a diagram of the current setup, i hope that makes sense.

Thank you!

Disconnect Vin from PSU 5V while developing. Reconnect Vin when you're ready to put it in service and no longer require USB

4 Likes

Hi, @almondoalmondo

Connect the 5V from the power supply to the 5V pin, not Vin.

Make a USB cable with the red 5V wire cut, that way gnd and the two data wires are connected and the Nano33 is externally powered.

I made a cable with a box in the middle, 5V wire cut and the two ends connected to external terminals.
That way if i need to power a controller I just place a jumper across the terminals.

It is also convenient when wanting to measure current in the 5V supply.

Tom... :smiley: :+1: :coffee: :australia:

2 Likes

Hi @2112
Thanks for the suggestion. This is a valid solution for now, but i plan on soldering everything together and putting it inside a 3D-Printed case when i'm done, making it quite cucumbersome if i want to change the code or troubleshoot something using the computer. :slight_smile:

Hi @TomGeorge

Thanks for the suggestion! I didn't know that cutting an USB-Cable open to just use the data and ground lines was an option, but i guess it's a valid workaround.
I'm a bit surprised that the Arduino doesn't seem to be able to handle two power inputs at the same time, since it's not rare that an Arduino has a power connection soldered to the pins as well as other components inside a neat 3D-Printed casing. Under such circumstances you either need to design a way to break one of the power connections and even then, there is the danger that you might break the Arduino if you forget to disconnect one of the power sources.

If i may ask, what's the reason for connecting the power supply to the 5V pin over VIN ? I assumed the 5V pin was only for output.

Kind Regards :slight_smile:

Connect the 5V to the Vin pin and don't worry about USB, it has a diode that interrupts the current between Vusb and Vin when both are connected.
Check the documentation for the Nano 33. :wink:

3 Likes

HI,
From here.
https://docs.arduino.cc/hardware/nano-33-ble-sense-rev2/
Schematic;
ABX00069-schematics.pdf (1.5 MB)

I stand corrected, @MaximoEsfuerzo
But can't find the 5V pin.

Tom... :smiley: :+1: :coffee: :australia:

1 Like

D2 was added to enable the use of USB and external power at the same time.
In some boards the separation of the powers has some issues, so the general advise is not to rely on it.
In this case the diode seems pretty reliable.

2 Likes

This is a Nano33BLE SENSE, the pin is named VUSB, not 5V, the supply to VIN is correct.
Supply to VUSB might feed back into the PC and is not advisable.

3 Likes

I wonder how the fan reacts to a 3.3V PWM.

Also the input of the fan may or may not damage the output of the Arduino.

I can’t tell without more info about that fan.

1 Like

I didn't find it either but it's in the pinout.
I reviewed the schematics from: https://docs.arduino.cc/resources/schematics/ABX00031-schematics.pdf
Pinout from: https://docs.arduino.cc/resources/pinouts/ABX00031-full-pinout.pdf
Datasheet from: https://docs.arduino.cc/resources/datasheets/ABX00031-datasheet.pdf

It's funny that in the image pin 12 is marked as 5V but below, in the description of the pins it is named VUSB (same as in the schematic)

1 Like

I trust the schematics better than the rest of the documentation.

Designers and engineers use the schematics to build the board in several iterations and then hand over the stuff to the writers that may or may not have technical knowledge.

Furthermore, the datasheet contains contradictions while the schematics show some logic to me.

1 Like

Add a switch, .1 jumper hood, shorted connector or something to break the connection when needed.

You can have a USB interface port on your enclosure. Use a connector that shorts Vbatt to Vin when in use. Remove that connector and connect a modified USB cable that breaks the Vin connection.

That's extra effort for a what-if. Adding a small slide switch inside the enclosure would be the easiest. Open the box, slide the switch, update your code, move the switch back.

1 Like

Thanks for the feedback, everyone.

I should mention i got the "Nano 33 BLE Sense", without "Rev2".

I'm kinda scared to use VIN or VUSB/5V (Printed "5V" on the PCB) at the same time with USB, since its apparently not clear if it could damage anything. I could turn off the Power Supply, however i still measure about 2.2V when the PSU is "Off", which i suspect might be problematic when plugging in USB?

I guess i'm going for @2112's suggestion and just break the connection from Vbatt to VIN manually before plugging it in via USB.

It's this fan: NF-A4x20 5V PWM
PWM Spec: https://noctua.at/pub/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf

3.3V isn't really mentioned, so i think its designed for just 5V. However, it seems to work just fine with a 3.3V PWM signal, even at just 25 kHz.

Kind regards

Oh and i was wondering about the Tachometer output signal of the fan. Everything about this Fan seems to be 5V (https://noctua.at/pub/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf) . Could it damage the Nano if i send this signal to a Pin?

You must have a clone because it is marked VIN on the board.

From the nano documentation

The microcontroller on the Arduino Nano 33 BLE Sense runs at 3.3V, which means that you must never apply more than 3.3V to its Digital and Analog pins. Care must be taken when connecting sensors and actuators to assure that this limit of 3.3V is never exceeded. Connecting higher voltage signals, like the 5V commonly used with the other Arduino boards, will damage the Arduino Nano 33 BLE Sense.

All MOSFETs have parasitic diodes. If 5V is applied to an input/output pin of your processor, the diode in the P-MOSFET will conduct and may be damaged if the current is too high. A resistor will limit this current.

According to figure in the white paper with the open collector driving the input, the current from the pull up resistor in the fan is very low. I couldn’t find numbers in the datasheets, but that current is apparently so low that it won’t cause damage.

The tachometer output is an open collector, it needs a pull up resistor to work. As your processor works on 3.3V, you should connect it to the 3.3V pin, or you can use the pull up resistor built in in your processor.

Thanks for the feedback, but unfortunately i don't know a lot about electronics yet, so i tried to look up what an "open collector" and "pull up resistor" is, but i haven't understood it really.
But according to my research, if it's a 5V Fan, the tachometer signal will also be 5V when it is high, which apparently does damage the processor over time, no matter how short the signal impulse is.
Could i maybe use a resistor limit the current?
Thank you.

A transistor can work as a switch, on or off. (It can also be something in between, but that isn’t used here.) You are aware of the push-pull outputs of a microcontroller, that is two switches, one connects the output to the supply, so it can push current into whatever is connected to the output, the other connects the output to ground, so it can pull current from whatever is connected to the output. This has both advantages and disadvantages.

The open collector output is actually older and simpler. In the drawing above opening or closing the switch won't work, the input will remain at ground level. It needs a pull up resistor to work, literally pulling the input to a higher voltage.