Introduction: ATTiny85 Connects to I2C OLED Display - Great Things Can Be Small

Picture of ATTiny85 Connects to I2C OLED Display - Great Things Can Be Small

I recently came across a tiny OLED display which I also used for another project. This time I thought a tiny display can be driven by an [AT]Tiny processor :).

The vision is - "create a tiny gaming machine"

Well the first step is taken. At least something is happening on the display. Feel free to suggest a game idea.


Parts we need

  • ATTiny85 break out board - CoPiino Connectable BrainZ from ebay ($6)
  • OLED Display with SSD1306 driver from ebay ($5)
  • AVR Programmer USBasp from ebay ($4)
  • 5V/3.3V regulated voltage source
  • some jumper wires
  • Arduino IDE

Attention: The display module I used had an operation range from +3.3V to +5V. So I could easily connect +5V. You need to carefully check if your display also supports +5V otherwise use a regulated +3.3V power source !!

Edit:

  • uploaded additional target project => demo for font and icons
  • uploaded some pictures for font and icons

Step 1: Soldering the Board

Picture of Soldering the Board

The CoPiino Connectable BrainZ comes as soldering kit. So it needs some soldering. All parts are through-hole and can be soldered old fashioned with soldering iron.

Scope of supply:

  • PCB 21x28mm with M3 fixing hole
  • 1x ATTiny85-20PU
  • 1x LED 3mm yellow
  • 1x Resistor 1k
  • 3x Resistors 4.7k
  • 2x Capacitors 100nF
  • 1x pin header angled 1x4
  • 1x pin header angled 1x5
  • 1x Straight header
  • 2x3 (AVR ISP)
  • 1x Receptacle angled 1x4

It took me 20mins to solder all parts.

Step 2: Programming the CoPiino Connectable BrainZ

Picture of Programming the CoPiino Connectable BrainZ

This step is pretty forward. The required source code is attached to this step. All files need be extracted.

Included files are

  • ATTiny_OLED_Bouncing_Ball.ino
  • SSD1306_minimal.cpp
  • SSD1306_minimal.h
  • TinyWireM.cpp
  • TinyWireM.h
  • USI_TWI_Master.cpp
  • USI_TWI_Master.h

1. With the Arduino IDE we open the ATTiny_OLED_Bouncing_Ball.ino

2. We need to use the menu "Sketch" - "Add File ... " and add all other files one by one

3. Connect the CoPiino Connectable BrainZ to the USBasp (see notes below)

4. Connect USBasp preferably to a USB hub

5. Arduino IDE: Compile and Upload

6. Check for completed Upload

7. Disconnect USB

8. done

notes:

For connecting the USBasp to the CoPiino Connectable BrainZ we apply these pin connections

ISP10PIN to ISP6PIN

Pin 9 to 1 [MISO]

Pin 2 to 2 [VCC]

Pin 7 to 3 [SCK]

Pin 1 to 4 [MOSI]

Pin 5 to 5 [RST]

Pin 2 to 6 [GND]

Step 3: Connect and Run

Picture of Connect and Run

The display will be connected through I2C / TWI which are the signales SDA/SCL. Additionally we draw VCC and GND from the CoPiino Connectable BrainZ to the display. So all toghether we have 4 single cables between display and BrainZ.

Attention: The display module I used had an operation range from +3.3V to +5V. So I could easily connect +5V. You need to carefully check if your display also supports +5V otherwise use a regulated +3.3V power source !!

We then use our 5V/3.3V regulated power source and inject GND and VCC into the appropriate pins at the BrainZ module.

You will be enlightened by the nice moving ball in a grid on the display.

Congrats!

Now its time to make the next step. Any gaming idea that can be implemented?

Comments

VolosR (author)2017-07-02

Can you help me please. I have 128x32 display conected to Attiny85 and your library works, but text is very hard to read beacouse diferent screen size. Can you help me modify your library to fit 128x32 screen OLED display. Tnx

