S-0007: Difference between revisions

From 52Pi Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
==0.91 Inch OLED Module==
==PiOLED (0.91 Inch OLED Module)==
[[File:OLED4.jpg|right|320px]]
[[File:OLED4.jpg|right|320px]]


Line 32: Line 32:
==Package Includes==
==Package Includes==
* 2* 0.91  Inch OLED Module  
* 2* 0.91  Inch OLED Module  
* 2* 10Pin male to female breadboard wire
* 2* 5Pin male to female breadboard wire
 
==How to use==
==How to use==
===How to wire it up===
===How to wire it up===
Connect OLED module to Raspberry Pi's GPIO(3.3v,SDA,SCL,GND)
Connect OLED module to Raspberry Pi's GPIO(3.3v,SDA,SCL,GND)
===Pin Definitions===
[[File:OLEDDef8.jpg|left|500px]]
<br style="clear:both;">
----
----
===How to program it===
===How to program it===
First of all, you should turn on I2C function on your Pi by editing /boot/config.txt file.<br>
===For Raspberry Pi 4B===
<code>sudo vim.tiny /boot/config.txt </code><br>
* Turn on i2c function by using:
make sure you can find this parameter:<br>
<code>sudo raspi-config</code> -> <code>interface options</code> -> <code>i2c</code> -> <code>enable</code> -><code> yes</code><br>.
<code>dtparam=i2c_arm=on</code><br>
* Check if the screen has been recognized by Raspberry Pi
And don't forget to reboot your Pi.<br>
<pre>i2cdetect -y 1 </pre>
* Login your Pi and download driver:<br>
** If encount command not found error, please install i2c-tools by using:
<code>git clone -b ArduiPi_OLED  https://github.com/yoyojacky/libssd1306</code>
<pre> sudo apt update && sudo apt -y install i2c-tools</pre>
*Compile it and run:<br>
*Install dependencies libraries:
<code>cd  libssd1306/ </code><br>  
<pre>sudo apt -y install python3 python3-pip python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5</pre>
<code>sudo make </code><br>
* Grant privilleges to user pi
<code>cd  example/</code><br>
<pre>sudo usermod -a -G gpio,i2c pi</pre>
<code>sudo make</code><br>
* Download sample code from this repo:
<code>sudo ./oled_demo -o 2 </code><br>
<pre>git clone https://github.com/rm-hull/luma.examples.git
if you need help, you can just use this command:<br>
cd luma.examples/
<code>sudo ./oled_demo -h </code><br>
</pre>
** More documents:
* Install the dependencies
* Download SSD1306 OLED display Arduino library from Github: [ https://github.com/adafruit/Adafruit_SSD1306 ]
<pre>sudo -H pip3 install -e . </pre>
* Entering into example folder and test it.
<pre>cd luma.examples/examples/
python3 sys_info.py
</pre>
* You should seen this screen on OLED.


==FAQ==
==FAQ==

Latest revision as of 18:45, 17 February 2022

PiOLED (0.91 Inch OLED Module)

OLED4.jpg

Description

This display is made of 128x32 individual OLED pixels.
It communicates with Raspberry pi or Arduino series products via I2C protocol.
Compatible with most of MCU which support I2C protocol support.
There are mounting hole and female pin header on the PCB, so that you can fixed it to Raspberry Pi with screws and nuts.

Features

  • Easy to use
  • Low power consumption
  • Easy to assemble and fixed
  • Less GPIO pin occupation

Specifications

  • Device Register Address: 0x3c
  • Resolution: 128 x 32
  • Work Voltage: 3.3V
  • Communication Protocol: I2C
  • FP frequency: less than 1 fps
  • Wide range of operating temperature: -40°C to 85°C

Dimension

OLED7.jpg


Gallery

OLED1.jpg
OLED2.jpg
OLED3.jpg

Package Includes

  • 2* 0.91 Inch OLED Module
  • 2* 5Pin male to female breadboard wire

How to use

How to wire it up

Connect OLED module to Raspberry Pi's GPIO(3.3v,SDA,SCL,GND)

Pin Definitions

OLEDDef8.jpg



How to program it

For Raspberry Pi 4B

  • Turn on i2c function by using:

sudo raspi-config -> interface options -> i2c -> enable -> yes
.

  • Check if the screen has been recognized by Raspberry Pi
i2cdetect -y 1 
    • If encount command not found error, please install i2c-tools by using:
 sudo apt update && sudo apt -y install i2c-tools
  • Install dependencies libraries:
sudo apt -y install python3 python3-pip python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5
  • Grant privilleges to user pi
sudo usermod -a -G gpio,i2c pi
  • Download sample code from this repo:
git clone https://github.com/rm-hull/luma.examples.git
cd luma.examples/
  • Install the dependencies
sudo -H pip3 install -e . 
  • Entering into example folder and test it.
cd luma.examples/examples/
python3 sys_info.py
  • You should seen this screen on OLED.

FAQ

  • Question: why does it not show anything that I've tried as your instruction?
    • Answer: Please make sure you have already open your i2c function and you can use this command to detect whether it has been turned on already.
    • i2cdetect -y 1

Application Senario

  • There is a maker made a funny thing called "mobile pi" with this 0.91 Inch OLED Module, you can check it by accessing following link:

[Mobile Pi | https://www.instructables.com/id/My-Fantastic-MobilePi/ ]