Arduino Nano- serial not working when using Vin

As the title states, applying 12v to the Vin pin on my Arduino nano seems to stop the Tx pin from sending data. Actually, it seems to stop it from doing much of anything. My code is set to send 10, 1 digit data numbers to an Arduino Mega 2560 every second. When I plug the Nano into my computer, the serial works fine, albeit none of the LEDs connected to the Nano work regardless of whether the serial is working or not. Could it be an issue of too much supply voltage, or could there be a short somewhere in the mix causing the serial to freeze?

  • Maybe you damaged the Vin circuitry.

  • Always show us a good schematic of your proposed circuit.
    Show us good images of your ‘actual’ wiring.
    Give links to components.

  • It is recommended inputting only 7V to 9V on the Vin pin or the power jack.

Schematics are on the way. Photos will be difficult since it's all in an enclosed metal box. Circuit worked fine until installing everything and now it's just acting up.


Here's my schematic. A4 and A5 go to an ht16k33. I wasn't aware of the max power being 9v though, I read (incorrectly) that it takes up to 12v.

  • We smell something fishy :woozy_face:

  • Can you take a picture of the Arduino in the case.

  • Use a DMM to measure this so called 12V.

  • You can input 12V, however this means the voltage regulator has to burn off 7V as heat.

  • Do you have the switch pins set to INPUT_PULLUP ?

  • How is the ht16k33 wired ?

Using my DMM I can confirm that it is indeed 12v. All switches are set to INPUT_PULLUP and the HT16K33 is wired SCL to SCL, SDA to SDA, 5v to 5v and GND to GND. Also makes sense why the nano is getting so warm.

  • Highly suggest you neaten the wiring up; the Nano should be secured.

  • Are you aware A6 and A7 are analog input only ?

  • Did you crimp the Dupont wire ends, might have a poor crimp.

Wiring is... neat as it can be. Much of that open space is needed to stay that way. I was not aware that those were only analog input, however that should be an easy switch. The code depends on the first switch (A0) to activate for anything else to function, so I haven't run into the problem of A6 not working yet. The nano is also usually secured with shielding, I've since removed that shielding to give visibility

  • No

  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
    Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

Trust me. This is as neat as it can get considering it would be torn out of the breadboard with the spring mechanism if it's any further out. Here's the code, though.

#include <BargraphLED.h>
#include <Wire.h>

unsigned long WLMillis;              //define white light cover blip timer
const unsigned long WLPeriod = 500;  //define white light cover blip rate

unsigned long fireMillis;              //define fire strobe timer
const unsigned long firePeriod = 125;  //define fire strobe rate

unsigned long BGMillis;
unsigned long BGPeriod = 50;

unsigned long outMillis;
const unsigned long outPeriod = 100;

unsigned long currentMillis;

BargraphLED BG;

int x;
int y;
int BGPos = 0;
int xPos = 0;
bool reverse = false;

#define WNDPIN 2
#define WNDCNT 7

//definitions for switches
#define sw1d A0
#define sw2d A1
#define sw3d A2
#define but1d A3
#define but2d A6

//definitions for neopixel led chain
#define SloBlo 2
#define hl1 3
#define wl 4
#define vent 9
#define hl2 5
#define hl3 6

//definitions for fire lights
#define flash 7
#define fire 8

bool wls = false;
bool fireS = false;
bool ready = false;
int state = 0;

void setup() {
  Serial.begin(9600);
  BG.init(0x70);
  delay(500);
  WLMillis = millis();
  fireMillis = millis();
  BGMillis = millis();
  outMillis = millis();
  pinMode(sw1d, INPUT_PULLUP);
  pinMode(sw2d, INPUT_PULLUP);
  pinMode(sw3d, INPUT_PULLUP);
  pinMode(but1d, INPUT_PULLUP);
  pinMode(but2d, INPUT_PULLUP);
  pinMode(flash, OUTPUT);
  pinMode(fire, OUTPUT);
}

void loop() {
  currentMillis = millis();
  checkSwitches();
  checkFire();
  checkOutput();
}