tswaehn (author)VolosR2017-07-02

Hi,
Sure, we can do. Please send a picture,what it looks like.

jverban (author)tswaehn2017-09-04

hello, do you have code for attiny85+i2c oled+10k pot like (mark Osborne, attiny oled game)

jverban@hotmail.com

AlexFW (author)2017-05-26

Hi, I have had a lot of success with your library on ATtiny85. Now I'm trying to get it to work on the ATtiny84 as well. I cannot compile any sketches that work on tiny85 because for some reason the lines of code with the USI are not working. I thought that since tiny84 and tiny85 both use a USI rather than physical I2C support this should work... The error message is below. Thanks!

/var/folders/tr/zp_0970j0ld4_wq_yx8vnw_r0000gn/T/arduino_build_400141/sketch/USI_TWI_Master.cpp: In function 'void USI_TWI_Master_Initialise()':

USI_TWI_Master.cpp:52: error: 'PORT_USI' was not declared in this scope

PORT_USI |= (1<<PIN_USI_SDA); // Enable pullup on SDA, to set high as released state.

^

USI_TWI_Master.cpp:52: error: 'PIN_USI_SDA' was not declared in this scope

PORT_USI |= (1<<PIN_USI_SDA); // Enable pullup on SDA, to set high as released state.

^

USI_TWI_Master.cpp:53: error: 'PIN_USI_SCL' was not declared in this scope

PORT_USI |= (1<<PIN_USI_SCL); // Enable pullup on SCL, to set high as released state.

^

USI_TWI_Master.cpp:55: error: 'DDR_USI' was not declared in this scope

DDR_USI |= (1<<PIN_USI_SCL); // Enable SCL as output.

^

/var/folders/tr/zp_0970j0ld4_wq_yx8vnw_r0000gn/T/arduino_build_400141/sketch/USI_TWI_Master.cpp: In function 'unsigned char USI_TWI_Start_Transceiver_With_Data(unsigned char*, unsigned char)':

USI_TWI_Master.cpp:200: error: 'PORT_USI' was not declared in this scope

PORT_USI &= ~(1<<PIN_USI_SCL); // Pull SCL LOW.

^

USI_TWI_Master.cpp:200: error: 'PIN_USI_SCL' was not declared in this scope

PORT_USI &= ~(1<<PIN_USI_SCL); // Pull SCL LOW.

^

USI_TWI_Master.cpp:205: error: 'DDR_USI' was not declared in this scope

DDR_USI &= ~(1<<PIN_USI_SDA); // Enable SDA as input.

^

USI_TWI_Master.cpp:205: error: 'PIN_USI_SDA' was not declared in this scope

DDR_USI &= ~(1<<PIN_USI_SDA); // Enable SDA as input.

^

USI_TWI_Master.cpp:238: error: 'DDR_USI' was not declared in this scope

DDR_USI &= ~(1<<PIN_USI_SDA); // Enable SDA as input.

^

USI_TWI_Master.cpp:238: error: 'PIN_USI_SDA' was not declared in this scope

DDR_USI &= ~(1<<PIN_USI_SDA); // Enable SDA as input.

^

/var/folders/tr/zp_0970j0ld4_wq_yx8vnw_r0000gn/T/arduino_build_400141/sketch/USI_TWI_Master.cpp: In function 'unsigned char USI_TWI_Master_Transfer(unsigned char)':

USI_TWI_Master.cpp:280: error: 'PIN_USI' was not declared in this scope

while( !(PIN_USI & (1<<PIN_USI_SCL)) );// Wait for SCL to go high.

^

USI_TWI_Master.cpp:280: error: 'PIN_USI_SCL' was not declared in this scope

while( !(PIN_USI & (1<<PIN_USI_SCL)) );// Wait for SCL to go high.

^

USI_TWI_Master.cpp:288: error: 'DDR_USI' was not declared in this scope

