I am a bit into programming the ATtiny85 currently, and was looking for some libraries to use for my 16×2 LCD via i2c. I tried testing the current library I had (refer to my previous tutorial : Displaying Text to LCD via I2C Module on DIY Arduino Board), but this does not work with the ATtiny85.

By the way, I am using the ATtin85 Development Module like the one shown below:

The LCD and I2C modules I am using are the ones pictured below:

Using the same modules, we will be displaying text to the LCD via I2C from out ATtiny85 Development Board. Here’s how:

Adding the library to Arduino is a bit tricky here. After downloading the library as ZIP above, extract the LiquidCrystal_ATtiny folder from the compressed file to your local machine (directory of your choice).

Open the folder and compress all files in one ZIP file (name the compressed file LiquidCrystal_ATtiny.zip). This .zip file is the one to be added to your Arduino IDE. When you open the compress file, these files should show up:

examples (folder)

LiquidCrystal_attiny.h

LiquidCrystal_attiny.cpp

keywords.txt

Now, add this to the Library by going to Sketch > Include Library > Add .ZIP library. Then locate the compressed file, and add it. The status bar at the bottom of the Arduino IDE will tell you that the library has been added successfully or not.

To verify that the sample code has also been added, go to File > Examples > LiquidCrystal_ATtiny > i2c_lcd_attiny.

WIRING THE MODULE

The I2C module has 4 pins in it: SCL, SDA, VCC and GND. (In the I2C image above, SCL has the yellow jumper wire attached to it, SDA has the blue jumper wire attached to it, VCC has the red one, and GND has the black jumper wire attached to it.

In my previous article, we’ve somehow shown the pinout for the ATtiny85 (in my case the ATtiny85 Development Board, but no much of a difference actually:
Pinout for ATtiny85 integrated circuit above.

Pinout labels correspond to those in ATtiny85 Development Board as well.

Wire the I2C module as follows:

Connect SCL pin from the I2C module to PB02 of the ATtiny85 IC or Development Board.

Connect SDA pin from the I2C module to PB0 of the ATtiny85 IC or Development Board.

Connect VCC pin from the I2C module to 5V of the ATtiny85 IC or Development Board.

Connect GND pin from the I2C module to GND of the ATtiny85 IC or Development Board.

IMPORTANT: If tou have a separate power supply for the ATtiny85 IC or Development board, you must connect GND from the Arduino UNO to the GND of the power supply.

Now, connect your Arduino UNO as demonstrated in my previous post. We will use the Arduino UNO as ISP to upload sketches to the ATtiny85 IC or Development Board.

You should have a similar output to the LCD module as the one shown below:

Now you’re done! Please let me know how you go. I would be happy to update this article if you have anything to suggest that would make this article as accurate as it should, especially for beginners like me.

This article serves as a documentation for me, and for others who might want to try the steps I did in this exercise.