void checkOutput() {
  if (currentMillis - outMillis >= outPeriod) {
    if (state == 0) {
      Serial.println(0);
    } else if (state == 1) {
      Serial.println(1);
    } else if (state == 2) {
      Serial.println(2);
    } else if (state == 3) {
      Serial.println(3);
    }
    outMillis = currentMillis;
  }
}

void checkSwitches() {
  int sw1 = digitalRead(sw1d);
  int sw2 = digitalRead(sw2d);
  int sw3 = digitalRead(sw3d);
  if (sw1 == LOW) {
    if (currentMillis - BGMillis >= BGPeriod) {
      BG.setPixel(y, x, 1);
      y++;
      BGPos++;
      xPos++;
      BGMillis = currentMillis;
      if (y >= 7) {
        y = 0;
      }
      if (xPos >= 4) {
        xPos = 0;
        x++;
        if (y >= 4) {
          y = 0;
        }
      }
    }
    state = 1;
    digitalWrite(SloBlo, HIGH);
    digitalWrite(hl1, HIGH);
    digitalWrite(hl2, HIGH);
    digitalWrite(hl3, LOW);
    digitalWrite(vent, LOW);
    if (currentMillis - WLMillis >= WLPeriod) {
      WLMillis = currentMillis;
      digitalWrite(wl, !digitalRead(wl));
    }
    if (sw2 == LOW) {
      state = 2;
      digitalWrite(vent, HIGH);
      digitalWrite(hl3, LOW);
      digitalWrite(hl2, HIGH);
      if (sw3 == LOW) {
        digitalWrite(hl2, LOW);
        digitalWrite(hl3, HIGH);
        ready = true;
      }
    }
  } else {
    digitalWrite(SloBlo, LOW);
    digitalWrite(hl1, LOW);
    digitalWrite(hl2, LOW);
    digitalWrite(wl, LOW);
    digitalWrite(vent, LOW);
    digitalWrite(hl3, LOW);
    BG.clear();
    state = 0;
    BGPos = 0;
    xPos = 0;
    x = 0;
    y = 0;
  }
  if ((sw1 == HIGH) || (sw2 == HIGH) || (sw3 == HIGH)) {
    ready = false;
  }
  BG.write();
}

void checkFire() {
  int but1 = digitalRead(but1d);
  int but2 = digitalRead(but2d);
  if (ready == true) {
    if ((but1 == LOW) && (but2 == LOW)) {
      state = 3;
      if (currentMillis - fireMillis >= firePeriod) {
        digitalWrite(fire, !digitalRead(fire));
        fireMillis = currentMillis;
      }
      digitalWrite(flash, HIGH);
    } else {
      state = 2;
      digitalWrite(fire, LOW);
      digitalWrite(flash, LOW);
    }
  }
}

There is no longer a neopixel chain as the comments would suggest, those are now regular LEDs

  • When powered by 12V, measure the voltage on the NANO 5V pin.

  • What is the answer about the Dupont crimping ? (Post #8)

I did not crimp the wires, they're ELEGOO brand dupont wires.

  • Keep in mind, crimps on wires like this can be intermittent and cause unexpected things to occur.
    I only trust the crimps I make.

The 5v pin measures 5v when hooked up to the 12v power supply

  • Explain this more . . .

The LEDs I have hooked up to the nano do not work, period. They were all successfully tested before introducing them to the circuit, but now they refuse to turn on regardless of whether or not the board is functioning. Could it be an issue caused by damage from supplying too much voltage?

  • It could be, we are trying to narrow possibilities.

  • You can diagnose things using Serial.print(. . . ) .
    Example:
    -Print the states of the switches every now and then to see if the switch and wiring is indeed going LOW when pushed.
    -I like having a heartbeat LED, usually the onboard LED on D13 flash at a 1Hz rate; this roughly indicates if there is any blocking happening.

  • If things work outside the case but not inside, suspect wiring, shorts, intermittents etc.

Ah, gotcha. I'm going to spend a little while debugging, using your suggested methods and I'll see what happens with that. That being said, it's 1 am and I'm fed up tonight so I'll be back soon-ish.