DDR_USI |= (1<<PIN_USI_SDA); // Enable SDA as output.

^

USI_TWI_Master.cpp:288: error: 'PIN_USI_SDA' was not declared in this scope

DDR_USI |= (1<<PIN_USI_SDA); // Enable SDA as output.

^

/var/folders/tr/zp_0970j0ld4_wq_yx8vnw_r0000gn/T/arduino_build_400141/sketch/USI_TWI_Master.cpp: In function 'unsigned char USI_TWI_Master_Start()':

USI_TWI_Master.cpp:298: error: 'PORT_USI' was not declared in this scope

PORT_USI |= (1<<PIN_USI_SCL); // Release SCL.

tswaehn (author)AlexFW2017-05-26

Hi Alex,

thanks for you message. I pretty much thing you have your fingers at absolute correct location. Its only about the definition of pinnings for the serial transfer unit. I know a lot about TINY85, but not yet had much to do with the TINY84. BUT I guess its just a matter of naming, ...

tswaehn (author)tswaehn2017-05-26

Hi Alex,

according to the web the naming is different from Tiny85 to Tiny84. Additionally some registers are missing. Porting the programs from Tiny85 to Tiny84 seems to be more than re-compiling - unfortunately. :(

AlexFW (author)tswaehn2017-05-26

Thanks for your response. Adding those pin definitions for (__AVR_ATtiny84__) | defined(__AVR_ATtiny44__) worked perfectly. It actually does look like direct ports of previous sketches are possible. Since the definitions you provided are independent of the ATtiny core in use it should work with any core, right?

tswaehn (author)AlexFW2017-05-27

yes, this should work generally to port code from ATiny85 to ATiny84.

tswaehn (author)AlexFW2017-05-26

Did you try to use these renames?

#if defined(__AVR_ATtiny84__) | defined(__AVR_ATtiny44__)

#define DDR_USI DDRA

#define PORT_USI PORTA

#define PIN_USI PINA

#define PORT_USI_SDA PORTA6

#define PORT_USI_SCL PORTA4

#define PIN_USI_SDA PINA6

#define PIN_USI_SCL PINA4

#endif

illumation_ (author)2017-02-05

Update: I discover there is a memory leak (or something else) in the library or code that freeze the attiny85 after approx one hour of running the code. Anyone else experienced this?

tswaehn (author)illumation_2017-02-07

This can also be some electrics communication issue and lockup :)

illumation_ (author)2017-02-05

Thank you for the nice and easy to understand code. I ordered some
displays (white and blue) to use on a DigiSpark and a DigiSpark clone.
It seems to be a little different and you need to add some pull up
resistors (the 4.7K ones) to get it to work. I solder these two
resistors onto the display board (to the data header pins, between +5V
and the data header pins) directly. On the DigiSpark you must use P0 and
P2 as I2C data lines, P0=SDA and P2=SLC/SLK.

To speed up screen updates (processor speed), to get the full speed potentional out of it, I use this code:

void setMaxClockSpeed()
{
// Examine Page 33
CLKPR = 0x80; // Setup CLKPCE to be receptive
CLKPR = 0x00; // No scalar

// Maximum clock speeds!
PLLCSR = _BV(PLLE) | _BV( PCKE );
OSCCAL = 0xff;
}

You can call this at the setup routine and the animation is twice the speed! Pretty amazing stuff.

ceptimus (author)2016-10-12

Hi. Thanks for excellent tutorial. I'd already got a simple 'blink' sketch running on my ATtiny85. When I connected the OLED and tried your code it all worked perfectly first try. Saved me hours struggling how to configure the TinyWireM library to run at 16MHz and then figuring out how to use it with the SSD1306. :)

tswaehn (author)ceptimus2016-10-12

Thank that's nice to hear!

Let me know what cool things you are doing with it.

AlexFW (author)2016-10-08

Hi - great tutorial. I got it working.

