Это видео недоступно.
Сожалеем об этом.

#21 Two Equal Displays on One Arduino I2C Bus (Tutorial)

Поделиться
HTML-код
  • Опубликовано: 2 сен 2015
  • In the previous tutorial I showed how to connect several devices to the same I2C bus. All devices had to be different (different sensors, different displays):
    • #20 Tutorial: Multiple...
    Here I show how you can connect two devices of the same kind to one I2C bus.
    This needs a few steps more.
    I use two Heltec SSD1306 OLED displays and a BMP085 for the demonstration.
    The content can be also used for ESP8266 or for STM32 Boards like the Maple Mini.

Комментарии • 97

  • @-MrDontCare-
    @-MrDontCare- Год назад +6

    Looks like I am 7 years late to this game. 😂Great video, now I can use both of my screens.

  • @yuchoy1
    @yuchoy1 8 лет назад +4

    This was very helpful to me, even though I am using a Nodemcu Lua devkit! I am using the cheap generic OLED displays from Ebay, but needed info on using two of them on I2C bus. Thanks!

  • @jackisgoofingoff5510
    @jackisgoofingoff5510 9 месяцев назад +3

    Is it possible to drive the third screen? Or shall I use SPI communication instead?

  • @DanielBos
    @DanielBos 8 лет назад +3

    The I²C address on the OLED isn't doubled, rather each I²C device has two addresses, one for reading, one for writing.
    To be precise, the address 0x3C is a 7-bit address. When you communicate, an 8th bit is added to indicate the direction, resulting in 0x78 and 0x79 addresses on the bus.

    • @AndreasSpiess
      @AndreasSpiess  8 лет назад

      +Daniel Bos You are right, the 8th bit is used to indicate direction.Usually you do not have to care about it because the library knows this, too. This is, why the scanner sketch only shows one address per module.

  • @countcustoms7134
    @countcustoms7134 7 лет назад +1

    Great work Andreas, This is exactly what I was looking for

  • @alphonsesynrem28
    @alphonsesynrem28 6 лет назад +1

    Just excellent guide and tuition for me. Thank you so much.

  • @XerotoLabs
    @XerotoLabs 9 лет назад

    very nice , and though not the topic , i like how you hold the small OLED . I never thought to use my extra hand stand that way .

    • @AndreasSpiess
      @AndreasSpiess  9 лет назад

      +XerotoLabs I am a lazy guy by birth! So I always search simple solutions...

  • @kevorkarackellian389
    @kevorkarackellian389 5 лет назад +1

    Another great video! Thank you.
    Would you consider adding your sketches in the future as an aid to some of us with limited programing experience? It helps me a lot to see how others code - especially if comments are included in the sketch.
    Thank you again for your work. It is a lot of effort and greatly appreciated.

    • @AndreasSpiess
      @AndreasSpiess  5 лет назад

      If there is anything to share you find the link in the description of the video. But not always ;-)

  • @ehsankeshtgar6734
    @ehsankeshtgar6734 9 лет назад +1

    very useful and informative. Thanks

  • @anthonyminiaci80
    @anthonyminiaci80 5 лет назад +1

    Hi, have you gotten this project to run in full resolution? I have done this but only in 128 x 32, when you try to run it in 128 x 64 it stalls and flashes between the 2 oled screens

  • @tristunalekzander5608
    @tristunalekzander5608 4 года назад

    This is helpful if I wanted to do the exact same thing you are doing otherwise I still have no idea how to tell my Arduino how to find my devices by their addresses.

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      There are many tutorials on using I2C on Arduino

    • @tristunalekzander5608
      @tristunalekzander5608 4 года назад

      @@AndreasSpiess I know and they're all like yours lol turns out, I'm a noob and I didn't even need to specify the addresses of my devices because they already do that in their libraries so it was just a matter of setting up the I2C bus. Though I am still confused about pull-up resistors.

  • @1larrydom1
    @1larrydom1 7 лет назад +1

    Andreas, thank you for the great video! I am trying to connect 10 identical 20x4 lcd displays to an Arduino to show the exact same information. I am not sure yet how to do this with I2C, but think it can be done after watching your video. Any ideas? Larry

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +1

      Just try it with an increasing number. Then, you see, if you will experience problems. But you have to solve the problem of addressing. Most displays only support 2 addresses.

    • @daisydomic
      @daisydomic 5 лет назад

      Where is the problem? If all should show the same then all connect to the same pins. Make sure that it is enough for everyone.

  • @bluedeath996
    @bluedeath996 7 лет назад +1

    The 128x32 OLEDS I have don't appear to have anything to change the address, is there something I can bodge wire or a software solution?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      Mine have an address selector on the back where you can change the address with a soldering iron

  • @felixbaum2180
    @felixbaum2180 5 лет назад +1

    I have to use 4 of the same sensors at once... How do i do that?

    • @AndreasSpiess
      @AndreasSpiess  5 лет назад +1

      Maybe you can change the address of the chip? otherwise, you have to use an I2C switch like the TCA9548A

  • @larryfostano6626
    @larryfostano6626 2 года назад

    Is it possible for a SSD1306 to get locked out and not display? Reason I ask is because I had a 1306 OLED working , I removed it and reinstalled it in a different Arduino nano , it no longer will display. I have checked the back of the display and there is a 662 voltage regulator on it , checking with a volt meter and 5vdc applied ,I get 5vdc to the top center and 3.3 to the lower pin and also ground. I checked the D1 with a Fluke meter and I get.535v in one direction and 1.88 v in the other direction.Thank you

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      I do not think that these OLEDs have any memory to stay locked after a power-cycle. So you either have a wrong sketch, a wrong connection, or a defective OLED. Just move it back to where it worked or replace ii with a different one and you will know if the OLED is defective.

  • @ThomasPalowitchSr
    @ThomasPalowitchSr 7 лет назад

    Nice. Short & sweet.

  • @jeophilip4353
    @jeophilip4353 6 лет назад

    Can i use this TCA9548A 1-to-8 I2C multiplexer for connecting 4no.s of mpu-6050 to an Arduino?

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      Maybe. But I assume the libraries do not work anymore. You can connect 2 6050 (you can choose between 2 addresses)

  • @ennaiarindhal3141
    @ennaiarindhal3141 3 года назад

    Can you share circuit diagram for two flow sensors and two oled connect in same nodemcuesp8266???? Help me

    • @AndreasSpiess
      @AndreasSpiess  3 года назад

      I am a RUclipsr and not a consultant :-(

  • @JshDav
    @JshDav 8 месяцев назад

    Does this only work with the Adafruit_SSD1306 library?
    I purchased some 1.54" OLEDs based off CH1116 (Advertised as SSD1309 on the listing) and I have only been able to control them using the Adafruit_SH1106G library so far.
    This is fine and I can address both of my screens set to different addresses separately, but as soon as I have both display1 and display2 initialized the screens just spit out garbage... I've been looking at a whole lot of example code and trying lost of different variations and it works if I have either screen commented out but just wont play ball with both... It's doing my head in 😅

    • @JshDav
      @JshDav 8 месяцев назад

      #include
      #include
      #include
      #define SCREEN_WIDTH 128
      #define SCREEN_HEIGHT 64
      #define OLED_RESET -1
      Adafruit_SH1106G display1 (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET)
      Adafruit_SH1106G display2 (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
      void setup() {
      display1.begin(0x3c, true);
      //display2.begin(0x3d, true);
      display1.display();
      //display2.display();
      delay(2000);
      display1.clearDisplay();
      display1.setTextColor(1);
      display1.setTextSize(1);
      }
      void loop(){
      display1.println("test");
      display1.display();
      delay(1000);
      }

    • @AndreasSpiess
      @AndreasSpiess  8 месяцев назад

      1. Does the lcode work witth one display only?
      2. Did you change the address of the second display (soldering)?

    • @JshDav
      @JshDav 8 месяцев назад

      Yes I changed the address of the second screen and without making any wiring changes I can successfully address either screen, but when try to use both at the same time they both stop working @@AndreasSpiess

    • @AndreasSpiess
      @AndreasSpiess  8 месяцев назад

      @@JshDav So it must be the library. Maybe you open an issue on their project?

  • @ennaiarindhal3141
    @ennaiarindhal3141 3 года назад

    Wiring diagram for two oled display in esp8266??

  • @CrazyCoupleDIY
    @CrazyCoupleDIY 6 лет назад

    Awesome, thats exactly what i was after

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      :-)

    • @CrazyCoupleDIY
      @CrazyCoupleDIY 6 лет назад +1

      Just one question,
      How can I attach more than 2
      Should I use the PCF8574P or is there any other way to achieve this

  • @87Edvin
    @87Edvin 6 лет назад +1

    Do you have the source code, I would like to take a look. Thanks

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      I do not have a source code, but I think, you can build your own sketch by adding the few lines of code shown in the video.

    • @87Edvin
      @87Edvin 6 лет назад

      Andreas Spiess I was more interested to see how you read the data from the i2c sensor and send it to the displays. Thanks

  • @FusselCNC
    @FusselCNC 4 года назад

    Kann man auch 2 Unterschiedliche Oleds ansteuern? hab leider 0,91" oleds erwischt ohne Bus Jumper :(

    • @AndreasSpiess
      @AndreasSpiess  4 года назад

      Wenn beide die gleiche Adresse haben brauchst du zwei I2C Busse. Ein ESP32 hat das, sonst musst du mach „I2C Expander“ suchen

    • @FusselCNC
      @FusselCNC 4 года назад

      @@AndreasSpiess ok, danke dir :) werd mal danach schauen.

  • @TaniaKisha
    @TaniaKisha 2 года назад

    What if no resistor at all?

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      Usually this is not a good idea because the device will select one of the two address (and maybe even change it from time to time)

  • @umaxr1
    @umaxr1 7 лет назад

    where do the pins of scl and sda of the oled go????

  • @moisesramirez7963
    @moisesramirez7963 7 лет назад

    Excuse me, i have been working on a project and now i need to connect two BMP 180 to the same I2C bus.
    How can i change the addresse?
    Thanks!

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +2

      The BMP180 has a unchangeable address. So, you can only attach one to your I2C bus. Ot you have to use I2C multiplexing. But then, the libraries will not work anymore.

    • @moisesramirez7963
      @moisesramirez7963 7 лет назад +1

      :( Is there any problem if i connect one BMP180 and one BMP280?
      Thanks

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад +1

      +Moisés Ram if they do not have the same address and if the libraries work together, this should work.

    • @ritzrocks98
      @ritzrocks98 5 лет назад

      I am stuck in the same problem. +Moisés Ram , Did you find an alternative to it? I have already bought two BMP 180, didn't know if this will ever be the problem

  • @Legantmar
    @Legantmar 7 лет назад

    This displays have only two different adress ?
    How can I connect 5 dispalys OLED I2C to arduino ?

    • @AndreasSpiess
      @AndreasSpiess  7 лет назад

      You can use something like that: learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview

    • @Legantmar
      @Legantmar 7 лет назад

      thank you Andreas!
      it is nice idea

    • @KunalGautam
      @KunalGautam 6 лет назад

      Thank you Andreas, this is what I was looking for. TCA9548a

  • @TaufikMasruri
    @TaufikMasruri 5 лет назад

    can i use 1 esp and display to 3 OLED display? thanks

    • @AndreasSpiess
      @AndreasSpiess  5 лет назад +1

      Why not? It also can use I2C

    • @TaufikMasruri
      @TaufikMasruri 5 лет назад

      @@AndreasSpiess did you mean can do it without other module (TCA9548A, base other comment of this video)?

  • @avejst
    @avejst 6 лет назад

    Thanks for sharing 😀👍

  • @stevemke
    @stevemke 8 лет назад

    Is the code for this demo available?

    • @AndreasSpiess
      @AndreasSpiess  8 лет назад +2

      +stevemke I put it on Github:
      github.com/SensorsIot/Two-OLEDs-on-the-same-I2C-Bus

  • @empressofmadness
    @empressofmadness 3 года назад

    wish i could do this without desodering. i'll have to use a multiplexer

    • @AndreasSpiess
      @AndreasSpiess  3 года назад

      Also a good possibility if your library supports it.

  • @paralysekid
    @paralysekid 5 лет назад

    Thank you so much

  • @grisse333
    @grisse333 4 года назад

    Und wie macht man 2 LCD mit einem Raspberry Pi ? Bitte

  • @quocna0211
    @quocna0211 4 года назад

    I need the code to connect the slaves. i am so glad when you send me the code

  • @prmajiq
    @prmajiq 5 лет назад

    where is the source

    • @AndreasSpiess
      @AndreasSpiess  5 лет назад +1

      There is none.

    • @prmajiq
      @prmajiq 5 лет назад

      @@AndreasSpiess github.com/SensorsIot/I2C_1-Video

  • @GemGamerYT
    @GemGamerYT 5 лет назад

    Bruh you saved my ass

  • @a6ustin1990
    @a6ustin1990 8 лет назад

    You should check out your thumb with a doctor.

    • @AndreasSpiess
      @AndreasSpiess  8 лет назад +1

      +Agustín Martínez I am glad that I still have it because it was nearly ripped-off my hand because it came between the chain and the cogwheel of my motor cycle. So, I have to live with it.

  • @MrSasha3050
    @MrSasha3050 6 лет назад +1

    Nothing helpful 😎, only 2 displays. If you try to make it with 4 or 6 displays thinking it will be great.

    • @AndreasSpiess
      @AndreasSpiess  6 лет назад

      Thanks for your feedback.

    • @kaoshavoc
      @kaoshavoc 6 лет назад

      You can always use one of several other communication types to lots of displays. Such as SPI. Or even using shift registers to communicate with many displays.