Arduino Nano only works while USB connected

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 :thinking:

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.

Hi, @NineCookiez

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.

Thanks... Tom.. :grinning: :+1: :coffee: :australia:

160mV

8.6V

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 :slight_smile:

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.

Apropos of not a lot, maybe, but those look like good breadboards.
(The type with the clear base seem to have rows with contacts askew and so on.)

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 :triumph:

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. :roll_eyes:

Hi,

  1. What voltage do you measure between the MOSFET gate and source when the motor is running and when it is supposed to be not running?

  2. Put a 10K resistor between the MOSFET source and gate.

  3. Do step 1. again.

Have you written some SIMPLE code to JUST turn the motor ON then OFF then ON etc?

Can you please post your code, as at the moment I am not convinced you code actually turns the MOSFET OFF or just goes to a very small PWM value.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

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:

#include "FastLED.h"

int BUTTON_SMOKE = 8;
#define SMOKE_PIN 10
#define NUM_LEDS 120
#define DATA_PIN 4

int brightnessStep = 0;
uint16_t brightnessScale = 150;

CRGB leds[NUM_LEDS];


void setup() {
  delay(2000);
    
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(255);
  
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(BUTTON_SMOKE, INPUT_PULLUP);

}

void loop() {
  
   int readingSmoke = digitalRead(BUTTON_SMOKE);

   if(readingSmoke == LOW){

      analogWrite(SMOKE_PIN, 255);
      
   }else{
      
      analogWrite(SMOKE_PIN, 0);
      
   }

    uint8_t brightness = inoise8(brightnessStep * brightnessScale, millis() / 10);
    leds[brightnessStep] = CHSV(HUE_GREEN, 255, brightness);
    if(brightnessStep < NUM_LEDS){
      
      brightnessStep++;
      
    }else{
      
      brightnessStep = 0;
      FastLED.show();
    } 
    
}

Hi,
Thanks for the info.

Now,

  1. Measure the voltage between drain (+) and source(-), with gate turned OFF.

  2. Measure the voltage between drain (+) and source(-), with gate turned ON.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

8.7V

4.7V and dropping over time

seems like it gets lower the hotter the mosfet gets

That means that the mosfet is "opening" too slow right? but why?

Hi,
You should have less than 0.5V between drain and source with the gate turned on.

The MOSFET is not saturating and so power is being lost in the MOSFET, thus heating it up.

What is the part number of your MOSFET?

Thanks... Tom... :grinning: :+1: :coffee: :australia:

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.

You are proving that the IRFZ44N is not doing the job.
Get a Logic level MOSFET and that will work better.

What driver modules?

Tom.. :grinning: :+1: :coffee: :australia:

they are using this mosfet:

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. :grin:

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.

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