16x2 LCD works when connected to FTDI, but shows gibberish when on battery.

Evening gentlemen and ladies,

I am trying to make a quadcopter using a pair of Pro-minis, and I am still in the testing phase. I have most of the transmitter working, but my problem lies with the display I’m using. I intend to have the 16x2 display the throttle value, so that I can easily keep track of the hover speed. I have the screen hooked up just like in the “hello world” example sketch, but I changed the pins because I’m using a promini rather than an UNO. This is the sketch i’m using just to test the incoming pot values from the joysticks, and to print them to the serial monitor, as well as print the throttle value to the display.

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);


void setup() {
  // put your setup code here, to run once:
Serial.begin(9600); 
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);

  lcd.begin(16, 2);
  // Print a message to the LCD.
  delay(1000);
  lcd.print("Current throttle");
  

}

void loop() {
  // put your main code here, to run repeatedly:
  int throttle = 0;
  int yaw = 0;
  int pitch = 0;
  int roll = 0;
  
  throttle = analogRead(A0);
  yaw      = analogRead(A1);
  pitch    = analogRead(A2);
  roll     = analogRead(A3);
  
  lcd.setCursor(0, 1);
  // print the throttle variable value
  lcd.print("T:");
  lcd.print(throttle);
  
  
  Serial.print("Throttle:  ");
  Serial.print(throttle);
  Serial.print("       Yaw:  ");
  Serial.print(yaw);
  Serial.print("       Pitch:  ");
  Serial.print(pitch);
  Serial.print("       Roll:  ");
  Serial.println(roll);
  
  delay(1000);
}

Now when I connect the FTDI adapter in order to program the promini, the display shows exactly what I want it to. However, as soon as I connect the battery pack to the raw pin, I get gibberish in (0, 0-3) and (0,5-8) that looks like “0?w? ?o?0” with the cursor right after that. How can I fix this, and why is it different when all i’m changing is the power source?

Define "battery pack"?

For "raw" pin, must be 7.5 or 9 V.

It's 8 AA batteries, so 12V. The pro-mini page says the raw pin can handle 3.3-12 optimally, up to 16, but I've got an external regulator I'm using so I can step it down to whatever really. Is 7 or 9 a magic number that would allow the LCD to run better somehow?

I'm pretty sure that the problem is that the vcc pin can only give 200mA max, and I'm already running an NRF chip that draws quite a bit. I'm going to try running the LCD off the battery pack directly, so it is not drawing more current from the arduino, but if all I'm changing is the voltage source, and it can run just fine when connected to a computer, why would the current from the vcc pin matter?

I'm pretty sure that the problem is that the vcc pin can only give 200mA max ...

Have you looked into how much current your AA batteries can supply?

Don

No, but I will do that. You think the 8 batteries in series isn't supplying enough amps to even get to the 200 mA max? I like the way you think. I'll check the amperage. So potentially using 2 parallel sets of 4 batteries each would up the amps coming in, right?

The Pro Mini is typically fitted with a tiny LDO (Low Drop Out) regulator, so for 5V output the regulator input can be as low as 5.25V. The main problem with these little regulators is thermal overload, with 12V in it is possible that it is going into thermal shutdown. If you can use an external regulator (or lower battery voltage) I would try bringing the input voltage to the raw pin down to about 6V to take the thermal stress off the regulator. Also try disconnecting the NRF device (as a test) since the sketch does not use it.

If you have a voltmeter then check the voltage at the Vcc pin with respect to GND (0V) when the board is running to see if it actually 5V.

rowboteer: If you have a voltmeter then check the voltage at the Vcc pin with respect to GND (0V) when the board is running to see if it actually 5V.

I have the 3.3v pro mini. I feel intelligent.

So I'm going to a) detach the nrf for now, as well as b) run the screen from the external regulator set to 5v, instead of the vcc pin.

So I did what I intended, and got the screen displaying almost what i want, but the LCD characters are reversed, as in the entire grid is black and the character is clear. Why is that happening now?

Adjust the contrast voltage.

woo! I did it! got the NRF back in the circuit, too. I took out the Potentiometer that was controlling the contrast, and just added a 3.3K resistor. Works perfect now. Thanks for all your help, karma for all.