arduino oled i2c tutorial : 0.96" 128 X 32 for beginners
ฝัง
- เผยแพร่เมื่อ 27 ส.ค. 2024
- in this video, we will learn how to wire and code a 0.96" 128 X 32 / 128 X 64 OLED display using I2C or SPI communication.
by the end of this video, you will be able to write your own message and code the OLED display using an Arduino Microcontroller.
drop your questions in Comments or Social Media ( links below) for the upcomming QnA video!
Subscribe now for Part 2 of this tutorial
Business enquiry
writetomission@gmail.com
IMPORTANT LINKS ( CIRCUIT DIAGRAM AND CODE)
minov.in/oled-...
www.instructab...
Social Media Links
facebook
/ officialmissioncritical
instagram
/ officialmissioncritical
Twitter
/ akshaymomaya1
Thanks for the tutorial!
Please note that on your instructables pages you have written "wire.h" instead of "Wire.h" and "spi.h" instead of "SPI.h". Arduino will not recognize if you don't write with capital leters
Yeah you are right man
every other channel fails to mention copying the address into the library code, you're a lifesaver my man
This has got to be the most elaborated tutorial with extremely accurate English . Unlike other channels...you really ARE underrated. I loved your tutorial
Thank you mate ✨
simplest tutorial so far, i think this is absolutely ideal for beginners ! great job.
To fix the 128x32 resolution and force it to work in 128x64 start the library as follow:
#include
#include
#include
#include
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Oh thnx, I thought my screen was 128x32 even though I bought 128x64 😂
Hey! BTW if your display displays a kind of static (black and white dots) its not broken! Id recommend using SH1106 instead of SSD 1306.
Sure I will have a look, thanks
Thanks. This tutorial is just what I needed which was reduce an example to the bare bones.👍
But what happens when your wire the setup correctly, run the code to check for the I2C address and in the serial monitor it only says "I2C Scannrer, Scanning..." but nothing happens afterwards? (btw I had the same results when I tried to find the address of my LCD panel's I2C address)
Did you find the answer?
did everything as instructed, but the display still remained black.
also the i2c scanner didn't find anything
any way to fix that? I checked comments already, but none of them worked
thank you very much for this, where can i find a documentation?
You can find a link below called as Instructables or Minov blog if not, go to www.minov.in or www.instructables.com
This is a very well briefed explanation...awesome...
thank you i got it working just fine!
الله اكبر
الحمد لله
لاحول ولاقوة الا بالله
اللهم صل وسلم وبارك على سيدنا و نبينا محمد
اللهم صل وسلم وبارك على سيدنا و نبينا محمد
Simpleadt and easy to understand good going bro may gbu and you achieve all your all dreams
Thank you so much 🙂
The address is not shown on serial monitor screen.It says I2C scanner,scaning........and nothing is shown on screen.I thought it might take some time,but no,its not showing any address.Wt to do??does it mean OLED is not working.Should i buy different one??
The example code has an extra space in #include !!! it says #include < Wire.h> just letting you know but good vid
Ohkay, I wasn't aware about this error, thank you for letting me know
Thank you! this is Helpful! 😊
Most welcome 😊
@@mission_critical 😁😁😁😁😁😁😁😁
Hello, i bought an OLED with 128x128 pixels and its i2c too (somehow). well i downloaded the librarys and tried everything as usual, cz i have a little xp with oled 128x64. But i dont know why i have a black screen, code is right, adress is right and most probably the librarys are wrong. Could you please give me an advice, what librarys to use for 128x128 oleds 12c. Thanx.
I’m new to Arduino.... I want to make a fuel gauge using a .96 Oled 2 color 12C..... how do you ode to make a bargraph that responds to the fuel level and show the E , 1/2 , F increments on the yellow portion of the screen? I’m also using a fuel level sender, with one wire.
Bro, you have not fixed your adafruit library. Your Screen is 128x64. Open SSD1306.h ; see '#define SSD1306_128_32' below that it is '//#define SSD1306_128_64'. Just write '#define SSD1306 _128_64' and '//#define SSD1306_128_32'
Hey there I tried that but it seems like when I did that both those X 64 and X 32 dont work for my display , the only problem we will face for not fixing those headers is intro logo of adafruit will be cut, other than that everything is normal and useable!
Your display is 128x64
You have to edit the adafruit_SSD1306.h library
Yes I m quite aware about the same, I have tried it, I will still try again for the next tutorial thank you for bringing it to my notice!
Thank you for Subsrcibing to Mission Critical
~ Akshay Momaya
TechHead at Mission Critical
@@akshaykolekar5903 thats right
Great tutorial!
There were some errors in the code, I fixed them:
#include
#include
#include
#include
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
}
void loop() {
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Heheheheheh");
display.display();
}
What's your name sir? I just love your tutorials..y
You ar indian right? I am too ❤️
Hello Circuit Overtime, glad to hear that you enjoy our video, let's chat on Instagram ☺️
@@mission_critical alright sending you a ping can you tell me the I'd once?
You can find it on my socials or look for officialmissioncritical
im not able to find address it is showing-Sketch uses 3972 bytes (12%) of program storage space. Maximum is 32256 bytes.
Global variables use 478 bytes (23%) of dynamic memory, leaving 1570 bytes for local variables. Maximum is 2048 bytes.
Click that serial monitor icon in the right top corner
How to add 2 pages in OLED to scroll between it. Like 1st page shows measurements, 2nd shows clock ⏰️ for exemple.
Love you brother :)
Most welcome ❤️
do you think it is possible to unstick oled screen from it PCB but keeping it connected with it's flex cable ? (need to do that for a project)
With extreme skills, yes it is possible, but I would suggest you not to do it, since it's quite delicate to be pulled off and many complimentary components essential for working are mounted on PCB, I hope you know what you are doing and all the very best for your upcoming project ❤️
@@mission_critical ok thank you for this answer :)
Fabulous video n grt stuff...
Thank you @Job less I have seen your videos too, you are doing a fantastic work and making people laugh isn't an easy job keep growing!
I did it in the same way, but got an error when I tried to get the screen address, said the wire.h file was not in the folder
Same😢
It can use magnifier above the screen ,
sir enter the number s counting in dissplay
Can you print the display without the arduino or store the script in a smaller device to make like a custom watch or something?
Great!!
Thanks a lot.
What if I want to use it with stm32? Do you have a tutorial for it? What library I need to install?
Hello ! I want to ask what condition should I use if I want to automatically turn off the OLED display if it is not used for a minute using u8g Library thank you
Hi. Is it possible to adjust Code that is set for oled to one that fits a Lcd? Which libraries other than liquidcrystal can be used?
After running the code in the Arduino IDE the serial monitor does not show any thing just returning " ? ? " ,somethig like this is my i2c diplay is broken or what ?
Why are we running 128x32's code for this 128x64 display? I am confused.
It was an oversight, I guess someone posted the correct settings / code on this video, please refer that
is there a wa to see the output of the code without an oled display? like can i preview it on my laptop before displaing it on the oled display?
Is there any problem while removing the tag on the display
No it's fine you can remove that
The reason why you where getting the error is you need to go into the .h fine and comment out 128x32 and uncomment our 128x64.
That way your screen will work. As yours in the 128x64.
This is why
okay, thanks for bringing that in notice, i will add that in future tutorial video
thank you for subscribing to Mission Critical
Could you inform me where to purchase an OLed display please
I wish theres a way to put it in a powerbank as an indicator
Ofcourse there is a way to do it my man
The ic2 address finder sketch seems to have put my Nano in an endless loop. The internal led flashes constantly and i can't upload to it anymore. Any idea how to fix it?
thanks it works
Glad I could help,
Thank you for subscribing to Mission Critical
hi bro..after i done uploaded the code, the screen does not display anything..do you know why?
i try the testing display code
someone from viewers has solved this, can you check in comments? and try that, if it wont work, i will try to help you!
thank you for subscribing to Mission Critical
Not sure why but part of my display shows a yellow color on letters and some are blue.
Some display modules are built that way, nothing to do with your code
bhaiya aapne jo code instructables pe dala hai usme wire.h ka W small hai uski wajah se bohot logomko prblm aasakti hai please use change kijieye.🙏
Where can I get the instrructable post 😢
legend dude
Sir
I want to learn how to write the program
Which website is best for learn the programming
Can u plz help me
Start with Arduino's website, so that you get an idea about its basics and then start with example codes of Arduino you will eventually learn everything with trail and error!
All the very best
@@mission_critical Tq sir😇
Most welcome
When I run the script to tell me the hex port it returns nothing. I've tried running it as admin and more stuff but nothing works. I'm hoping you could tell me why?
you are my favorite indian now
😂 thanks
help wire.h has no file or directory I even installed both libraries!
Im a newby what does it mean when it says serial port not selected
Good video@@
Can I use this display with PIC16F677A
Does this also work for Arduino nano
It is showing error of spi.h and wire.h no such file or directory found pls help me......when uploading our own code
go to sketch and include library andsearch for SPI and WIRE library and give include option
@@tarun.a1742 have you use Instagram to chat with me.....
i think the W in wire has to be capitalized, and so does the SPI
It will be support or not in nodemcu. Arduino nano ??
It will be supported yes, but it all depends on your Memory size of that Chip, I am not very sure about Nano, but it might work, well, on Node MCU, it should definately work, as node MCU has way large memory than Arduino Uno, so just give it a try or wait for little time I am working on few node MCU projects I might try it in near future
Anyways thanks for subscribing to Mission Critical
can we use this one oled display for several sensors?
OLED is a display, it can display anything you want, if your sensor can send it's data to Arduino, this OLED can display it
@@mission_critical @Mission Critical okay.. is it mean if we use this one pcs oled, install in one arduino, and let say we put three sensors together the oled can show output from each sensor..? thanx for your reply..
Yes yes it will, unless you don't run out of memory space or size on OLED
In my engineering days, I have integrated 3 sensors and yet had space on display
@@mission_critical okay.. i'm new & interesting in arduino things.. and wanna start some projects with it.. wish me luck.. 🤣
thanx alot for the answers..
All the best for your projects
2:30 Thanks!
It shows error compiling for board Arduino Uno..
Plz help
can i change colors like blue or red
The display I have had no options, I don't know for sure, try looking at the datasheet of your display and read example codes with library, I hope that should help you.
Thank you for subscribing to Mission Critical
ty
How to connect node 8266 mcu
im getting an error code on your script it says it cant find .h or smthing like tht
C:\Users\matth\AppData\Local\Temp\.arduinoIDE-unsaved20231126-19176-1xjbvnp.k83p\sketch_dec26a\sketch_dec26a.ino:1:10: fatal error: wire.h: No such file or directory
#include < wire.h>
^~~~~~~~~
compilation terminated.
exit status 1
Compilation error: wire.h: No such file or directory
@@alienconcept2389Remove wire.h and put Wire.h instead
What kind of wire is that
How many lines display sir ?
Brother i need your help
Where is part two of this tutorial?
CAN SOMONE HELP ME MY SCREEN DOES NOT EVEN WORK
sir how to connect GND,VDD,SCK,SDA to arduino pro micro?
find the "arduino pro micro pinout" and connect the 4 wires, I cannot post a pic of the pinout but it has vcc, gnd, scl, and sda.
thanks .... helpful video
You are most welcome 😍
Thank you for subscribing to Mission Critical
Is it called SCK or SCl
It is the same thing, you can say "clock" as "cl" or "ck".
not leaving a link to the code is a fail!.
FYI: Q&A
I'm followed steps properly but still the error is there
thanks bro i thought that i killed my display
Want to increase OLED font size in raspberry Pi using python
i havent tried this on Raspberry pi, you need to check the Library for examples hopefully you will get some insights there!
Thank you for Subscribing to Mission Critical
Edit the library, make the fonts larger by adding more pixels to every letter
sir once the progra loaded for name display does it remains even removing controller
not sure if i understood your problem, can u clarify?
"Compilation error: wire.h: No such file or directory" wtf
Another comment says that "Wire.h" has a uppercase w and "SPI.h" is upper case as well. Hope this helps!
Next how to display shapes
sure thing, keeping that in mind!
CAN I GET THE DETAIL OF SAME OLED WITH ARDUINO DUE?
I think you just need to find 5v power supply for OLED and connect ground of power supply to ground of Arduino due, just find SCL and SDA pines for that board and you are good to go!
Thank you for subscribing to Mission Critical!♥️
Whats with the sexy voice?
maa ka pyaar aur subscribers ka dulhar,
Glad I could help!
thank you for subscribing to Mission Critical
Bro how to increase OLED font size?????
I'm printing time and want to increase font size
What I want to do?
You could try display.setTextSize(3);
The default font with the adafruit library is 5x8 characters. display.setTextSize([1-4]) will let you set the text to scale to double, triple, or quadruple size. Or you can also add your own font into it. Adafruit documentation shows how to do that. Also, you can have multiple text scales on display at the same time. So you can have the time in text size 4 filling the display height and off to the right can have AM in size 2 or something. The adafruit example sketch shows how to use it really well for writing and drawing and animating.
are you single
I ran the code to find the I2C hexadecimal address, however, my serial prints this "⸮⸮⸮0A⸮0⸮⸮0⸮,⸮⸮". I corrected the Wire. h issue but I don't know how to solve this one?
same problem here any solution??
Same Here
Most likely your baud rates are different, Serial monitors baud rate needs to be same as the one in code "Serial.begin(9600)"
@@markotandara3845 brotha, you are our savior, it works, thank you very much from the bottom of my heart
@@truck-kunmaybechan6511 glad I could help
ignore what he says about serial port. go to examples/adafruitSSD1306/ssd1306_128X64_i2c. hit control + f and seach for SCREEN_ADDRESS. change it to this #define SCREEN_ADDRESS 0x3C
your code does not compile and there is almost no instruction on "indestructible". C:\Users\ak\AppData\Local\Temp\.arduinoIDE-unsaved202401-2284-1r6i1lr.gmzm\sketch_jan1b\sketch_jan1b.ino:8:10: fatal error: wire.h: No such file or directory
#include < wire.h>
^~~~~~~~~
compilation terminated.
exit status 1
Compilation error: wire.h: No such file or directory
Many people faced the same issue, please check comments someone has posted a solution
It can use magnifier above the screen ,