Addressable LED strips and power supplies

Wondering if anyone has had any similar issues with getting sketches to run on an Arduino Nano. I have some simple code just to do little light chases and the like (mostly bits of copied Neopixel libraries). The code does what I want and I'm really just using trial and error to learn the language in baby steps.

My problem is this: I can run the code and have everything behave but ONLY if I have the Arduino plugged into a mini USB cable. I normally use a robust 12v power supply but the code hangs up and gets really glitchy unless that USB cable is plugged in. It does NOT need to be plugged into a computer but if it's not plugged into the USB in some manner it will stop and freeze up at some point of in the sketch. This is the code I'm running below (one of them anyway). I have similar problems with anything I try on these strips regardless of how much current I draw. Less lights doesn't solve it. Is this normal?

#include <Adafruit_NeoPixel.h>

#define BUTTON_PIN   2  
                      

#define PIXEL_PIN    6 

#define PIXEL_COUNT 60
#define horn 12


Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);

bool oldState = HIGH;
int showType = 0;

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  strip.begin();
  strip.show(); 
}

void loop() {
  // Get current button state.
  bool newState = digitalRead(BUTTON_PIN);

  // Check if state changed from high to low (button press).
  if (newState == LOW && oldState == HIGH) {
    // Short delay to debounce button.
    delay(20);
    // Check if button is still low after debounce.
    newState = digitalRead(BUTTON_PIN);
    if (newState == LOW) {

  }

  // Set the last button state to the old state.
  oldState = newState;
  }
}

void startShow(int i) {
  switch(i){
    case 0: colorWipe(strip.Color(0, 0, 0), 20);    // Black/off
            break;
    case 1: colorWipe(strip.Color(255, 0, 0), 20);  // Red
    digitalWrite(horn, HIGH);
    delay(3000);
                colorWipe(strip.Color(0, 0, 0), 20);    // Black/off
                colorWipe(strip.Color(255, 0, 0), 20);  // Red
                colorWipe(strip.Color(0, 0, 0), 20);    // Black/off
                colorWipe(strip.Color(255, 0, 0), 20);  // Red
                colorWipe(strip.Color(255, 0, 0), 20);  // Red
                colorWipe(strip.Color(0, 0, 0), 20);    // Black/off
                colorWipe(strip.Color(0, 0, 0), 20);    // Black/off

}

}

It does NOT need to be plugged into a computer but if it's not plugged into the USB in some manner

I assume it's plugged into a power supply, if not the computer? The other end of the USB cable isn't dangling loose, is it?

I normally use a robust 12v power supply

"Robust" is relative...

Try adding a capacitor (maybe 1000uF minimum) across the 12V power supply.

If that doesn't help, stick a diode in series to the Arduino (but not to the lights) and put the capacitor on the Arduino-side of the diode (to ground). The capacitor will hold-up the voltage if it glitches-down temporarily, and the diode will insure that the capacitor only discharges into the Arduino, not the lights.

...I apologize for describing a circuit in words, but I don't have time to make a schematic at the moment. I hate it when people do that!

"Robust" is relative...

Try adding a capacitor (maybe 1000uF minimum) across the 12V power supply.

If that doesn't help, stick a diode in series to the Arduino (but not to the lights) and put the capacitor on the Arduino-side of the diode (to ground). The capacitor will hold-up the voltage if it glitches-down temporarily, and the diode will insure that the capacitor only discharges into the Arduino, not the lights.

...I apologize for describing a circuit in words, but I don't have time to make a schematic at the moment. I hate it when people do that!

that's correct...it works even if the 12v supply is providing power via VIN as long as the usb is connected to EITHER a computer or a 5v supply.

No schematic necessary...I get it and really should have already tried that. I should have specified that I am using a capacitor on the LED side. I'll try at the supply again. Not really sure why I didn't think of that.

Also the supply is 12v 30A switching. Amperage is obviously not the issue. If it wasn't clear even powering from ONLY the 5v USB power (if memory serves something in the order of 500ma) will work just fine too.

#define PIXEL_COUNT 60

A Nano can supply a maximum of ~50mA from it's 5volt pin when powered from 12volt on V-in (raw).
That's a maximum of ONE neopixel.

If you power the Nano from USB, then the 5volt limitation is ~450mA,
and the Nano can power up to eight Neopixels.

For 60 Neopixels, you need a 5volt/3.5Amp supply.
The Nano can be powered from that as well (on the 5volt pin).
Leo..