Go Down

Topic: LCD 2004 I2C not starting on external power supply unless reset (Read 447 times) previous topic - next topic

mmgserver

Hello,
I have a Arduino Uno R3, a LCD display 2004 I2c and 3 I2C sensors.
I use 200Ohm resistors for SDA and SCL connections on each sensor and display.
If I run arduino from usb serial cable the lcd works perfectly.
If I power arduino from 9V 1A external power supply the LCD lights UP but does not display any info.The only workaround to fix this is to press reset button on Arduino board.
If I disconnect the I2C sensors the display starts OK on external power supply.
What should I do?

My setup code is the following:

Quote
void setup() {
  lcd.begin(20,4);   // initialize the lcd for 20 chars 4 lines, turn on backlight
  lcd_about_project();

  Serial.begin(9600);
  Wire.begin();
  Wire.setClock(400000);
 }
Thank you!

groundFungus

Quote
I use 200Ohm resistors for SDA and SCL connections on each sensor and display.
You only need 1 set of pullup resistors for the I2C bus.  Recommended value is 4.7K.  4 of the 2K resistors in parallel brings the total pullup to 500 Ohms which is way out of spec for the I2C bus pullups.

When powered by USB you have 500mA available.  When powered by 9V through the onboard 5V regulator   you have less than 250mA (total) available (to keep the dissipation of the regulator under 1W).  The Uno pulls about 50mA and the combination of the current for the backlight and the current for the sensors may be pulling the 5V rail down to where the LCD won't work.  Monitor the 5V rail when you power with the 9V supply to see if the 5V rail voltage drops.

Paul__B

You only need 1 set of pullup resistors for the I2C bus.  Recommended value is 4.7K.  4 of the 2K resistors in parallel brings the total pullup to 500 Ohms which is way out of spec for the I2C bus pullups.
I believe he said "200 Ohm" resistors.

The I2C backpack on the display will already have pull-ups on it.  No other pull-ups will be necessary.


The obsolete tutorials on the Arduino site and others imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator imply that this is a usable source of 5 V power.  This is absolutely not the case.  It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes.  And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.

This is because the on-board regulator is essentially capable of powering only the microcontroller itself and no more than a couple of indicator LEDs.  The on-board regulator might be able to power a few other things if it had a heatsink, but on the Arduinos, it does not.

Powering via the "barrel jack" or "Vin" connections is asking for pain and trouble.

mmgserver

You only need 1 set of pullup resistors for the I2C bus.  Recommended value is 4.7K.  4 of the 2K resistors in parallel brings the total pullup to 500 Ohms which is way out of spec for the I2C bus pullups.

When powered by USB you have 500mA available.  When powered by 9V through the onboard 5V regulator   you have less than 250mA (total) available (to keep the dissipation of the regulator under 1W).  The Uno pulls about 50mA and the combination of the current for the backlight and the current for the sensors may be pulling the 5V rail down to where the LCD won't work.  Monitor the 5V rail when you power with the 9V supply to see if the 5V rail voltage drops.
Thank you for the info.

So SDA must be connected to VCC +5V using a 4.7K resistor and SCL must be connected to VCC +5V using a 4.7K resistor. Rest of I2C can be directly connected to SDA and SCL.
I'll check the 5v rail to see the voltage.


mmgserver

I believe he said "200 Ohm" resistors.

The I2C backpack on the display will already have pull-ups on it.  No other pull-ups will be necessary.


The obsolete tutorials on the Arduino site and others imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator imply that this is a usable source of 5 V power.  This is absolutely not the case.  It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes.  And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.

This is because the on-board regulator is essentially capable of powering only the microcontroller itself and no more than a couple of indicator LEDs.  The on-board regulator might be able to power a few other things if it had a heatsink, but on the Arduinos, it does not.

Powering via the "barrel jack" or "Vin" connections is asking for pain and trouble.
OMG, this is NEW information for me! THANK YOU! So I need to ditch the idea of powering arduino from external power supply to jack barrel! Jesus I thought that this was the way to go when powering Arduino for heavy usage.
Can I power it from a tablet USB power supply that has 5V and 8A?
I need to have a stand-alone project that does not require computer.
Using this new setup is it ok to use 4.7K resistor as I2c pullup?
So SDA connects to VCC +5V using a 4.7K resistor and SCL connects to VCC +5V using a 4.7K resistor. Rest of I2C can be directly connected to SDA and SCL ?

Paul__B

Just check that the pull-ups are on the I2C backpack - and also whether there are pull-ups on any other modules.

Any 5 V supply with more than the current capability you require can be used - the circuit draws only as much current as it needs.  The simplest way to power it if you are not requiring more than 500 mA, is to use a common USB "phone charger" rated at 1 A or so, plugged into the USB connector.

bperrybap

If  you run the I2CexpDiag sketch in the hd44780 library, it will test the SDA and SCL lines for pullups as well as the LCD backpack based device.

Some other words of caution.

While setting the SCL clock rate to 400khz can speed things up, you should make sure that all of you i2c  slaves are spec'd for that clock rate.
The PCF8574 is only spec'd to 100Khz. While it tyipcally does run at 400khz just keep that in mind as you may have some issues at the higher clock rate.

Going below about 1k for the pullup value is not recommended.
Using 200 ohm is way too low, particularly when it sounds like there were multiple pullups which reduces the final value to be even lower. Values too low could actually damage the AVR as the bus signals will start to act like a power supply which will draw too much current from the AVR when the AVR tries to pull the signals low.


--- bill

mmgserver

Thank you all for your posts.
-I've changed the power supply to phone charger with usb cable to match arduino type.
However same behavior:
-unless I press reset on Arduino board or I disconnect all SDA/SCL sensors except display, on boot I have a stuck LCD.

Can I instruct I2c to activated display as last equipment?

Could this behavior be linked to the fact that arduino expects a serial data from computer an I am only giving it power?

bperrybap

Could this behavior be linked to the fact that arduino expects a serial data from computer an I am only giving it power?
No.

You have had several issues that needed to be resolved and we have no idea which ones you have resolved/fixed and which ones still remain.
The main issue being to correct the pullup resistors.

I would again suggest that you install and use the hd44780 library as it has a diagnostic to test the I2C signals and LCD backpack and LCD. And the i2c LCD code is better about the handling of LCD initialization and LCD command/data transfers.

--- bill

Go Up