Find the Mistake ;-)

Hello guys, my China Nano broke when I tried to fade an LED strip with a MOSFET. I connected it according to this circuit diagram

Bild

MOSFET is one IRFZ44N
LED Strip is 12 V, 2,55 A
DC Source with 12,048 V
China Nano V3 with Atmega328, CH340

This is the Sketch:


int ledPin = 10;

void setup() {
pinMode (ledPin, OUTPUT) ;
}

void loop() {
for (int ledval = 0; ledval <= 100; ledval += 10) { 
analogWrite (ledPin, ledval);
delay (50);
}
for (int ledval = 100; ledval >= 0; ledval -= 10) {
analogWrite (ledPin, ledval);
delay(50);
 }
}

Actually, it can't be the sketch, because it worked best with a single led.
I've looked at it hundreds of times, but can't find the error. I also checked the MOSFET, it works fine. Maybe someone can help me.

Please write in German in the German forum… moved to a better place.

—-

Are you powering your nano with 12v? (Hard on the regulator. the cheap east Asia clones use a AMS1117 and may be of poor quality )

What do you mean by "broke"?

This is how it looks like

By broken I mean burnt out.

Die 12V sind an den 5V Pin geklemmt.
Es muss aber an Vin

The 12V is clamped to the 5V pin.
But it has to go to Vin

Danke combie wie konnte ich das übersehen :man_facepalming:t2:

5 volts is on the other side of any regulator, so actually just plain hard on everything. :frowning:

a7

Is it worth to replace the CH340C chip?

Probably not. Unless you have a pile of them lying around along with a hot air gun.

I guess more things might be damaged after 12V on a 5V device...

Precisely as you would expect if you connect 12 V to the "5V" pin. :+1:

Did it not occur to you that connecting 12 V to a 5 V pin was not a sensible idea? :roll_eyes:

Actually, it turns out that connecting 12 V to "Vin" is not such a good idea either. The Nano actually operates on 5 V and you should power it with 5 V, either by a USB connection or to the "5V" pin and ground.

No, because you have destroyed the microcontroller chip as well, just not as spectacularly. This is not in any way in doubt.

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