Now I'm struggling to get images to display correctly. Can you describe your workflow for making the byte arrays? Whenever I use http://manytools.org/hacker-tools/image-to-byte-array/ to make my own I always get a random assortment of pixels in the correct size. I have figured out that the width is the width in pixels and the height is the height in pixels/8.

tswaehn (author)AlexFW2016-10-09

Hi Alex,
Yeah that's right. It can be tricky to display images. It usually something with byte order and endianess.

The ssd1306 is configured that way
(1) As far as I remember the first byte starts top left corner.
(2) the display reads bytes from left to right
(3) the display reads lines from top to bottom

So basically we need a byte stream in that order - that's it

(4) I am unsure about byte endianess - I think it was byte0 - bit7 that sits on pixel (0,0) - so this should be LSB first.

Hope that helps at least a little :)

Let me know how things are and if a deeper look from my side can be of some help here.

AlexFW (author)tswaehn2016-10-09

I've tried tons of different image to hex array converters, but none of them seem to function. All of them display a seemingly random assortment of pixels, except for solid white or solid black images, which makes sense. I've tried both the methods listed here: https://learn.adafruit.com/mini-thermal-receipt-printer/bitmap-printing , as well as a few online converters. All display the pixels in an incorrect order, which leads me to believe that the order they're encoded is not as you listed. Can you please share what tool you used to convert the images to hex arrays?

AlexFW (author)AlexFW2016-10-09

Aha! I've finally gotten it! Every single tutorial and page I've ever seen says the image orientation needs to be horizontal for the OLED to display it correctly. Out of desperation I tried vertical orientation ONCE and it appears to be working.

tswaehn (author)AlexFW2016-10-09

that's great that you got it working. I did use some Linux tool, but remember to have changed the bit order from MSB to LSB.

If you can,... send some pictures - would be great!!

Raphango (author)2015-08-29

I'did it! xD AtTiny Micro Wheather Station! Take a look:

ChristianK35 (author)Raphango2016-01-08

Can u send me the code you used? with librabry?

the code below gives me the error.

This works for me :D

#include // I2C Master lib for ATTinys which use USI - comment this out to use with standard arduinos
#include // needed to up clock to 16 MHz on 5v Trinket
#include
dht DHT;
const byte DHT22_Pin = 1;
const int analogInPin = 3;
#include "SSD1306_minimal.h"
#include
#define DEG "\xa7" "C"

SSD1306_Mini oled;


char strHum[5];
char strTemp[5];
char strSensorValue[5];

// Struct for sending measured data
/*
struct Data {
uint16_t temp; // Temperature value
uint16_t hum; // Humidity value
int status; // DHT22 module status
} data;

*/
void setup(){
if (F_CPU == 16000000) clock_prescale_set(clock_div_1); // 5V Trinket: run at 16 MHz
TinyWireM.begin(); // initialize I2C lib - comment this out to use with standard arduinos
oled.init(0x3c);
oled.clear();
}


void loop(){
/*
sensorValue = analogRead(analogInPin);
data.status = DHT.read22(DHT22_Pin);
data.hum = (int)DHT.temperature;
data.temp = (int)DHT.humidity;
*/

int chk = DHT.read22(DHT22_Pin);
int h=DHT.humidity;
int t=DHT.temperature;
int sensorValue = analogRead(analogInPin);


oled.startScreen();
oled.cursorTo(0,0);
oled.printString( "Luftfeuchte: ");

oled.startScreen();
oled.cursorTo(86,0);
oled.printString( itoa(h, strHum, 10));

oled.startScreen();
oled.cursorTo(0,18);
oled.printString("Temperatur: ");


oled.startScreen();
oled.cursorTo(100,18);
oled.printString( itoa(t, strTemp, 10));

oled.startScreen();
oled.cursorTo(0,36);
oled.printString("Licht: ");

oled.startScreen();
oled.cursorTo(51,36);
oled.printString( itoa(sensorValue, strSensorValue, 10));

delay(500);
}

