#20 Tutorial: Multiple Devices on One Arduino I2C Bus

Sdílet
Vložit
  • čas přidán 31. 08. 2015
  • This tutorial shows how you can connect many devices (sensors and displays) to one Arduino using the I2C bus. It starts with a simple hommade bus, shows how to find out the addresses of the different devices and ends with a demo of a system with three devices connected to an Arduino Uno: A BMP085 pressure sensor, a MPR121 touch sensor, and a SSD1306 OLED display.
    The tutorial applies also for Attiny, ESP8266 and STM32 boards like the Maple Mini
    Links:
    Level Shifters: www.aliexpress.com/item/10pcs-...
    I2C Scanner forum.arduino.cc/index.php?top...
    Example Sketch: github.com/SensorsIot/I2C_1-V...
  • Věda a technologie

Komentáře • 312

  • @valmormn
    @valmormn Před 8 lety +31

    Hey, guy with swiss accent. Your channel is very inspiring. Thanks for sharing your ideas!

  • @deangreenhough3479
    @deangreenhough3479 Před 6 lety +2

    Just come back to this video today for a refresher, My God, how very different you sound today........... oh my, how you have grown in such a short period of time, quiet astonishing!! Pat on the back required :-)

  • @TheRealStructurer
    @TheRealStructurer Před 2 lety +1

    I'm watching this in 2021 and its still valid. I must say Andreas that you sound more secure and energetic in your newer videos, so keep them coming!

    • @AndreasSpiess
      @AndreasSpiess  Před 2 lety +1

      Thank you! I should be a little more experienced after 370 more videos...

  • @drawingboard82
    @drawingboard82 Před 7 lety +7

    Very helpful, many thanks for putting the time into this!

  • @felixFPVDrone
    @felixFPVDrone Před 7 lety +1

    This episode was simple and easy to understand, even for a electronic novices like me. My main goal as a RC enthusiast is to better understand how I can utilize the I2C protocol on the flex port of my cc3d flight controller. You did a great job at explaining in detail!!!

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety +1

      Thank you for your feedback! It is always good to know that my content is useful.

  • @timmyfingaz100
    @timmyfingaz100 Před rokem +2

    For a few hours I have been struggling to get 2 screens working independently, not anymore!! Simple but effective, much simpler than what I was trying to do! Thanks :)

  • @heyhogan
    @heyhogan Před 6 lety +2

    Thanks for the quick video. I am doing a project with an OLED, Temp sensor, and ADXL345 sensor and was wondering about how to build the bus, so your example did give me some ideas.

  • @robertoeggenhoffner1552
    @robertoeggenhoffner1552 Před 6 lety +1

    Hey, guy with swiss accent, I've got an italian one.... I find very useful your teaching. Actually, I was used to plan experiments with Labview and NI instrumentation, I decided to leave both for open software and cheap devices, not only for economical concern. Thanxs for the wide presentations

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      You are welcome. Hope everything goes well...

  • @wolfrobots118
    @wolfrobots118 Před 4 lety +1

    I love the way you talk. It made it a lot better to understand. I subscribed.

  • @Really2950
    @Really2950 Před 8 lety +1

    Great video. Good for esp8266. There is also a board with ads1015 to extend the pins available on esp8266 using I2C. Good topic for video too :)

  • @alexdehmel535
    @alexdehmel535 Před 3 lety

    Super Channel, vielen Dank für die tollen Tutorials!

  • @NeoMoonlighter
    @NeoMoonlighter Před 5 lety

    Thanking the gods for guys like you helping me out with my project (y)

  • @martinkuhnl8816
    @martinkuhnl8816 Před rokem

    Andreas, das ist eine tolle Info, danke!

  • @Dextermorga
    @Dextermorga Před 8 lety +3

    so many great videos, thank you for your time and afford.

  • @foxbatx
    @foxbatx Před 7 lety +2

    Thanks for sharing and putting a very informative presentation. I truly learned something.
    - Cheers -

  • @radeonblue1816
    @radeonblue1816 Před 2 lety +2

    Again, One of the channel who is explaining the things but for beginners it is hard to grasp whatever he did as he did not showed the connections.

    • @AndreasSpiess
      @AndreasSpiess  Před 2 lety

      You are right. This is not a channel for beginners :-(

  • @ronyroy3116
    @ronyroy3116 Před 6 lety

    how do i connect max30100 & adxl345 both with arduino to get the data from both sensor. please help me.

  • @adrianglezmahe
    @adrianglezmahe Před 4 lety

    Nice and simple explanation !!!

  • @SathishKumar-if7ow
    @SathishKumar-if7ow Před 4 lety +2

    How can i say thank u....🙏🙏 THANKS from the heart💚
    Your experience and way of explaining....nut shell like me too understand... ( thank u internet & many unknown people across the world helps me to learn )
    Thank U sir..

  • @ismailkhan887
    @ismailkhan887 Před 3 lety

    Thank you.
    That is what I was looking for.

  • @castro1780
    @castro1780 Před 5 lety

    Nice job explaining the theory behind I2C without getting caught up in code

  • @pablocolladoavila3162
    @pablocolladoavila3162 Před 7 lety

    excellent explanation!!! and great video

  • @BBhashyam
    @BBhashyam Před 3 lety

    Great video and all the other videos as well. Instead of making a home made hub, can we use TCA9548A multiplexer which I read can be useful even in an address conflict situation? I am using 4 x sensors all with different addresses.

  • @PilatusPorterPC6
    @PilatusPorterPC6 Před 6 lety

    Thanks. Scanner is really helpful too. : )

  • @sphuss
    @sphuss Před 5 lety

    thanks so much - you've gpot me on the right track!

  • @BGLENN-dp4tx
    @BGLENN-dp4tx Před 6 lety

    Much appreciated AND educational. - Bill

  • @BadBite
    @BadBite Před 5 lety

    love your videos! thank you

  • @ullar8217
    @ullar8217 Před měsícem

    thanks, helpful video even 8 years later

  • @campbellmorrison8540
    @campbellmorrison8540 Před 6 lety

    Great info thank you. I am making a retrofitable shot timer for a multi group espresso machine. Each group has a counter display triggered by sensing the valvle solenoid current. the display of the group counts in seconds and stops when the group is released. Its the in thing to know how many seconds you require to deliver a shot ie 25-30ml should be around 20-25 sec this is affected by the grind and the coffee freshness. Anyway with all displays on one bus its much easier for me to add displays depending on how many groups the machine has so your video has helped me no end thank you

  • @talha_anwar
    @talha_anwar Před 6 lety

    thanks for such an awsome video. i wish to know if i need data from two sensors simultaneously, how would it be possible. i need this data then transferred to excel

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      Maybe you watch my video about transferring data from Arduino into Excel.

  • @wesleymarvelous1293
    @wesleymarvelous1293 Před 4 lety

    Excellent sir

  • @jhilam3017
    @jhilam3017 Před 3 lety

    You are life saver!!!

  • @yoannthomann
    @yoannthomann Před 6 lety

    Hello, thank you for your videos !
    I would like to make a big i2c bus (around 50m long and around 100 sensors max) for domotics (the bus will be in the walls so I would like to not have to replace the bus). What is the ideal section of the bus wires ? Do I need one or more bus extender to increase the range/stability ?

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      I do not know. Maybe you search for the specifications of the I2C bus

  • @Reda-gx6wq
    @Reda-gx6wq Před 6 lety +1

    Hello I appreciate your content, I am building a weather station with rtc clock, humidity sensor and lcd , tree of them use I2c but sometimes when I reflush the program or turn off and on the esp8266 , the i2c does not work. May you help me with this issue ? thanks

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      I cannot do remote debugging of such problems. I only suggest you try one after the other. Then you find out when it starts to create problems

  • @alexteh7067
    @alexteh7067 Před 6 lety +1

    First of all, love your channel, really eye opening and you do go into so much details. I'm wondering how to connect a single Arduino Mega to one I2c Bus to conect to multiple sensors (eg room temperature sensor, water temperature sensor, humidity sensor, automation of pumps in real time and storage of data as well as writing the sketch for them. Thanks in advance

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      You can connect up to 126 I2C devices on one bus (theoretically).

  • @JDI4DAVID
    @JDI4DAVID Před 6 lety

    I am going to be connecting a gy9255 motion sensor and a BME280 to a 3.3 V PRO MINI. I have added pull up resistors but do I really need to? Thank you for your very helpful videos.

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      With short wires and only a few devices on the same bus, they are usually not necessary. Just try.

  • @edsoncasagrande9945
    @edsoncasagrande9945 Před rokem

    I2C is good, but using with laser sensor there is a short limit on cable lenght. How can we extend it? I wonder using RS485 open colector hardware, if it possible or not?

    • @AndreasSpiess
      @AndreasSpiess  Před rokem

      You get I2C extenders. RS485 has a limit of about 1 km

  • @edwinmannaandthelearningch4450

    theres some website i went to that has all the latest devices listed with how to's on how to connect them Wi-Fi ect......

  • @user-wp7ql1iw2g
    @user-wp7ql1iw2g Před 3 lety

    Hi, thanks for your sharing, it helps a lot.
    I’m trying to connect to two identical sensors in one arduino board and print it out the same time (max30102).
    And i’m having trouble with how to print both value in serial printer separately.
    How do i write them on the code?
    Thanks.

    • @AndreasSpiess
      @AndreasSpiess  Před 3 lety

      Unfortunately, I have no time for consulting. But I am sure you will find a solution yourself.

  • @artur19846
    @artur19846 Před 8 lety +4

    Das Video war wunderbar! I was intersted in connecting multiple devices to a single Arduino and came across your video. Very informative. Thank you a lot. By the way, how many devices (practically) can run a single Arduino nano?

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety +2

      +Arthur K I never tried. If properly terminated it should be possible to connect more than 10 devices with a short bus length. Theorretically it is much more. Details are discussed here:
      electronics.stackexchange.com/questions/181953/how-many-i2c-slaves-can-a-i2c-master-support

  • @eastern815
    @eastern815 Před 3 lety

    Thank you Sir.

  • @GameAndJokes
    @GameAndJokes Před měsícem

    I have a question and i hope i can find an answer basically we directly connect all the scl and sda pins in the same connection? like the wires are connected together of the Oleds and the they are connected directly to arduino scl and sda?

    • @AndreasSpiess
      @AndreasSpiess  Před měsícem

      I do not understand :-( Just look at the diagrams on how to connect the chips and signals.

  • @azolalesedi3191
    @azolalesedi3191 Před 4 lety +1

    great video
    how would i connect one current sensor to measure the variables from different devices e.g power supply,solar panels etc

    • @AndreasSpiess
      @AndreasSpiess  Před 4 lety

      The usual current sensors can only measure one source. So you need many of them.

    • @azolalesedi3191
      @azolalesedi3191 Před 4 lety

      @@AndreasSpiess okay thank you

  • @TiagoSilva-xf7it
    @TiagoSilva-xf7it Před rokem

    I really appreciate it your video

  • @b9robot01
    @b9robot01 Před 7 lety

    Hello Andreas, I am completely new to these type of displays and sensors but I must say that your videos are the best I have found to help me learn. I want my first project to have 2 or 3 0.96 OLed displays, each showing a different sensor output, like temp and humidity on one, time and date on the next, and on the third maybe a spectrum analyzer. Watching your videos has given me the confidence to try. I do have one question though. On this video you talk about making an IC2Bus, what is a IC2 Bus and how did you make them, that part of the video went by a little too fast for me.Thank you from a fan.

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety

      Thanks for your nice words!
      Maybe I referred to my video #12. I just Suber glue a few headers with four pins together and connect them with 4 wires (soldered). Then, I can plug as many I2C devices in and all run in parallel.

  • @edu_asmaus
    @edu_asmaus Před 5 lety

    excellent work. awesoma

  • @shrikantnikam2426
    @shrikantnikam2426 Před 2 lety

    I hope you will reply :) , I use 5 arduinos displays 5 sensor values on single i2c display it is situated 12 foot from arduinos , but at the display i want to tap data coming to display and serial print on arduino connected for tapping data it display address is 0x27 is it possible?

    • @AndreasSpiess
      @AndreasSpiess  Před 2 lety +1

      Maybe this is possible, but you have to program everything yourself. If your Arduino at the display is programmed as a slave with another address you could send all the commands to 027h as well as to the address of the Arduino. But the Arduino needs to be programmed as a slave (different library)

  • @XerotoLabs
    @XerotoLabs Před 8 lety

    very clear and thorough . i like how you did the bus.
    i think the fastest i have pushed a UNO and Nano was 400hz in I2C . for most things its 1 line of code . i was driving 2 dual Adafruit stepper motor control boards and a OLED on 1 buss .

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety

      +XerotoLabs I never looked on bus speed, because I never run into problems which I was able to attribute to speed issues. So, it is good to know how fast it goes.
      Usually, I had more issues with some sort of overall functionality...
      I use the "bus principle" with hot glue for many other things like power supply or debugging. This topic is on the list for a future video.

    • @XerotoLabs
      @XerotoLabs Před 8 lety

      +Andreas Spiess i looked up what i did last time for faster speed for stepper motor controls. :
      in your setup() , use this
      TWBR = ((F_CPU /400000l) - 16) / 2; // Change the i2c clock to 400KHz

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety

      +Andreas Spiess Good to know and very simple. I think, to include this line of code in each sketch is not a bad thing to avoid any speed issues.

    • @XerotoLabs
      @XerotoLabs Před 8 lety

      +Andreas Spiess i think you have to have Wire.h included too , but i think you need that just for I2C anyhow . I'm not sure why the default (IIRC) is 100KHz , i wonder now if there are other timing issues like on a ESP 8266 using I2C is supposed to some how slow the WiFi , i have not tested that .
      I have to say i like your buss on a wire . gives me reason to order some colored headers now.

  • @paulfleck2435
    @paulfleck2435 Před 5 lety

    Great Video! One question: I need to use an Arduino with many identical motor shields (It will have more motors than one shield can handle). How do I change the address of the motor shields so they are not identical? Any ideas? Thanks!

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      Your shields either allow that or you have to use a special I2C extender. Then you also have to change your code to address the respective shield first.

  • @NerdMusician
    @NerdMusician Před 6 lety

    Great video! Can I use 16 Oled displays with this technique?

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety +1

      If your displays have different addresses, yes. But usual displays only have 2 addresses to select from

  • @paulodinis1981
    @paulodinis1981 Před 3 lety

    hello from Portugal. i just watched your video to ltry to learn something more about i2c.
    the main reason is to make some i2c devices work on flight controller i2c bus.
    i have some detected in betaflight and some detected in inav. i know devices are working, but not correctly deteted and i dont understand, why?
    i bet is fw related issue

    • @AndreasSpiess
      @AndreasSpiess  Před 3 lety

      Unfortunately, I cannot do remote debugging. But you should be able to exchange teh FW with a I2C scanner sketch to find out more.

  • @pakojaure
    @pakojaure Před 6 lety +1

    Hi, A very helpful video, thank you! I am trying to use two accelerometers MPU6050 with an Arduino nano that only has one port for SCL and SDA, but I am confused because in some forums say that is needed to add pull-ups resistors with each SCL and SDA, is that right? Because how you doing it you don't need the resistors and looks easier! Thank you!

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety +1

      +Paco J Theoretically, you need pullups. Practically you can try without them. If you have problems, you still can add them. There is usually only one I2C bus, because you can connect many devices.

    • @pakojaure
      @pakojaure Před 6 lety +2

      Andreas Spiess thank you Andreas! I have already figured out that I don't need to use the pull-up resistors because the accelerometer MPU6050 already have them, each one about 4.4K ohms for SCL and SDA. Thank you again, you helped me a lot to understand about I2C. Greetings from Mexico!

  • @jonvannatto
    @jonvannatto Před 8 lety

    Again, great information in this video. Are you able to share the setch for this project as I have all the components and would like to build it. Also thanks for the link to the I2C Scanner. Very handy.

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety +2

      +Jon Vannatto I put the example sketch used on github: github.com/SensorsIot/I2C_1-Video

  • @mohamedfezari4955
    @mohamedfezari4955 Před 6 lety

    Thanks for teh Video, I wouldlike to connect 3 3-D accelerometers MPU6050 to one arduin using I2C Bus how can I do it

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      MPU6050 only have 2 selectable addresses. So it is not easy to connect 3 to the same I2C bus

  • @khalmaxroboticsgh3176
    @khalmaxroboticsgh3176 Před 4 měsíci

    I'm working on a 4wd robot car using Arduino Mega. I am trying to synchronize the speed of all 4 wheels of the robot. I intend to read the motor speed from each motor using an AS5600 hall sensor. That means 4 hall sensors in all. I also realised the arduino mega has only one sda and scl pins so this tutorial is helpful. Can you also help me with more tips and advise on how to go about it?
    Thanks

    • @AndreasSpiess
      @AndreasSpiess  Před 4 měsíci

      I share my knowledge on CZcams and do not do individual consulting :-( Good luck with your project!

  • @timm3802
    @timm3802 Před rokem

    Hi Andreas. Thanks for a great video - Do you have any information video how to use MultiMaster on I2C? Maybe some code examples?

  • @michaelpadovani9566
    @michaelpadovani9566 Před 7 lety

    Thank you so much for this informative video. I am planning on putting together the following on I2C Bus: DS3231 (RTC), BMP180, and ESP8266. Do I need to worry about adding or disabling pull-up resistors for this setup? Thanks in advance! Cheers from Maryland, USA.

  • @deshraj9633
    @deshraj9633 Před 6 lety

    awesome man

  • @nousagi7437
    @nousagi7437 Před 7 měsíci

    Hey Andreas, I just remembered 5 years later you had a video just like this, I'm planning to have an ESP32 master with ATTINY85 slaves, which each will take an analog input from a soil moisture capacitive sensor, I'm planning to do an array of these bundles for some plant pots and monitor each of them, and have the information sent through the same bus. Is it possible to assign an address to all slaves and access them in the order I prefer? And what would be a good method to buffer the I2C bus in case my cables are getting too long?
    Would really appreciate a reply from you, and thank you for all the content you upload, it's really interesting

    • @AndreasSpiess
      @AndreasSpiess  Před 7 měsíci

      I once made a video where I used slave ATtinys as ultrasonic distance sensors for my robot. Maybe you watch it?

  • @Elettronica-xt7nm
    @Elettronica-xt7nm Před 5 lety

    Beautiful Video, very interesting. I wanted to ask if it was possible to manage 32 relays over WiFi with more MCP23017. Thank you very much for the attention.

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      Seems to be possible with a Pi. So it also should be possible with an Arduino: czcams.com/video/m83UdW67hVY/video.html

  • @iantang2048
    @iantang2048 Před 2 lety

    Hi! I am new to arduino, and I have a project that need to connect multi Tof10120 sensor in one UNO and I am quite confused right now. May I know where to start or would u kindly give me some advice? Thanks!

    • @AndreasSpiess
      @AndreasSpiess  Před 2 lety

      I suggest to enter "Tof10120 Arduino" into Google and you will find a lot of projects.

  • @R_Alexander029
    @R_Alexander029 Před 8 lety

    Great video. Quick question, do you need to add pull up (or pull down) resistors for SCL and SDA?

  • @yousef30001
    @yousef30001 Před 4 lety

    Great information. I want to use 9 Laser measuring sensors ( VL53L0X sensor ) in 1 Arduino mega controller. I need to see the results and read them at the same time. how possible?

  • @techsilv5170
    @techsilv5170 Před 4 lety

    Hi great videos
    Just a question. Is it possible to connect 2 or more 16x2 lcd display and give them different messages

    • @AndreasSpiess
      @AndreasSpiess  Před 4 lety

      Should be possible to create a second display ( Adafruit_SSD1306 display2(OLED_RESET); ). But I did not try

  • @reednoel9418
    @reednoel9418 Před 6 lety

    @andreas Spiess,
    Please show me, how many LCD i2c can connect with Arduino Mega2560. I want connect with 14 lcd I2C, how to promotion. Thanks

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      This is a big topic. You have to google. I2C has 126 addresses, but most devices only have 1, 2 or 4 selectable addresses. So you can only connect this number of devices to one I2C bus.

  • @simonthewarrior59
    @simonthewarrior59 Před 4 lety

    Hi andreas! Thanks for sharing all your knowledge. I'm working in a project with three i2c devices connected to the arduino. For now i'm working with only 2, an oled display just like the ones you used here, and a MPU6050 accelerometer module. The problem is that I'm using a library to deal with the display (OLED_I2C.h), and other libraries to deal with the accelerometer (I2Cdev.h and MPU6050.h) wich depend on Wire.h. I think the use of the bus by these libraries are in conflict because they work separately but not together. What do you suggest?

    • @AndreasSpiess
      @AndreasSpiess  Před 4 lety +2

      I suggest to try it out. It should work if the addresses are different

    • @simonthewarrior59
      @simonthewarrior59 Před 4 lety

      @@AndreasSpiess Yes, I'm still working on that. Thanks for replying!!

  • @covingtonkua9404
    @covingtonkua9404 Před 3 lety

    Hello, I wanted to connect arduino micro (Master) to arduino nano(slave) and LCD I2C (Slave), both need SDA and SCl, is it possible to do it? Been searching around for quite a while now. Pls let me know thank you

    • @AndreasSpiess
      @AndreasSpiess  Před 3 lety

      Cut the problem in two and try first the LCD. If it works you search for the Arduino I2C slave software and try it out without the LCD. If both work and do not have the same address you can connect both slaves to the same lines.

    • @covingtonkua9404
      @covingtonkua9404 Před 3 lety

      @@AndreasSpiess thanks for the reply, will try it out soon.

  • @andrekotze6050
    @andrekotze6050 Před 5 lety

    Hi Andreas, I do not know how many, but I have watched A LOT of your video's. CHEERS for the good work you do!!! always well presented!!! I have a question. Can one add libraries, initialise peripherals (LIKE LCD) or restart a device from code without resetting the arduino? Lets say my LCD lost sync because of momentary power loss, how can I get this going again with code?

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      You could maybe try to initialize the LCD from time to time. But this most probably will result in flickering. So maybe you connect both power supplies. Then both will lose power at the same moment.

  • @rafigarden7824
    @rafigarden7824 Před 3 lety

    I might miss it..but do u have the wiring connection please

  • @nektarioskourakis8331
    @nektarioskourakis8331 Před 5 lety

    thanks for the tutorial from chania crete....

  • @patprop74
    @patprop74 Před 6 lety +2

    Doctor Goggle hahah Nice! very informative ! I learn more in 7 mins with your explanations then I did with Dr Goggle.

  • @babybillen2
    @babybillen2 Před 5 lety +1

    Is it possible to connect multiple TSL2591 to one arduino? they have the same address, but it can't be changed right?

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      The Adafruit specs say: This board/chip uses I2C 7-bit address 0x29 (fixed)

    • @africantech5
      @africantech5 Před měsícem

      I have put two LCD before and Both has same address and it works

  • @StarStudios007
    @StarStudios007 Před 6 lety

    I connected two oled display with same model....ssd1306....I tried to display two different things in each. But the i2c scanner shows only 0x3c address....I connected all the wires in same port for both displays.....help

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety +1

      Each display has to have its own address. There is a resistor on the Oleds to change the address. Needs soldering.

    • @StarStudios007
      @StarStudios007 Před 6 lety

      Andreas Spiess it worked perfectly....thank you

  • @MadTinker
    @MadTinker Před 6 lety

    New to Arduino and this was great! Can I ask what you were using for pressure and temperature display?

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      Thanks! I used a GY-65 board containing a BMP085 chip

    • @MadTinker
      @MadTinker Před 6 lety

      Andreas Spiess Thanks for the quick response. I should have been clearer in my question. I was interested in the display and not so much the sensors.

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      This is the display: bit.ly/2h2831l

  • @pocket_science_
    @pocket_science_ Před 5 lety

    Could you throw some light on the "home-made" I2C device you created using male headers. How does it act as a I2C device? Thanks.

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      This was only a connection between the different wires.

    • @pocket_science_
      @pocket_science_ Před 5 lety

      @@AndreasSpiess how does it act like a I2C device? What about its address?

  • @hubertmargreiter3508
    @hubertmargreiter3508 Před 3 lety

    Like all of your videos, also this one is very educational. Thanks for uploading!!
    But how do you approach the problem if you want to transfer 128 bytes from a slave node to a master (e.g. Arduino or Teensy)?
    Do you know of any link that might help me with a code fragment?

    • @AndreasSpiess
      @AndreasSpiess  Před 3 lety +1

      You can try it with I2C (one as a master, the other as a slave. I did this in an old video where I had 3 ultrasound detectors connected to a ATTiny asa slave. Or you use Serial. I use an ESP32 and WiFi...

    • @hubertmargreiter3508
      @hubertmargreiter3508 Před 3 lety

      Thanks, I will check :)

  • @anaaremere2mere
    @anaaremere2mere Před 7 lety

    Hello, I am new in Arduino and I was wandering if using I2C Bus I can connect together 15pcs DHL22 sensors, 10pcs MQ2 sensors, 5pcs flame sensors,......and I will stop here. Basically I am trying to create an automation for a new house. I would like to monitor temperature, humidity, gases, fire detection, blind open/close, dimmable light, some proximity sensors to detect if doors are open or closed. Is this possible as DIY or I am dreaming to big?

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety

      I2C buses can be used to connect many devices over the distances of a house. However, it is rarely used for that purpose.
      There are many videos and other sources about Home Automation on the internet.

  • @mousumimandal5464
    @mousumimandal5464 Před 5 lety

    Sir, i need to interface three DAC modules with arduino that will produce sine waves at 120 degree phase shift with variable frequency. . I m bit confused with it.. can u help me kindly? ::")

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      Maybe you solve the problem step after step. Find a DAC. Connect it. Produce a sine wave and check if you get to the needed frequency...

  • @Dream0Asylum
    @Dream0Asylum Před 5 lety

    I love abbreviations that are no shorter than what they're meant to stand in for.

  • @thekaiser1492
    @thekaiser1492 Před 6 lety

    Maestro!!

  • @umeruz
    @umeruz Před 7 lety

    i need to monitor 100 DS18B20 temperature sensors using a central arduino. is it possible..? if yes, please help me out.

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety +1

      I never worked with this device. So, I do not know. Maybe you check if somebody did it with 10 and see, if there were any problems and how he resolved it.

  • @refusneant
    @refusneant Před 6 lety

    clear ,thanks

  • @victorarmani6660
    @victorarmani6660 Před 8 lety

    Hi Andreas,I'm in the process of building a heat exchanger that requires 45 SHT31 sensirion sensors to measure temperature and humidity accurately. The sensors have i2c and voltage output capabilities. I prefer to use i2c, but would I be able to connect this many sensors? Also, I'll need the wires to run from within the tubes to the outside of the heat exchanger to the controller i.e. arduino, rasberry pi etc. The maximum length of cable is 900mm. Would this distance be of concern i.e. noise, interference etc? I'm not worried about cost, but would like to purchase equipment that would definitely work for my project. I would appreciate your thoughts. Regards,Viktor

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety

      +Viktor Armani Hi Viktor.
      1. Theoretically you can connect up to 127 devices to the I2C bus. But all have to have their own address. Unfortunately, a SHT31 can only select between 2 addresses. So, you only can connect two devices to one I2C unless you find another way to select between them. (see chapter 3.4 of the SHT3x data sheet for a proposal). This proposal needs a distinctive line to each sensor in addition to the 4 wires of I2C. www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_and_Temperature_Sensors/Sensirion_Humidity_and_Temperature_Sensors_SHT3x_Datasheet_digital.pdf
      2. I think, 900 mm is way too short. See this aricle where they were able to get up to 100 meters: www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/i2c-bus/frequently-asked-questions/i2c-faq.html
      Hope this helps ;-)

    • @victorarmani6660
      @victorarmani6660 Před 8 lety

      +Andreas Spiess Thanks for your detailed response. I've sorted out the multiple devices/address issue by using a TCA9548A 12C multiplexer. The second part I'm still working on i.e. length of cable/s.

  • @aseemparambennykukkarlive4501

    hello sir can you tell me the value of the resistor I lost mine one

  • @ecemcl1497
    @ecemcl1497 Před 6 lety

    Hello! We are working on a project using two mpu6050, temperature sensor, and a pulse sensor. How to put these all together into one Arduino Nano? Please help us. Hoping for your answer. Can we talk thru e-mail? :)

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      You can connect many sensors to one I2C bus of the nano. Just make sure that the two MPU6050 have different addresses (ADO pin)

  • @s-max3277
    @s-max3277 Před 6 lety

    Hello for monitoring two voltage 0-100V or 5-100V wath i2c ic suggest ?

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      I do not work with such high voltages, so I do not know.

    • @s-max3277
      @s-max3277 Před 6 lety

      Andreas Spiess need use
      Analog input ?
      Digital is impossible ?

  • @artur19846
    @artur19846 Před 8 lety

    Hallo! Does the I2C bus need independent power supply? I don't think that a single Arduino Uno's power will be sufficient for multiple devices.

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety +1

      +Arthur K The I2C bus (SDA, SCL) does not need a power supply, the devices connected to it have to set the signal level. This is why the devices have to be powered.

    • @artur19846
      @artur19846 Před 8 lety

      +Andreas Spiess Thanks! It got a bit clearer. Actually, I was thinking about deploying an outdoor weather station based on solar power and connecting to it multiple sensors (temp, humidity, pressure etc.)

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety +2

      That should be no problem. You need a rechargeable battery, some sort of solar panel with a regulator, and an Arduino. The Vcc of the sensors can then be conneted to the 5V or the 3.3V rail of the Arduino (depending on the needs of the sensors).
      The same applies to an ESP8266 if you need WiFi to connect your weather station.

  • @tienbuivinh5230
    @tienbuivinh5230 Před 6 lety

    Thanks for your video.
    Now I am wondering if I have 2 same sensors and want to connect to just one Arduino board, How can I change the address of those sensors. Can you make another video about how to do it?

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      Most of the chips have address pins where you can select amongst 2 or 4 addresses. Always read the datasheet of the sensor chips.

    • @tienbuivinh5230
      @tienbuivinh5230 Před 6 lety

      I am using the AM2315 sensors and could not find anything about changing the sensors' addresses via Hardware in the datasheet. I am looking for changing those sensor's address by programming. Still stuck. Could you help me on it?

    • @AndreasSpiess
      @AndreasSpiess  Před 6 lety

      You cannot change it through programming unless it is described in the datasheet. But only very few sensors can do that.

  • @Son_of_Yahuah
    @Son_of_Yahuah Před 5 lety

    I have a project where Im interfacing with at least 12 arduinos 1 being the Master .I think I have to use pull ups for power or a main power hub for all the arduinos . I like the part in the video about finding the names of each and having to write the code for each one ,,,trust me its just as bad as Im explaining it I already have a head ache lol. thanks for the video

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      You are welcome. Seems to be a quite big project ;-)

  • @3dmixer552
    @3dmixer552 Před 5 lety

    can I use 2 INA219 on 1 I2C Bus using ESP32?

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      The INA219 offers 16 slave addresses. If you chose two different addresses it should be possible. Please read the data sheet

  • @JanHans
    @JanHans Před 8 lety

    i love this video. never expect this would work against being homesick.

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety

      +Jan You have to help me with the connection between I2C and homesick!

    • @JanHans
      @JanHans Před 8 lety

      Ich lebe momentan in Irland und da hatte ich die komische Idee, eine Eier-Inkubator-Steuerung zu bauen. Als kompletter Anfänger schaue ich viele Videos bei CZcams an. Deines, weil ich ein I2C-Display und ein RTC in meinem Projekt verwenden möchte. Mit dem Schweizer Akzent war das dann besonders nett zu schauen. Danke!

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety

      +Jan aha. Jetzt verstehe ich! Wir waren letztes Jahr in Irland in den Ferien. Uns haben Land und Leute sehr gefallen.

    • @JanHans
      @JanHans Před 8 lety

      Irland ist perfekt zum Ferien machen, leider aber weniger gut, um hier zu leben. Politisch kommt das Land wenig voran. Es gibt grosse Defizite, was die Infrastruktur anbelangt...

    • @AndreasSpiess
      @AndreasSpiess  Před 8 lety

      Das ist schade. In den Nachrichten hören wir, dass es Irland wirschaftlich gut gehe und dass die Arbeitlosigkeit sinke. Und das wäre ja schon mal was verglichen mit der Situation kurz nach der Finanzkriese...

  • @ManuelCastillo-kq3xy
    @ManuelCastillo-kq3xy Před 5 lety

    Hi, I tried to use your i2c Scan, but not compiling.
    Error is:
    Arduino:1.8.7 (Mac OS X), Tarjeta:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Enabled, 4M (3M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
    /Users/manuelcastillo/Documents/Arduino/i2c_scan/i2c_scan.ino: In function 'void I2Cscan()':
    i2c_scan:171:7: error: 'TWBR' was not declared in this scope
    TWBR = (F_CPU/(speed[s]*1000) - 16)/2;
    ^
    exit status 1
    'TWBR' was not declared in this scope
    I use a ESP8266 Lolin v3. I need use 3 devices with i2c. Help me, please.

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      You have to search for an I2C scanner for the ESP8266.

  • @mammoumanel3267
    @mammoumanel3267 Před 7 lety

    i have 20 sensors with the same adress, how can i connect them?

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety

      Something like that could help: www.nxp.com/documents/data_sheet/PCA9547.pdf

  • @DevineIshaq107
    @DevineIshaq107 Před 7 lety

    Andreas it was intuitive . gave me a lot of insite and I am on the gateway to build the robotic suit for my grand child ,, as he has walking issues. Uncle google has many sketches for IMU 6500 but all of them give errors and are erratic.
    In my project there are 6 steppers for ankle knee and thigh and one for the back swing left right front back as he is not stable.
    will be using imu for his stability and will manage his walking . It is a difficult project and will need your generous input for using the i 2 c as there are too many things to take care of 3 imu units 8 steppers and walking route en turn around sitting standing etc etc. I am hoping for a generous Charity of knowledge Please

  • @PetrasL_1976
    @PetrasL_1976 Před 7 lety

    Hi,
    I saw you have built your own i2c sensor with 3 ultrasonic sensors. But you did some programming on atiny, soldering and so on. Just wondering, if there are already build "converters/adapters" or something like this for regular sensors like "Soil Humidity Sensor" (lets say this goo.gl/RS92Fx).
    Thanks!

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety

      What is your intended scenario? usually, these sensors are connected directly ot a analog or digital pin of a Arduino without ATTiny needed.

    • @PetrasL_1976
      @PetrasL_1976 Před 7 lety

      Yes its ok to connect them directly. Just thinking what if i need 10 of them? I do not have 10 analog on inputs on arduino mini. And scenario is apsolutely crasy: i have 10 flowerpots with plants and i want to keep different moisture for each of them. Watering will be automated also... :) Probably i need separate arduinos or esp for each of flowerpot, but then i need 10 water pumps too for watering...

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety +1

      There are many different solutions to that. But if you have 8 ADC pins on one Arduino mini and you pay 4$ for such a mini, each plant costs only 50c. Which sounds reasonable to me. One ESP8266 per plant and a connection via Wi-Fi sounds more expensive... But the pump/walve and wiring issues are probably the biggest ones.

  • @jorgeparada2061
    @jorgeparada2061 Před 6 lety

    xcelent!

  • @simnsch
    @simnsch Před 7 lety

    Any chance to use 5 different I2C sensors with a TFT ILI9320 Driver?

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety +1

      I do not know, but I think, this TFT controller has no I2C. connection. So, the sensors and the display have nothing to do with each other.

    • @simnsch
      @simnsch Před 7 lety

      Yes, you are right. The TFT connects as it is, and the I2C sensors will go through the same bus. The components worked well when tested individually, and the puzzled thing is when all of them runs at the same time the TFT will not run. Do you have any idea why?

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety

      No. This cannot be found out over distance.

    • @simnsch
      @simnsch Před 7 lety +1

      Thank you for your reply and help. I will sort it out and perhaps let you know again if I have successfully done it.

  • @gouthamvirigineni348
    @gouthamvirigineni348 Před 7 lety

    Sir I am a big fan of your blog. Presently I'm working on a project called gesture glove. In this project i want to integrate 5 MPU-6050 Sensors. The problem is I could connect only 2 MPU's, as MPU-6050 has only 0x68 and 0x69 addresses. Could you please tell me how to connect 5 MPU's to one arduino nano using i2c bus process.

    • @AndreasSpiess
      @AndreasSpiess  Před 7 lety

      Thanks for your comment. You can use this chip to solve your problem: www.nxp.com/documents/data_sheet/PCA9547.pdf

    • @Manjuju123
      @Manjuju123 Před 7 lety

      Goutham Virigineni I am having the same question but couldn't you just pull the address pin to a high using a digital io on the sensor you want to read and leave the other 4 sensor address pins to low? This should work right?

    • @gouthamvirigineni348
      @gouthamvirigineni348 Před 7 lety

      Yes it worked for me by using a multiplexer IC, I was able to select the required addresses. I used different array's for storing different sensor's data. I used a multiplexer in order to reduce the number of pins to address the different sensors.
      Please feel free to visit my channel (goutham virigineni).
      Th@nk you.

  • @kiranshashiny
    @kiranshashiny Před 7 lety

    Can I connect multiple DHT -11 temperature sensors to the Arduino's IIC bus.
    The problem is they do NOT have a SCL pin, but only a DATA pin.
    How do I go about it.

  • @AGeekNamedRoss
    @AGeekNamedRoss Před 5 lety

    Do you want to get new subscribers, because that's how you get new subscribers? Great video. I like the I2C mini back-plane idea using simple headers and hot-glue.

    • @AndreasSpiess
      @AndreasSpiess  Před 5 lety

      I just crossed the 100'000 subscribers. Back then when this video was made I was probably more at 10'000. So it obviously worked ;-) Welcome aboard the channel.