Electronic Basics #19: I2C and how to use it

Sdílet
Vložit
  • čas přidán 27. 02. 2016
  • Previous video: • 3D Printing Beginners ...
    Facebook: / greatscottlab
    Twitter: / greatscottlab
    Support me for more videos: www.patreon.com/GreatScott?ty=h
    In this episode of Electronic Basics I will present you the most important facts about the communication protocol I2C and how to use it with an Arduino.
    Music:
    Killing Time, Kevin MacLeod (incompetech.com)
  • Věda a technologie

Komentáře • 298

  • @alexkepa12
    @alexkepa12 Před 8 lety +56

    Well, I'm still confused... I guess I have to do things myself to actually understand

  • @KennethTanFotografie
    @KennethTanFotografie Před 8 lety +239

    For me you moved away to quickly from the I2C theory and got to involved in the radio module. I'd rather have seen you explain how the bus works with single and multiple devices. Although I could follow what you were explaining, I believe it's going to be to complex for a lot of viewers.
    I compliment you anyway on doing an excellent video. Presentation and detail were precise and professional.

    • @rickyarinugraha
      @rickyarinugraha Před 8 lety +12

      +Kenneth Tan Agree with you on that, sir.
      I was completely lost when you explain about those bit ordering.

    • @RobertShaverOfAustin
      @RobertShaverOfAustin Před 8 lety +9

      +Kenneth Tan I think that explaining very technical subjects such as the detailed bit order used in I2C is not easy in a video. I learned electronics before I went to university and became an engineer mainly by reading the manufactures specification documents. This was in the '60s and '70 so no Internet, CZcams or Facebook. I would write to the manufacturers and ask them for data sheets and catalogs. When they came I would read them over and over and over trying to understand the meaning of all those words and numbers.
      Now you don't have to write to the manufacturers but, if you want to really understand what these parts do, you should use the Internet to find the data sheets, catalogs and application notes.
      For example, here's the I2C web site with very detailed explanations of how it works. (i2c.info/i2c-bus-specification) It can be a bit overwhelming but if you keep at it *AND* watch videos like this one, you will figure it out. For me, someone tells me how a thing works is not as powerful if I struggle through the process of figuring it out myself.
      Good luck. I admire you all for taking such a keen interest. For me it has been a 40 year process of solving puzzles and getting paid to do what I would have done for free.

    • @KennethTanFotografie
      @KennethTanFotografie Před 8 lety +8

      +Robert Shaver Actually Robert, GreatScott does an excellent job explaining technical stuff, but my opinion about this video is, that he should have sticked with more detailed I2C subject matter. Still it remains a very good video

    • @simplelyf4072
      @simplelyf4072 Před 4 lety

      Robert Shaver yes I agree with you. It is much more valuable to learn it by self teaching and imagine how awesome it will feel to finally get it! I’m on that journey myself to learn synchronous data communication such as SPI and studying a lot of resources.

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

      A good description of I2C would take an hour.

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

    This is such a great channel. What ever technical stuff you search in CZcams, you can just find the most in this channel and with precise explanations.. woah..

  • @kylebandy947
    @kylebandy947 Před 5 lety

    Thank you so much, been self learning radio theory and building basic transmitters for a while. This is by far the most helpful series of videos I've found to date.

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

    As always great video! I was just asking for an I2C video from another electronics youtube page and 30 minutes later you uploaded one XD

  • @alanly4515
    @alanly4515 Před 3 lety

    Thanks for the real life example! This is by far the best explanation I've seen.

  • @pablo_costas
    @pablo_costas Před 8 lety

    its always nice to watch your vídeos, really love them !

  • @sortsvane
    @sortsvane Před 8 lety

    Love your videos ! FM IC Was a great way of explaining I2C Interface .

  • @id513128
    @id513128 Před 8 lety

    Another awesome video. I can't wait for next video!
    I always use I2C but never how it work before. Thanks. ;)

  • @eldadyamin
    @eldadyamin Před 7 lety

    Looking forward for the 2nd part of this video!

  • @x10iman
    @x10iman Před 8 lety

    As always great video. Thank you for the useful information.

  • @mattiachie
    @mattiachie Před 8 lety

    you are a genius, congratulations! in the future I hope to see you over youtube, merits much more!
    Good project, as always

  • @Diamonddrake
    @Diamonddrake Před 8 lety

    Best video in a while, Thanks for the break down

  • @robertblahuta1310
    @robertblahuta1310 Před 6 lety

    what hapend if you connect 2 same devices with same device address, for example 2 identical lcd modules or temperature sensors, is it possible to change device address? thx

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

    Perfect tutorial! I hope that you would make more I2C or one wire tutorials!

  • @GamerBat3112
    @GamerBat3112 Před 8 lety

    I just love ur videos! very well explained

  • @BillySugger1965
    @BillySugger1965 Před 8 lety +36

    Great video Scott. Just one comment though, the oscilloscope traces show that the rise times are rather long, 10k pull-up resistors are rather lazy. Most device data sheets recommend smaller values, like 3k3 or 4k7. I use the Arduino processor's bigger brother, the ATxmega which runs much faster. Even with a software i2c driver I can run at full speed of 400kbits per second. At this speed I need 1k5 pull-ups to avoid data corruption. If you're worried about supply current, remember that current only flows through these pull-ups when the line is driven low and they float high when the bus is idle. So if you have only occasional message traffic the duty cycle is incredibly low, meaning the supply current increase is negligible.

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

      Great points!!

    • @Les-electroniciens
      @Les-electroniciens Před 6 lety +6

      Your comment is interesting, but the capacitance of his oscilloscope's probes creates an RC that is most likely the reason of this lazy rising time IMO. As you can see the falling time is much shorter because the current doesn't flow through the resistor but thru the MOSFET instead. If he changes the pull-up resistors from 10k to 4.7k or even 3.3k, it won't make the rising edge much sharper. The only way for him to make sharper edges is to disconnect the probes and significantly reduce the parasitic capacitance.

    • @f.a3202
      @f.a3202 Před 4 lety +1

      @@Les-electroniciens yes it is the scopes fault but not because of the RC but because the scope has only 1mb of memory and can not display accurate information

  • @kalervo35
    @kalervo35 Před 8 lety

    Is the possibility to do do a one way circuit that the current can only flow one direction if there is plz answer this i need you help

  • @prytamkev954
    @prytamkev954 Před 8 lety

    Love your each and every videos

  • @cwbh10
    @cwbh10 Před 8 lety +9

    ahah you write your "1"'s just like my german physics professor, gets me every time! "why's he writing a hat?" :p

  • @ingenierocristian
    @ingenierocristian Před 3 lety

    Hi, I need to make an I2C communication between an Esp 32 and Esp8266, where can I find info about?

  • @doyar1
    @doyar1 Před 6 lety

    Hi mr. Scott, could you please tell me which book should i read in order to understand as u understand the arduino language.. Please...

  • @TomasNovak_oriven
    @TomasNovak_oriven Před 7 lety

    what is maximum distance for i2c communication.
    ie. i'd like to have multiple devices (mostly relays and sensors) across house, garage, workshop, well, etc .. where distance can be up to 130 meters.
    is it possible ? or there's need for other solution ?

  • @notionSunday
    @notionSunday Před 8 lety

    Enjoyed it. Thanks for posting.

  • @mihtibby
    @mihtibby Před 8 lety

    I love your content keep up the good work

  • @shivanshpuri3065
    @shivanshpuri3065 Před 8 lety

    great job great scott

  • @williamblair1123
    @williamblair1123 Před 3 lety

    What is the cheapest controller in your estimation I can use to build a diy i2c circuit?

  • @M.4y
    @M.4y Před 4 lety

    Can someone help me to figure out how to build own nanoleafs? I want to detect with a esp32 automatic how much own panels are connected and set individual colors and animations. But how can it set automatically number up the IDs for every panels? Every panel should have 18 rgbw LEDs. I don't know which LEDs I have to choose.

  • @rainervetter5165
    @rainervetter5165 Před 8 lety

    great scott how do you keap your elektonic components?

  • @rensbakker7710
    @rensbakker7710 Před 8 lety

    I got some solar garden light, they light up when it gets dark, they doesn't work anymore. the board contains a resistor and a voltage regulator(ana618) can someone help me to fix them? Thanx! Sorry for my English...

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

    Could you do an add-on video on LIN-Bus communication between 2 Arduinos?

  • @AlexLesTests
    @AlexLesTests Před 7 lety

    How do you connect multiple identical slaves ? For example 2 or more fm receivers ?

  • @Pirate_
    @Pirate_ Před 8 lety

    Hey Scott! Could you make a Bluetooth Volume controller dial for PC using arduino? I have been looking to buy some for a while but there are none out there.

  • @danielmorgan7702
    @danielmorgan7702 Před 3 měsíci

    Good video that gives a nice overview of how to use a scope with a Arduino to see the i2c. Thank you! Sure, it is not detailed. But it does give a good overview.

  • @id104335409
    @id104335409 Před 8 lety +27

    Wow, I lost you right at "If you've ever implemented...."

  • @maxximumb
    @maxximumb Před 8 lety

    Nicely explained. Thanks.

  • @JohnStraussmusic
    @JohnStraussmusic Před 8 lety

    Love your videos. so interesting

  • @nick1p.x226
    @nick1p.x226 Před 8 lety

    Yes!!!!!!!!!!!!!!!!!! I love the electronics basics! Can you make more how current works and stuff?

  • @kevindt100
    @kevindt100 Před 8 lety

    i want to get in to electronics i want to buy everything at once i live somewhere where it is impossible to get this stuff or mail sould i buy a lot of arduino uno?

  • @MegaJanyjan
    @MegaJanyjan Před 8 lety

    awesome as always

  • @omsingharjit
    @omsingharjit Před 4 lety

    Can this fm module also transmite FM ?

  • @labamichnetvoll5911
    @labamichnetvoll5911 Před 3 lety

    Hello greatScott, can you please make a video about the MCP23016. I tried to use this IC but it didn't work . Thanks

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

    Nice handwriting. And nice video. I would suggest to lower the 10k resistor to like 4k7 - the scope signal clearly shows the rising of voltage is quite slow.

  • @SatyaSankar
    @SatyaSankar Před 8 lety

    can you share me the format of sheet your filling by hand , after reading datasheet.

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

    can you make some basic projects with arduino

  • @its.eldric
    @its.eldric Před 8 lety

    Kannst Du erklären, wie das mit dem Erweitern der I/O funktioniert, also wie ich damit komplexere Bauteile ansteuere, wie ein LCD, TFT oder Sensoren? Oder geht das nicht?

  • @mapy1234
    @mapy1234 Před 5 lety

    can u share the full circuit diagram as this one is not visible?

  • @IsaacMorton
    @IsaacMorton Před 8 lety

    You should totally do a video on spi and/or o e wire. that would be so great!

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

    Jut what I need it
    thanks men I was about to start working on i2c protocol

  • @Ultrarc
    @Ultrarc Před 8 lety

    where do you buy your strip board?

  • @gogetgoget8431
    @gogetgoget8431 Před 5 lety

    thank you GreatScott!

  • @pareshmetaliya6214
    @pareshmetaliya6214 Před 2 lety

    I have seen many cards in industry which have RS-485, Can-bus communication.
    Eathernet communication and Can-bus, how single controller can do two different communication protocol

  • @benjaminrich9396
    @benjaminrich9396 Před 6 lety

    All this technology and it always comes down to sticking two crudely torn bits of paper to label the channels on the scope. Love it. :)

  • @mohammedyasarshaikh4501

    Your first Video that is hard to understand for me, but excellent

  • @emptyheadideas
    @emptyheadideas Před 8 lety

    great video. Can you make one about a "shower water meter" to keep track of your consumption or a "power watt meter" to plug in between your devices and power socket?

  • @beanlets
    @beanlets Před 6 lety

    Is serial bus the rx\tx communication protocol?

  • @donaldfilbert4832
    @donaldfilbert4832 Před 8 lety

    Excellent video !!! Thanks !!

  • @valentinocolaon6060
    @valentinocolaon6060 Před 8 lety

    I love your handwriting!

  • @thomasalexander1563
    @thomasalexander1563 Před 7 lety +3

    Nice tutorial,,
    Make more I2C and arduino..
    Thank you.

  • @BobtheBuilder-jc4xm
    @BobtheBuilder-jc4xm Před 8 lety

    Nice video again!! keep going

  • @E-eeblogBlogspot
    @E-eeblogBlogspot Před 8 lety +1

    can you make a video about cheap diy 3d printer kits and how well it works?

  • @Rohan-su9en
    @Rohan-su9en Před 6 lety

    hi greatscott.............
    your videos are super cool. i like them very much. i have watched your all videos nearly 5 times each.
    but everytime it is interesting to watch it again......
    also can you make a video about diy IR proximity sensor????

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

    Why ... why does it look so much fun :D I now gonna buy me some more I2C devices.
    I do have a few already but your video made me wanna get a FM reciever. Great videos like always and your outro sounds alott like: "Daithi De Nogla"... But yours are alott more informative, and equal if not more fun to watch :D
    (comparing a gaming channel with Electronics? why not both! one day, Ill build a gameboy, with blackjack and i2c)

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

    Do you have video about 1wire?

  • @simondid
    @simondid Před 8 lety

    greate video :P can you make a tutorial on how you wut do this with out using the wire library ore any othere library ?

  • @nshire
    @nshire Před 6 lety

    Why do you use massive lines of solder rather than jumper wires?

  • @ultimatebaadshah7013
    @ultimatebaadshah7013 Před 5 lety

    Can you please describe pull up and pull down resistance

  • @newsogn5148
    @newsogn5148 Před 7 lety

    what is better i2c or the serial RX TX??

  • @kaumohlamonyane272
    @kaumohlamonyane272 Před 3 lety +2

    I remember watching this 5 years ago and I understood nothing. I got to learn Assembly in university and now it seems so intuitive.

  • @rikilshah
    @rikilshah Před 6 lety

    I am currently using RTC clock with Arduino UNO and It doesn't need any external pull up as Mega328 has internal pullup.

  • @MrJamesbowen
    @MrJamesbowen Před 6 lety

    I find adding pull up resistors in my project to stop working. Wire.h seams to use internal pull resistors.

  • @tw7522
    @tw7522 Před 8 lety

    Regarding FM & PLLs. Sanyo's CCB (Computer control bus) seems to be very popular to talk to these kind of chips as well.

  • @lilliampumpernickel9916

    what is the simplest communication protocol?

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

    Could you please make a video on how to trouble shoot arduino? I dont expect you to make a video just because of this but hopefully reply/ think about it? I was using my arduino connected to my laptop (macbook air) when the laptop suddenly restarted. The circuit was a 12v led controller, and none of the pins seemed to have shorted. After restarting, whenever i plugged my arduino in, the pin 13 led would always just come on and not blink like its supposed to. Other than that i always get the dreaded stk500 avrdude not responding 0x00 error. Any ideas why this could have happened, maybe how i can fix it? Thanks a lot for your time, really love your vids :)

  • @Jackym266
    @Jackym266 Před 8 lety

    Awesome vid!

  • @amalnathkh9532
    @amalnathkh9532 Před 6 lety

    Can I have a help on communicating with PT2322 please

  • @luizz1997
    @luizz1997 Před 7 lety

    Is the pullup resistors really needed on arduino? i aways used the i2c protocol without and works like a charm...

  • @TheYouTubeCuber888
    @TheYouTubeCuber888 Před 8 lety

    Kannst du mal zeigen, wie du deine Teile sortiert aufbewahrst? Würde mich schon interessieren wie andere das mit größeren Bauteilmengen machen.

  • @Project-DDE
    @Project-DDE Před 8 lety

    Can you make a video about the one wire interface please?

  • @taranagnew436
    @taranagnew436 Před 3 lety

    can you plz provide the i2c data-sheet?

  • @454guiltyspark
    @454guiltyspark Před 6 lety +1

    Can you do the same video for jtag please it would be awesome thanks

  • @eritronc
    @eritronc Před 8 lety

    thanks so much!!! can you share your code to make some test?

  • @wltr2302
    @wltr2302 Před 8 lety

    how can I make my own Bluetooth for music?

  • @derekwashuck7691
    @derekwashuck7691 Před 6 lety

    How about about an SPI video since the arduino uses it ?

  • @Blue-Maned_Hawk
    @Blue-Maned_Hawk Před 5 lety

    Why do you use stripboard? It seems like a hassle to use, and only looks useful for "gumstick" modules (which do, admittedly, have their niche.) I think that something like perfboard seems like a more flexible alternative.

  • @renechristmann2607
    @renechristmann2607 Před 8 lety

    This bass in the intro is awsome

  • @fredchang5626
    @fredchang5626 Před 8 lety

    @GreatScott You have great videos! I study for electronics enegineering and this year I'm doing something like "final exam project" (don't know how ot translate it :D ), and I have learned a lot of from your videos! Just like this I'm using 4 I2C devices and this video helped a lot :) Thank you very much Scott :)

  • @MrMuniez
    @MrMuniez Před 8 lety

    Waiting for something abot rs232 and next generation (especialy rs485). You are good teacher :-)

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

    can you decode stereo and RDS using this device or output complete MPX Signal to external RDS Decoder?

    • @RupertHandford
      @RupertHandford Před 8 lety

      There is max output on the chip. Have a look at the datasheet.

  • @RaymondBarakat
    @RaymondBarakat Před 8 lety

    I'm working on a project that requires multiple i2c devices. I was wondering what your recommendation would be for the values of the pull up resistors. Thanks!

    • @greatscottlab
      @greatscottlab  Před 8 lety

      +Raymond Barakat If it's a 100kHz communication 10k works just fine. If you use a faster frequency you might need to use something like 1-2k to get the required rise and fall time. The datasheet of your ICs also often mention a recommended value.

  • @Ubebread1
    @Ubebread1 Před 7 lety

    Wait does the chip has its own antenna?

  • @ashutoshsoni2486
    @ashutoshsoni2486 Před 5 lety

    can you do a video on using multiple i2c on a arduino.
    it will help me alot.

  • @amulawarman
    @amulawarman Před 8 lety

    hi GreatScott, can the diy oscilloscope you reviewed be used to monitor i2c communication?

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

      +Adi Mulawarman Yes. But it only has one input so it can be a bit difficult.

  • @MsAle93108
    @MsAle93108 Před 8 lety

    Can you make a video about SPI interface ?

  • @prateeknaryal4031
    @prateeknaryal4031 Před 3 lety

    dear Scott, this particular video i did not understand It was like too much knowledge packed in a very small video. Could you please make another video on this?

  • @Aperson-sv2hc
    @Aperson-sv2hc Před 8 lety

    You should do another pain test comparison of different frequencies this time.

  • @audiodiwhy2195
    @audiodiwhy2195 Před 4 lety

    Great vid thanks.

  • @p1nesap
    @p1nesap Před 8 lety

    Excellent, you're getting smarter all the time.

  • @elielouisa32
    @elielouisa32 Před 8 lety

    In a future video can u plz make the topic one wire interface? Im really interested

  • @MFEeee
    @MFEeee Před 7 lety

    Do you teach on your personal time?