GirishS10 (author)ChristianK352016-09-22

Cool thanks!

tswaehn (author)GirishS102016-09-23

you are welcome.

Raphango (author)ChristianK352016-01-10

Great! Congratulations!

tswaehn (author)ChristianK352016-01-09

@ChristianK35 that's great you got it running. Perhaps you want to add picture of your solution? - that would be awesome!

tswaehn (author)Raphango2015-08-29

that is nice! Can you add your code?

Raphango (author)tswaehn2015-08-30

Off course!

#include "font6x8.h"
#include "font8x16.h"
#include "ssd1306xled.h"
#include "ssd1306xled8x16.h"
#include <stdlib.h>
#include <dht.h>
#define DHT11_PIN 4
dht DHT;
// ============================================================================
float h=0;
float t=0;
char buffH[6];
char buffT[6];

void setup()
{
_delay_ms(40);
SSD1306.ssd1306_init();
}
//////////////////////////FUNÇÕES DO OLED 0,96"//////////////////////
void texto(char* s) {SSD1306.ssd1306_string_font6x8(s);}
void textoG(int pos_x, int pos_y, char* sG) {SSD1306.ssd1306_char_f8x16(pos_x, pos_y, sG);}
void pos(uint8_t x, uint8_t y){SSD1306.ssd1306_setpos(x, y);}
void limpaTela(){uint8_t p = 0xff; for (uint8_t i = 0; i < 4; i++){p = (p >> i); SSD1306.ssd1306_fillscreen(~p); _delay_ms(100);}SSD1306.ssd1306_fillscreen(0x00);}
/////////////////////////////////////////////////////////////////////

void loop() {
///////////////FUNÇÕES DHT-11///////////////
int chk = DHT.read11(DHT11_PIN);
h=DHT.humidity;
t=DHT.temperature;
dtostrf(h, 4, 2, buffH);
dtostrf(t, 4, 2, buffT);
////////////////////////////////////////////
limpaTela();
pos(0, 3);
texto("Humidade(%)");
pos(0, 5);
texto("Temperatura(C)");
pos(0, 7);
texto(" Jesus is good!");
textoG(0,0,"Raphaelangelo S2");
textoG(87,2,buffH);
textoG(87,4,buffT);
_delay_ms(3000);
}

Feel free to make an Instructable out of it, if you like.. =)

Let me know if you lack any library, but I think you can have it all here:

http://tinusaur.org/projects/ssd1306xled/

KickAss2k1 (author)Raphango2015-12-11

I have opened your code and have the tinusaur library but when I compile it gives me "error: 'SSD1306' was not declared in this scope" Anyone have any idea why?

In case it makes any difference, I'm using an adafruit trinket 3V and arduino ide 1.6.6

KickAss2k1 (author)KickAss2k12015-12-12

When I use import library, it brings in the
things after include enclosed in brackets instead of quotes. Still
same error. I have deleted any reference to the temp sensor, as I only
need to display text. I am sorry, not very good at programming, I rely
on finding code I can use and then modifying it to work for me. My code
looks like this:

#include <font6x8.h>
#include <font8x16.h>
#include <ssd1306xled.h>
#include <ssd1306xled8x16.h>
#include <stdlib.h>

// ============================================================================
float h=0;
float t=0;
char buffH[6];
char buffT[6];

void setup()
{
_delay_ms(40);
SSD1306.ssd1306_init();
}

//////////////////////////FUNÇÕES DO OLED 0,96"//////////////////////

void texto(char* s) {SSD1306.ssd1306_string_font6x8(s);}
void textoG(int pos_x, int pos_y, char* sG) {SSD1306.ssd1306_char_f8x16(pos_x, pos_y, sG);}
void pos(uint8_t x, uint8_t y){SSD1306.ssd1306_setpos(x, y);}
void
limpaTela(){uint8_t p = 0xff; for (uint8_t i = 0; i < 4; i++){p = (p
>> i); SSD1306.ssd1306_fillscreen(~p);
_delay_ms(100);}SSD1306.ssd1306_fillscreen(0x00);}
/////////////////////////////////////////////////////////////////////

