0

I'm new to Arduino and want to build a Button Box. When I buyed the parts I didn't watched out for the specifications of the I2C module. When I tried to print sth on the LCD nothing happened (in retro perspective it's logical). I wouldn't like to have to buy a new LCD.

How can I make the LCD work with the I2c module?

LCD - http://cdn-reichelt.de/documents/datenblatt/A500/DEM16101SYH.pdf

I2C-module - http://mantech.co.za/datasheets/products/lcd2004-i2c.pdf

it's wired correctly (VCC to 5V, GND to GND, SDA to SDA and SCL to SCL)

The Code I used is the "Hello World" Example thats included in the LiquidCrystal_I2C library, but with a few changes:

//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,1);  //instead of LiquidCrystal_I2C lcd(0x27,20,4);

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(3,0);
  lcd.print("Hello, world!");
  lcd.setCursor(2,0); //isntead of lcd.setCursor(2,1);
  lcd.print("Ywrobot Arduino!");
   lcd.setCursor(0,0); //instead of lcd.setCursor(0,2);
  lcd.print("Arduino LCM IIC 2004");
   lcd.setCursor(2,0); //instead of lcd.setCursor(2,3);
  lcd.print("Power By Ec-yuan!");
}


void loop()
{
}
10
  • Hi @Chritzeltopf, welcome to Stack Overflow. If you edit your question to include the code you tried, what kind of LCD you’re connecting and how you wired it up, someone may be able to help you. Otherwise we know even less about what you’re doing than you do.
    – romkey
    Commented Jul 20, 2022 at 16:31
  • Sorry :(, I thought the given informations would be enough for the question. Added the infos :) Commented Jul 20, 2022 at 18:01
  • Yep, it's one line. That's the problem Commented Jul 20, 2022 at 18:28
  • what connections did you make? ... the I2C module provides the 8 data bits to the LCD module ... the E, R/S and RE signals to the LCD must be generated by the arduino
    – jsotola
    Commented Jul 20, 2022 at 19:14
  • @VE7JRO it happens nothing Commented Jul 20, 2022 at 21:06

1 Answer 1

1

Welcome Chritzelopf! Yes pull up resistors are required by the I2C definition. Your link on the driver shows they are not included and no schematic to indicate otherwise. The I2C bus is driven by open collector/drain semiconductor devices. This configuration will pull the line low but not source any current into it other then possibly some leakage. When the outputs of the I2C device are off the bus is pulled high or placed in the recessive state by the pull up resistors. When one or more of the devices turn on the bus is now in the dominate state or low. This configuration allows anything to turn on or off without damaging other devices on the bus. I like the pull up(s) to be in the 4.7K for 5V and about 3.3K in the 3V3v.

Some modules come with pull ups that are permanently connected, others are selectable with jumpers etc. This is NOT the A0 - A? jumpers which are address select lines. I always check the modules to determine if there are pull ups enabled and adjust my other resistances to get an appropriate value, sometimes even removing them.

2
  • So should I try it again with "pinMode(2, INPUT_PULLUP)"; pinMode(3, INPUT_PULLUP) ; Commented Jul 23, 2022 at 18:00
  • The library I use does not allow that as it programs them the way it wants. It does not report it just does. The safest, most likely to work is to use the recommended external resistors. Once you get it working then try your pull up idea. Remember they are somewhere in the 30 to 50K range.
    – Gil
    Commented Jul 24, 2022 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.