Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

lcd display with Arduino works only with serial cable

Status
Not open for further replies.

ravi.2k17

Advanced Member level 4
Full Member level 1
Joined
Sep 30, 2019
Messages
111
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
874
hi all,

i have uploaded "hello world" code to Arduino uno connected to lcd via serial.
my hello world display only works as long as Arduino is connected with serial. as soon as i disconnect serial cable and power on Arduino with power adaptor it stops displaying "hello world"
why?? is not the sketch burnt on Arduino board?

thanks
 

We need to see the schematic and code to be sure but most likely reasons are:

1. the code is blocked waiting for serial input of some kind.
2. the power from the adapter is insufficient.

Brian.
 

We need to see the schematic and code to be sure but most likely reasons are:

1. the code is blocked waiting for serial input of some kind.
2. the power from the adapter is insufficient.

Brian.

>>>>>>>>>>>>>> 1. the code is blocked waiting for serial input of some kind.
below is my code.....................

#include <Wire.h> // Library for I2C communication
#include <LiquidCrystal_I2C.h> // Library for LCD
#include "DHT.h" // including the library of DHT11 temperature and humidity sensor

#define DHTTYPE DHT11 // DHT 11
#define dht_dpin A0 // Analog Pin sensor is connected to

LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2); // Change to (0x27,16,4) for 16x4 LCD.
DHT dht(dht_dpin, DHTTYPE);

void setup(void)
{
//Initiate the LCD:
lcd.init();
lcd.backlight();
//Print a message to the LCD.
lcd.print("Hello There!");
delay(3000);
lcd.clear(); //Clear the screen for next write.
lcd.print("Temp: Humidity:");

//Initiate dht
dht.begin();
Serial.begin(9600);
Serial.println("Humidity and temperature\n\n");
delay(700);
}

void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("Current humidity = ");
Serial.print(h);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(t);
Serial.println("C ");

if (isnan(h) || isnan(t)) {
lcd.print("ERROR");
return;
}

lcd.setCursor(0, 1); //Set the cursor on the first column and second row to print temprature.
lcd.print(t);
lcd.setCursor(7,1);
lcd.print(h);
delay(1000);
lcd.noDisplay(); //Blinking display by turning on and off.
delay(300);
lcd.display();
}


>>>>>>>>>>> 2. the power from the adapter is insufficient.
what does it mean? i am able to turn on lcd and Arduino using the adapter. how much current Arduino uno + lcd expect?
 

We need to see the schematic and code to be sure but most likely reasons are:

1. the code is blocked waiting for serial input of some kind.
2. the power from the adapter is insufficient.

Brian.

it seems it is the second case. power insufficient as chars are seen but very with very low contrast. i have attached Arduino with power adaptor rating 5v & 1 amp.
now i take power for Arduino + lcd both from adapter directly. why it is still not sufficient? how we calculate overall power requirement of Arduino + sensors and come up with adapter rating?
 

Many adapters produce unregulated 5V DC outputs, connect it up and measure the actual voltage it produces under load.
The Arduino and sensor probably don't need much current and the logic on the LCD only need 1mA or so but anything else you have connected, including the backlight on the LCD will draw much more. Ordinarily I would say 1A rating is more than sufficient but if it isn't regulated, the voltage will drop as more current is drawn and it may dip low enough to stop the circuit working.

Brian.
 

Many adapters produce unregulated 5V DC outputs, connect it up and measure the actual voltage it produces under load.
The Arduino and sensor probably don't need much current and the logic on the LCD only need 1mA or so but anything else you have connected, including the backlight on the LCD will draw much more. Ordinarily I would say 1A rating is more than sufficient but if it isn't regulated, the voltage will drop as more current is drawn and it may dip low enough to stop the circuit working.

Brian.


i am using below power supply. i think this is regulated one. i connect 5v output of this to breadboard power line and to that line i have connected my LCD and Arduino.

 

In itself that should be OK but what is the voltage you are feeding into it? The regulators on the board need more than about 7V at the input socket to produce 5V out.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top