void loop() {
///////////////FUNÇÕES DHT-11///////////////
h=23;
t=23;
dtostrf(h, 4, 2, buffH);
dtostrf(t, 4, 2, buffT);
////////////////////////////////////////////
limpaTela();
pos(0, 3);
texto("Humidade(%)");
pos(0, 5);
texto("Temperatura(C)");
pos(0, 7);
texto(" Jesus is good!");
textoG(0,0,"Raphaelangelo S2");
textoG(87,2,buffH);
textoG(87,4,buffT);
_delay_ms(3000);
}

Compiling that, i get many of these errors:

ATTiny85_OLED_weather_demo:17: error: 'SSD1306' was not declared in this scope

SSD1306.ssd1306_init();

tswaehn (author)KickAss2k12015-12-12

It's actually hard if not all parts of your code can be seen. Could you zip the whole project and send a download link. Then I will have a look your code. Hopefully we will beat the bugs ;)

KickAss2k1 (author)tswaehn2015-12-12

Thank you for your help. Here is what I have done in my troubleshooting: I was originally using Arduino IDE 1.6.6 on Windows 10. I went and tried this on an old computer (Ive run into problems with new ide versions before) with Windows 7 and Arduino IDE 1.6.5 and then got different errors!

The errors were:

"

num2str.c: In function 'usint2decascii':
num2str.c:32: error: 'for' loop initial declarations are only allowed in C99 mode
for (uint8_t pos = 0; pos < 5; pos++) // "pos" is index in array, so should be of type int.
^
num2str.c:32:2: note: use option -std=c99 or -std=gnu99 to compile your code
'for' loop initial declarations are only allowed in C99 mode

"

When I researched those errors, I found someone had said the fix was to rename the .c files to .cpp. After doing that, I am back to the "Error: 'SSD1306' was not declared in this scope"

Here is a link to a .rar of my files.

https://www.dropbox.com/s/jaxj04g5sy6i5js/ATTiny85...

tswaehn (author)KickAss2k12016-01-03

1) You did use "_delay_ms(3000);" also you should use "delay(3000)"

2) You have to decide if you want to use "SSD1306_minimal" or "SSD1306xlded.h" - you mixed the code.

There is a fixed version in

https://www.dropbox.com/s/j6at2evgjqglsnz/ATTiny85...

Raphango (author)KickAss2k12015-12-13

There's a little difference when using libraries:

1) If the lib is on the same folder of the sketch, then you should use 'quotes';

2) If the lib is already imported to Arduino IDE, the you should use <>.

Maybe your arduino is not recognizing the libs because of these slight differences...

tswaehn (author)KickAss2k12015-12-11

Is the trinket equipped with same processor atmega85?

KickAss2k1 (author)tswaehn2015-12-12

Yes, it uses an attiny85 and has usb on it. Pretty awesome little device. I'm trying to make a wearable with one.

https://www.adafruit.com/products/1500

Raphango (author)KickAss2k12015-12-12

Did you remember to import all the libraries mentioned in the "#include" procedures?

"error: 'SSD1306' was not declared in this scope" Possibly means that you have not done so..

Hope it helps... =)

tswaehn (author)Raphango2015-09-06

Thats great, thank you -- You are the man!

ChristianK35 made it! (author)2016-01-10

Made it Thank you!

tswaehn (author)ChristianK352016-01-10

Thats great - congratulations.
Thanks for sharing.

Raphango (author)2016-01-09

The code is two posts below... ?

ChristianK35 (author)2016-01-08

Hi!! i am trying to get the wheaterstation working.

This is my code i adapt it to my needs..

http://cloudkemi.at/owncloud/index.php/s/GO6BwICL6...


