I want to turn off/on a 12 V LED strip using a tilt sensor (not a module, just the balls sensor), connected to an Arduino Uno. IRF 520 module as a switch.
To check, I mounted a regular Yellow diode + 100 Ohm resistor in place of the LED strip.
The code is the one from the example Arduino IDE - Button.
Schematics attached.
To my suprise, it works! There is no bouncing, no unexpected stops nor flickering.
The 10K resistor seems in the wrong place, there is no common ground between the 2 sources (4.3 and Uno's own). But it works: when I move the tilt in upright position, the yellow diode lights,when I tilt it down, the LED turns off - as planned.
Why this schematics does work, please?
Thank you very much!
Schematics never work. If the built circuit works i would say it depends on exactly how you have wired it. I agree the 10K resistor is in the wrong place, certainly not as described in the Button example.
I'm more surprised that an IRF520 works reliably. After all it's not a logic level MOSFET.
Steve
That is the schematics of the circuit I built.
Wired circuit in attached pictures.
It is OK for now, but I am concerned about the moment I will attach the 12 V LED strips and the respective 12 V power source.
Double check.
My drawing was wrong, not my circuit. I am a stupid.
Correct drawing attached.
+++
Concerning not need to wire the common ground, I discovered that the IRF module does it internally. My module is marked MH and has no LED on board, but I assume it is pretty much similar to the the one I discovered.
I hope that this time is OK. I am going to attach my 12 V LED strips. Light or smoke? :-). I shall see.
Light!
The circuit works as planned, IRF520 module command the 12 V LED strip.
The Pb battery provides 13.8 V (measured), the Arduino Nano is powered by the laptop USB.
I am going to advance from the bench prototype to real-scale wiring, soldering, cutting.
+++
Next project: accelerometers + Lilypad Arduino USB + LEDs = dance costumes. Happy kids (I guess).
Don't touch your IRF520 when using it for some time, it's bound to get hot. 5V at the gate is not enough to properly open that MOSFET.
Use a logic level one, such as the IRL520 or IRLZ44N. Note the IRL prefix rather than the IRF prefix. Those open properly at 5V.
@wvmarle
Thank you!
That IRF is on the module I got - it has screw-connectors, which are very handy. I will mount a heat sink - do you think will be sufficient for 3 minutes lighting?
In fact, if it melts - no big deal (very cheap), but there are many kids around - I do not want to scare them (although in my humble opinion they may enjoy smoke :-)).
+++
I searched for a simple schematics to command my LEDs strip from Arduino (tilts, accelerometers)- not lucky: most are designed for RGB.
Command LEDs using a Lilypad by accelerometers- that is the other component - I will kindly ask for advise in the project advise section of the forum, because I only find complicate projects.
[OT - I do not understand why people complicate things so much/]
I am a bit under pressure, for my "happy kids" session is this Friday. I will work harder to follow your advise : better MOSFET, for the next session.
I am also thinking to use a relay module to command my LEDs.
The IRF520 should work at 5V for small currents, 1-2A maybe. How much heat you get depends on the load.
4m Red LEDs Strip- my guess is a total of 5 W /m x 4 m = 20 W. At 12 V -> 1.7 A (roughly).
This is a "stage" set-up, to flick in the beat of the music, for some 2-4 minutes once in 30 min.
Command the LED strips by a Lilypad USB operating at 3.3 Vm through a MOSFET - I guess it is not possible then?
falexandru:
4m Red LEDs Strip- my guess is a total of 5 W /m x 4 m = 20 W. At 12 V -> 1.7 A (roughly).
Don't guess. Check the specifications of your specific strip, and know the actual current they need..
Command the LED strips by a Lilypad USB operating at 3.3 Vm through a MOSFET - I guess it is not possible then?
Definitely possible - but not with that MOSFET. You may try the IRLB8721PBF or the IRLB8723PBF, that's the only MOSFET that I'm aware of in TO-220 (or any through-hole package) that I'm aware of that may work with 3.3V. Note: may work, for smallish loads (<5A) the datasheet does not give RDS, ON values for VGS < 4.5V.
Alternatively you have to go for SMD MOSFETs. There are several in SOT-23 package that work fine with 3.3V, such as the IRLML2502 and the PMV16XN. The first can switch 4.2A, the second 8.6A.
I am looking for simple solutions- then I better give up command by Lilypad and MOSFET and keep the current NANO (5V) setup.
The LED strips - apart from "5050" and "not more than 5 m when used in DV circuits" I could not find any other mention on the package.