Updating display causes freezing

I'm building a DIY Powerstation with a 12V LiFePo4 battery. For monitoring voltage, current and temperature I'm using an Arduino Nano that displays these values on a small OLED display. The Arduino is supplied through a step-down that is wired to the battery and the VIN pins. I set the potentiometer on the step-down to about 7V to counteract the variable voltage range of the battery from 10-13V. The problem I'm having is, that with 7V supply voltage, the Arduino is randomly freezing while updating the display. I verified this by turning on the on-board LED before updating the display and switching it off after the update is completed. When the Arduino freezes, the LED stays on indefinitely. If I regulate the output voltage of the step-down down to 5V, everything works just fine. I let it run for multiple hours without a problem. As soon as I regulate the voltage to >7V, the Arduino freezes.

Potential errors I already ruled out:

  • The OLED display is not wired to the step-down directly but to the 5V pin of the Arduino.
  • I'm not using the String library for rendering text on the display. I use sprintf, dtostrf and char arrays.
  • I'm using this method to get the free memory between stack and heap and the value stays at about 400 bytes.

Schematic

Welcome to the forum

What happens if you set the input voltage to something higher than 7V ?

Why doesn't the "step-down" device output a stable voltage ? How is the step-down implemented ?

No surprise there, as applying > 5V to any input, such as A0 (as shown on the posted diagram), can actually destroy the Arduino. You are lucky that it has survived so far.

Use a 5V regulated stepdown to power the Arduino through the 5V pin. I use and recommend this one.

See Classic Nano has too much RAM; 400 might not be enough.

Alternative: have a look at https://docs.arduino.cc/learn/programming/memory-guide/#sram-memory-measurement.

It does output a stable voltage. Its just that the input voltage from the battery varies depending on the charge state of the battery. It ranges from 10-13V. As the step down is not a regulated step down, also the output voltage varies

I‘ve read that the voltage on analog pins can be at max VCC + 0.3V, but i guess that was not true. I‘ll disconnect the that pin and do some testing later. Thank you.

Then how can you

I set it to 7V when the battery was fully charged with 13V. When the battery is nearly discharged, it is at 10V and the output of the stepdown is at approx. 5V.

Correct, but Vcc is normally 5V (for the Arduino Uno, Mega and the like), so you may apply 5.3V to the analog pin without damage. The diagram shows that you are applying over 6V to A0. To measure battery voltage higher than Vcc, a voltage divider is required.

Your diagram does not clearly show how you are powering the Arduino. If applied to Vin, then an on-board voltage regulator produces Vcc = 5V for the processor.

If you applied that 7V or higher to the "5V" pin, then the Arduino has probably been damaged.

What is the step down device? Why is it not regulating the voltage so the Arduino gets proper power input? Of note, the Arduino requires the VIN voltage to be above 5V (6-7V+) for the Arduino to have a steady 5V from its regulator.

I tested it without the analog pin and it seems to work. Thank you

This is the step down I'm using: https://www.amazon.it/gp/product/B089QJM8KQ/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&th=1

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