For a short period of time yea.. I guess it's necessary for developing the circuit. Don't wanna solder everything together before it's not 100% working.
I put them in there to get from 9V to 5V for the LED strip and LED chain. When I tried to run the mosfets and transistors with 5V I had some voltage drop over them which lead to them not being fully open/saturated. Maybe with the new IRFZ44Ns I've ordered it will also work with 5V.
However, there is no battery combination to get to 5V.. so either 4.5V or 6V which won't work with the Arduino... Also the laser is rated for up to 6.6V so why not give it full power.
I've just added another mosfet to drive the motor/vape but can't seem to get any movement out of it... D10 to GND reads ~5V so the mosfet should open(at least partially) but motor (+) to GND only reads some 500mV. I've noticed some 400mA rise at the PS tho
Motor+ is also BAT+, per your schematic, so if you're truly measuring BAT+ to GND and getting 400mV, I restate, your circuit has a serious problem.
Place the (-) lead of your meter on the actual, physical (-) terminal of your battery holder.
Now place the (+) lead of your meter at various places along the supposed-to-be-ground, looking for where the meter voltage jumps from negligible to significant. There's your problem. Fix it, then repeat the measurement until you've checked every ground connection and verified that none exceed 0.1VDC, or thereabouts.
Use a DMM and check the continuity of ALL your jumper leads.
What voltage do you measure between Motor + terminal and the Batt + terminal?
Put red probe on Batt + and black probe on Motor +.
THEN
Put red probe on Motor + and black probe on gnd.
When I do this, I get readings between ~300mV and ~500mV.. seems like the breadboard isn't the best conductor...
Nevertheless I've just rebuild the whole circuit with different wires, different switches and a new arduino again. Looks much cleaner now for you guys to understand
Result is the same though... everything kinda works. That means I get very "rough" animation of my LED chain which is supposed to have a smooth breathing effect (could be software related too, although it worked at the beginning).
Also the motor/coil won't work, I've measured Drain-Source voltage while inactive and I read 8.6V. When I press the button I get ~6.7V so the motor is only seeing 1.9V right? That means the mosfet isn't fully open.
The Laser animation works perfectly smooth, even though the laser is very dim...
So I deduce from all this, that the FETs are the cause of all evil.. and ofc the wrong motor connection to D8 at the beginning which led to everything lighting up.
I get the better mosfets tomorrow I think, so maybe they solve the issue. I'll keep you updated.
Ok guys, it's been a few days but my new IRFn44z mosfets didn't arrive till today.
So I put them in the circuit and nothing new happened... I ran a small test program on a seperate nano that would just switch the mosfet on and off and suddenly the motor worked. Not quite as fast as I'd like but at least I can confirm that the mosfets work.
Soon I could smell something like hot plastic and I touched the mosfet and burned my finger
Also when I run the full circuit I can notice a small hum at the motor even without a signal to the mosfet.
I think the mosfet isn't really opening because the arduino is just too slow and kind of "stuttering" when I run the "big" program. I had to write the code only using if-conditions and managing loops with time measurments because there can't be any "for" or "while" loops in the code because it would interrupt all other LED animations, similar to a delay(). So I guess there is just too much to go through in each main loop which also made the LED strip stutter / blink instead of transitioning smoothly.
First of all I just observed that when I let the circuit run for a minute without doing anything, eventually the mosfet gets super hot and the motor is slowly starting by itself.
Running: 4.2V
Not running 16mV
Running: 4.3V
Not running 23mV
After doing this I can now hold my button and the motor will spool up very slowly, while the mosfet is getting very hot again.
Here is the code I run for the motor and LED only tests.. not the full code but the important lines are the same:
It's an IRFZ44N... I know it has a VgsThresh. of min. 2V - max. 4V so it's barely fully saturated at 5V output and the gate resistor. Should have used IRLZ44N... However, I'll get small mosfet driver modules today with a VgsThresh. of min. 1.7V - max. 2.7V.
They've just arrived. I wired them up and voilà.. they work perfectly. So it really was a matter of getting the right mosfet for the job.
Now I only have to fix the problem of stuttering LED animations.. I think I might just split the circuit into two and use two arduinos for smoother animation.