FINAL_OLED.ino: In function 'void loop()':
FINAL_OLED.ino:58:23: error: no matching function for call to 'SSD1306_Mini::printString(float&)'
FINAL_OLED.ino:58:23: note: candidate is:
In file included from FINAL_OLED.ino:7:0:
C:\Users\kemi\Documents\Arduino\libraries\ATTiny85_OLED_weather_demo/SSD1306_minimal.h:130:10: note: void SSD1306_Mini::printString(char*)
void printString( char * pText );
^
C:\Users\kemi\Documents\Arduino\libraries\ATTiny85_OLED_weather_demo/SSD1306_minimal.h:130:10: note: no known conversion for argument 1 from 'float' to 'char*'
no matching function for call to 'SSD1306_Mini::printString(float&)'

adam_99 (author)2016-01-02

Hi!

This is great project!

I'm just starting on Arduino and I wanted to do what Raphango did but just simple one.

My goal is AtTiny85, some display, temp sensor and 3.7 battery.

I don't know how if the battery can take all those parts on.

I also thought about adding a solar panel so I don't need to charge it.

Can you help me with it?

Thanks!

tswaehn (author)adam_992016-01-03

Great idea. Lets split your project into parts

1. select parts

2. connect the wires

3. program your device

now how about (1) the parts?

Parts we need

  • ATTiny85 break out board - CoPiino Connectable BrainZ from ebay ($6)
  • OLED Display with SSD1306 driver from ebay ($5)
  • AVR Programmer USBasp from ebay ($4)
  • 5V/3.3V regulated voltage source
  • Temperature Sensor DHT11
  • some jumper wires
  • Arduino IDE

do you have all parts at hand?

adam_99 (author)tswaehn2016-01-03

Thank you for your answer!

1. I've ordered ATTiny85 from ebay and a few breadboards.
2. I still don't have the display, I wanted to know if it's possible first, before I order the display.
3. I'll use Arduino Uno as ISP for programming the ATTiny85 (is that good?)
4. Should not have problem with 5V but don't know where to get 3.3v regulated (I thought about the tiny LiPo 3.7v, don't know if it's good for this project)
5. I think I'll use the LM35 temperature sensor, no need for other measurements right now.
6. Jumper wires are on the way from ebay along with the ATTiny85
7. Already installed.

bASEL made it! (author)2015-09-05

Nice, it works using the very basics (5volt, ATtiny85 and the screen)! However I did have to burn using ATtiny85 (internal 1 MHz clock) as it didn't work using 8 Mhz.

tswaehn (author)bASEL2015-09-06

Hi bASEL, Thank you for following the instructions. Hope that this was fun? :)
The ATTiny85 without oscillator comes with 1MHz. We can increase performance with setting the fuse bits and let it run on 8MHz.

Raphango made it! (author)2015-08-16

Great! It worked just perfect for me, out of the box, like you said.

Congrats!

Now that I've managed to make it work, i was wondering if I could use it to display text messages. Actually, I'd like to use it as a Micro Weather Station, getting data from the DHT-11 and displaying it on the OLED. I've managed to do it with my Arduino UNO, using U8GLib, but not with the Attiny85..... (next pics)

tswaehn (author)Raphango2015-08-18

@raphango : good job!

I also see a good option to display the sensor data. This should be fun. The tricky part here is that "my" library does not use any frambuffer, because the ATiny has not sufficient RAM for that. It is still possible to run the display -- you see. We need to include the fonts in my tiny lib then it will be able to display the sensor data easily.

Raphango (author)tswaehn2015-08-18

Thanks! I found this lib here that can display text:

http://tinusaur.org/projects/ssd1306xled/

regards!

About This Instructable

29,863views

85favorites

License:

Bio: Electronics is great! http://CoPiino.cc
More by tswaehn:101hero $99 3D Printer - an Upgrade StoryHome Sensor StationFrom Sketch to Wifi Controlled Robot
Add instructable to: