I2C LCD Library... Help!
Re: I2C LCD Library... Help!
One of comments from Aliexpress:
"3f address. there is written about it. put the address 0х3f i2c module and start-everything works. https://ae01.alicdn.com/kf/UT8QpQBXNNaXXagOFbXQ.jpg"
So adress 63 is OK.
"The part number of the 0x3F chip will be PCF8574. i.e.0x38-0x3F
The part number of the 0x27 chip will be PCF8574A i.e. 0x20-0x27"
http://forum.arduino.cc/index.php?topic=369998.60
picture: https://cdn.instructables.com/FVV/YTFX/ ... .LARGE.jpg
0x3F - my code.
PCF8574AT - my backpack.
"3f address. there is written about it. put the address 0х3f i2c module and start-everything works. https://ae01.alicdn.com/kf/UT8QpQBXNNaXXagOFbXQ.jpg"
So adress 63 is OK.
"The part number of the 0x3F chip will be PCF8574. i.e.0x38-0x3F
The part number of the 0x27 chip will be PCF8574A i.e. 0x20-0x27"
http://forum.arduino.cc/index.php?topic=369998.60
picture: https://cdn.instructables.com/FVV/YTFX/ ... .LARGE.jpg
0x3F - my code.
PCF8574AT - my backpack.
Re: I2C LCD Library... Help!
SDA and SCL both need pullup resistors. Some boards have them and some don't. I'd try adding 10K ohm pullups between 3.3v and SDA and also between 3.3v and SCL.
Re: I2C LCD Library... Help!
I soldered all pins from LCD to backpack and now all is ok.
Thanks for troubleshuting. >>> from esp8266_i2c_lcd import I2cLcd
>>> from machine import Pin, I2C
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> i2c.scan()
[63]
>>> lcd = I2cLcd(i2c, 63, 2, 16)
>>> lcd.clear()
>>> lcd.putstr(' Thanks from Ukraine ')
Thanks for troubleshuting. >>> from esp8266_i2c_lcd import I2cLcd
>>> from machine import Pin, I2C
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> i2c.scan()
[63]
>>> lcd = I2cLcd(i2c, 63, 2, 16)
>>> lcd.clear()
>>> lcd.putstr(' Thanks from Ukraine ')
Re: I2C LCD Library... Help!
Help: <ImportError: no module named 'esp8266_i2c_lcd'> trying to load the same code:
from esp8266_i2c_lcd import I2cLcd
from machine import Pin, I2C
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
i2c.scan()
lcd = I2cLcd(i2c, 63, 2, 16)
lcd.clear()
lcd.putstr(' Thanks from Ukraine ')
from esp8266_i2c_lcd import I2cLcd
from machine import Pin, I2C
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
i2c.scan()
lcd = I2cLcd(i2c, 63, 2, 16)
lcd.clear()
lcd.putstr(' Thanks from Ukraine ')
Re: I2C LCD Library... Help!
There is no 'esp8266_i2c_lcd' library installed by default. You need to load 'esp8266_i2c_lcd' and 'lcd_api.py' on your NodeMCU. I use "ampy" util to load files to Node MPU.haks wrote:Help: <ImportError: no module named 'esp8266_i2c_lcd'> trying to load the same code:
from esp8266_i2c_lcd import I2cLcd
Code: Select all
C:\>set AMPY_PORT=COM10
C:\>ampy put lcd_api.py
C:\>ampy put esp8266_i2c_lcd.py esp8266_i2c_lcd.py
Code: Select all
>>> with open('esp8266_i2c_lcd.py') as f:
for line in f:
print(line, end='')
Re: I2C LCD Library... Help!
Question: Can we tune "Brightness" and "Contrast" using I2C LCD Library?
I ask this question because of next problem...
When I use wrong connection and power LCD Backpack (5V) from NodeMCU VU pin (5V) - all is ok with "Brightness" and "Contrast". See my picture above. But such connection may faulted I2C pin on NodeMCU (not 5V tolerant).
When I power LCD Backpack (5V) from NodeMCU 3V3 pin (3.3V) - LCD is working BUT "Brightness" and "Contrast" too low. I set potentiometer on Bacpack to max position. I can lcd.putstr('hi") but it very hard readable.
So is it any way to tune "Brightness" and "Contrast"?
I ask this question because of next problem...
When I use wrong connection and power LCD Backpack (5V) from NodeMCU VU pin (5V) - all is ok with "Brightness" and "Contrast". See my picture above. But such connection may faulted I2C pin on NodeMCU (not 5V tolerant).
When I power LCD Backpack (5V) from NodeMCU 3V3 pin (3.3V) - LCD is working BUT "Brightness" and "Contrast" too low. I set potentiometer on Bacpack to max position. I can lcd.putstr('hi") but it very hard readable.
So is it any way to tune "Brightness" and "Contrast"?
Re: I2C LCD Library... Help!
Test.
Power LCD Backpack (5V) from NodeMCU 3V3 pin (3.3V).
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> lcd = I2cLcd(i2c, 63, 2, 16)
>>> lcd.putstr(' Thanks from Ukraine ')
"Brightness" and "Contrast" too low.
Than I disconnect 3V3 pin and connect it again to 3V3 pin
>>> lcd.putstr(' Thanks from Ukraine ') "Brightness" and "Contrast" is ok but Char is wrong.
When I reinitialize LCD+Backpack
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> lcd = I2cLcd(i2c, 63, 2, 16)
Char is good but "Brightness" and "Contrast" is too low again .
Power LCD Backpack (5V) from NodeMCU 3V3 pin (3.3V).
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> lcd = I2cLcd(i2c, 63, 2, 16)
>>> lcd.putstr(' Thanks from Ukraine ')
"Brightness" and "Contrast" too low.
Than I disconnect 3V3 pin and connect it again to 3V3 pin
>>> lcd.putstr(' Thanks from Ukraine ') "Brightness" and "Contrast" is ok but Char is wrong.
When I reinitialize LCD+Backpack
>>> i2c = I2C(scl=Pin(5), sda=Pin(4), freq=100000)
>>> lcd = I2cLcd(i2c, 63, 2, 16)
Char is good but "Brightness" and "Contrast" is too low again .
Re: I2C LCD Library... Help!
The LCD requires 5V for proper brightness & contrast. You could try to run the LCD at 5V, and the NodeMCU at 3.3V with the pull-up resistors connected to 3.3 V. Or use a level converter for SDA & SCL, with pull-up resistors at both sides.
Re: I2C LCD Library... Help!
There are some 16x2 LCDs which are designed for 3V, but they are hard to find and often 5-10x the price.
Most require 5V for reasonable contrast. Don't forget to adjust the potentiometer on the back.
Yellow/green LCDs are more readable in daylight without the backlight on, compared to blue/white.
Most require 5V for reasonable contrast. Don't forget to adjust the potentiometer on the back.
Yellow/green LCDs are more readable in daylight without the backlight on, compared to blue/white.
Re: I2C LCD Library... Help!
Receive TXS0108E "I2C Logic Level Converter Bi-Directional Module 5V to 3.3V".
Connect LCD (5V) to NodeMCU (3.3V) through TXS0108E.
Now all is Ok.
Connect LCD (5V) to NodeMCU (3.3V) through TXS0108E.
Now all is Ok.