Hello, I'm playing with i2c on my nodemcu board (LoLin v3), micropython version 1.8.7 (esp8266-20170108-v1.8.7.bin).
I'm trying to begin LCD 1604 (or 2004) works with my board.
When I connect just LCD to the ESP - it doesn't works.
i2c.scan() show nothing
>>> i2c = I2C(-1, scl=Pin(5), sda=Pin(4))
>>> i2c.scan()
[]
For tests I've connect BMP180 sensor to i2c bus and i2c.scan shows both devices!
>>> i2c.scan()
[39, 119]
BMP180 sensor works fine alone:
>>> i2c.scan()
[119]
But LCD can't works alone at all.
But this screen works well on my RPi2 board, or arduino.
I've tried it same wiring and same configuration with Arduino ESP8266 firmware with this sketch:
https://gist.github.com/kestel/e84115c5 ... 15804b4361
And it works well. Show all lines.
i2c lcd works only if more one device connected
Re: i2c lcd works only if more one device connected
I had two issues with my LCD display,
1) The signal voltage on the bus is 3.3v, my LCD takes 5v logic high, so grab some logic level changer ICs for that
2) On the electronics side, pullup resistors are needed on the bus, if they are on the i2c board, the above will be needed, if not and you already are using a level changer, try adding in some pullups to get the LCD to appear.
It would seem either could be an issue, due to the fact that adding more devices is either pulling the rails up in hardware or is leaking power onto the signal lines somehow.
Hope this helps somewhat!
1) The signal voltage on the bus is 3.3v, my LCD takes 5v logic high, so grab some logic level changer ICs for that
2) On the electronics side, pullup resistors are needed on the bus, if they are on the i2c board, the above will be needed, if not and you already are using a level changer, try adding in some pullups to get the LCD to appear.
It would seem either could be an issue, due to the fact that adding more devices is either pulling the rails up in hardware or is leaking power onto the signal lines somehow.
Hope this helps somewhat!
Re: i2c lcd works only if more one device connected
You don't actually need a level converter between 3.3V and 5V devices -- their logic levels are close enough to work. You just have to remember to put the pullup resistors to the 3.3V and not 5V, so that you don't damage the 3.3V device with 5V signal.
Re: i2c lcd works only if more one device connected
@Kestel
You probably need to add pullup resistors on SDA ands SCL.
On I²C bus, the lines are open-collectors. You shall add a resistor (4,7k for a medium speed bus) to 3.3V on both SDA and SCL.
The board with the BMP180 you are using probably add those resistors for you.
Edit: corrected voltage error for pullup
You probably need to add pullup resistors on SDA ands SCL.
On I²C bus, the lines are open-collectors. You shall add a resistor (4,7k for a medium speed bus) to 3.3V on both SDA and SCL.
The board with the BMP180 you are using probably add those resistors for you.
Edit: corrected voltage error for pullup
Last edited by fdufnews on Mon Feb 13, 2017 6:14 pm, edited 3 times in total.
Re: i2c lcd works only if more one device connected
Not to 5V. If you add it to 5V, the pins will receive 5V voltage, and they are not prepared for that and can be damaged. The pullups should be to the 3.3V.fdufnews wrote: On I²C bus, the lines are open-collectors. You shall add a resistor (4,7k for a medium speed bus) to 5V on both SDA and SCL.
Re: i2c lcd works only if more one device connected
Hello guys,
Thank you for help. Pull-up resistors help me.
I have tested it with two pull up resistors (4.7k and 10k also works fine). From SDA and SCL to 3v.
Thank you for help. Pull-up resistors help me.
I have tested it with two pull up resistors (4.7k and 10k also works fine). From SDA and SCL to 3v.
Re: i2c lcd works only if more one device connected
And as @fdufnews said - my BMP180 board already has resistors.
Re: i2c lcd works only if more one device connected
Of course. Sorry for the mistake.deshipu wrote:Not to 5V. If you add it to 5V, the pins will receive 5V voltage, and they are not prepared for that and can be damaged. The pullups should be to the 3.3V.fdufnews wrote: On I²C bus, the lines are open-collectors. You shall add a resistor (4,7k for a medium speed bus) to 5V on both SDA and SCL.