Arduino Nano acting strainge when disconnecting from PC

Hallo,

I've build a project that set on certain moments different led strips to on and of, by setting digital ports to high and low. The led strips are powered via Vin (12v). When i don't connect the USB it looks like all leds ar glowing minimal. When i connect the Arduino to the computer it works fine as it should.

Therefor i thought to power the Arduino via the USB with a USB powerbank or other 5v powersource. This does not work at all. When i disconnect the USB the led strips are glowing again.

Can someone help me out?

Thanks a lot for you help.

Regards,

Edward

In an addition i’ve attached the configuration as i made it.

Any suggestions?

Arduino probleem (1).pdf (173 KB)

You don't have current limiting resistors for your LED.

Hello,

I my drawing, actualy the Leds are ledstrips with risitors on it. I don't think this is the issue, because when i use the USB from my pc it's working fine. This i use the pc for powering the Arduino Nano and a power adaptor 12v foor the ledstrips via Vin port.
When i put a powerconverter from 12v (same adapter) to 5v and power the USB port with this on the board it doen not work. When u use my phone charger (USB output) and connect this to the USB port it is working also fine.

Edward

I suspect that you have a fundamental misunderstanding of the 'internals' of the Nano board. Can you provide drawings for the different scenarios that you described.

Your Nano pins don't provide 12V (as you show in your drawing), they provide 5V (regardless what you put in).
2)
Providing 12V (on Vin) and USB power at the same time as you do in the current drawing is quite useless; the 12V will power the Nano.

===

How many leds per strip? Are those led strips 12V or 5V? A link would be useful.

You can only safely source (drive) around 20mA out of each of the pins (so that's about one led, maybe two leds), the maximum for the microcontrollers Vcc is 200mA and the maximum output current for the voltage regulator on the Nano is around 150mA (if I'm not mistaken).

The pins are giving 12v power output, as log as i connect the Arduino straight to a computer or phone charger. And a other power adapter to power the led strips via Vin. This works fine.
What does not work: Powering the leds with the same 12v poweradapter en the USB via a power converter that is connected to the same power adapter as the led strips.

Is it maybe due to the GND?

See attached picture

nijmedw’s image from post #5
737ce55b5e0a5ede1036444d6dd2a823f15fc6ce.png

You can not control 12V led strips from a 5V microcontroller. You will need something that can take 5V in from the microcontroller and handle 12V output; usually logic level fets (or transistors).

I’m surprised that your Nano is still surviving.

Hello Sterretje,

I don't get it. Besides the USB port to power the Nano, i thought it was possible to put 12v on the Vin port to feed this to the digital ports. When the Nano is connected to a USB powersource, it's works for more than a hour already.

How should it work with level fets or transistors?

The leds can only work on 12v, and the Nano board on 5v.

Thanks,

Edward

Search for arduino mosfet led. Just make sure that the mosfets are logic level (mos)fets.

One of the first hits

The 12V is not to power the outputs. It's an alternative to power the board. Vin goes through a small voltage regulator that creates 5V from it that powers the board.

So, if i understand it well, i have connect the + to the ledstrip and switch the ground with via the TIP120. That is a different approach than i had in mind.
But in this case there is still 12v going via the Nano board, or not ?

Sorry, i'm more a software developer than a electronical person :slight_smile:

Plus of led strip to 12V, minus of led strip to collector of TIP120. Emitter of TIP120 to ground. Base of TIP120 via a resistor to pin of Arduino.

You will need to calculate the resistor; a guide can be that the current through the resistor needs to be approximately 10% of the current that the strip draws. The current through the resistor may not exceed 20mA (the safe current that a pin of the microcontroller can deliver).

Note that transistors in this application can run very hot; it's better to use logic level fets. In that case you do not need to calculate the resistor, just use the value that was shown in e.g. the article that I linked.