Arduino - Two wire I2C Lcd Display

in #arduino7 years ago

Hello Guys!

This is the first tutorial I’m posting on Steemit, and by this, I want to present you a very simple project, explaining how you can wire up your Arduino to your Lcd with just 2 wires.

As you can see in the image above, we are only wiring Analog Pin 4 and 5 to our breadboard. This can be possible with the aid of that black chip named PCF8574.

This chip is a 8-bit input/output (I/O) expander, designed for 2.5-V to 6-V VCC operation. The PCF8574 provides general-purpose remote I/O expansion for most microcontroller families by way of the I2C interface [serial clock (SCL), serial data (SDA)].

This means that with with this chip, from two analog pins and using a proper library, you can expand your arduino to have more 8 digital pins.

Bellow are the materials that you need to have to build this:

  • Arduino Uno
  • PCF8574
  • 100K Ohm Potenciometer
  • Lcd 16×2
  • Male Headers
  • Breadboard and Wires

After you gathered all the materials need to do this project, it’s time to print some text to our lcd.

First wire everything as shown in the diagram above.

Then you will need to install the library liquidcrystal_i2c in your arduino IDE. You can find the instructions to installing it following the link.

To end our project just upload this piece of code to your arduino:

#include 
#include 
LiquidCrystal_I2C lcd(0x20,16,2);
void setup()
{
    lcd.init();
    lcd.setCursor(0,0);
    lcd.print("Hello, world!");
}
void loop()
{
  lcd.setCursor(0,1);
  lcd.print(millis()/1000);
}

Hopefully it will work 😀

Please let me know if you have any questions or doubts!

Sort:  

@jmduarte
Beautiful write-up!Thanks for sharing.

Hi, welcome to Steemit!!

I am @botty and I give away free random upvotes and create free competitions with prizes.

Follow me for upcoming contests and a chance of a random free upvote, every 6 hours.

Keep on Steemin'

Congratulations @jmduarte! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @jmduarte! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.27
TRX 0.26
JST 0.039
BTC 94381.33
ETH 3339.67
USDT 1.00
SBD 3.45