How I2C Communication Works and How To Use It with Arduino

  Рет қаралды 1,545,995

How To Mechatronics

How To Mechatronics

Күн бұрын

Пікірлер: 500
@thesauceboss5995
@thesauceboss5995 2 жыл бұрын
This is one of the only videos I've found that explains how pull up resistors can affect the speed at which data can travel on the SDA line. Fantastic video that explains how I2C works. Great job.
@rahulfromkerala
@rahulfromkerala 5 жыл бұрын
2 hours of reading and then here comes this video where everything is well explained in under 10 minutes... You tube is spoiling me...
@vijaykumar-hc6jz
@vijaykumar-hc6jz 4 жыл бұрын
The bit sequence was so well explained that I had to print the screenshot of it for future reference.
@simplynilsw
@simplynilsw 7 жыл бұрын
You said 124 devices instead of 1024 devices (0:52 min), but great video it helped me alot, thanks :))
@BatsAwesomeIn2030
@BatsAwesomeIn2030 4 жыл бұрын
To the point, simple and clear, well done! which most people struggle to explain. ~This is coming from a Professional Embedded engineer.
@HowToMechatronics
@HowToMechatronics 4 жыл бұрын
Glad to hear it, thanks!
@kiranbs5057
@kiranbs5057 4 жыл бұрын
Watched many videos on this protocol I was never able to grab the concept clearly and I found your tutorial and it made my life simple . Thanks man u have explained and visualised the concept neatly .
@GetElectronics
@GetElectronics 6 жыл бұрын
I always like tutorials that show how to use sensores without relying on 3rd party libraries other than the wire one. Very useful for learning.
@elonmuskmtmt886
@elonmuskmtmt886 6 жыл бұрын
This is by far the most thorough and yet still concise explanation I have found! Awesome video!
@HowToMechatronics
@HowToMechatronics 6 жыл бұрын
Thank you!
@mark879
@mark879 8 жыл бұрын
Awesome video! I especially appreciated the protocol/packet breakdown. Thanks very much!
@roidroid
@roidroid 9 жыл бұрын
6:00 just a headsup: You have the Arduino connected to two GNDs, with no 5V line.
@AdityakrishnaMr
@AdityakrishnaMr 6 жыл бұрын
Yes, that bothered me too.
@AngryRamboShow
@AngryRamboShow 5 жыл бұрын
@Blondie SL the white race needs you to make blond haired blue eyed babies. Stop being a degenerate and man up.
@taimooramin1272
@taimooramin1272 5 жыл бұрын
Bro thats not a big deal he is also a human and if he has done any mistake that does not matter because if you have used arduino or any other types of microcontroller in past u can correct the connections easily
@ksawery6568
@ksawery6568 5 жыл бұрын
@Blondie SL Well that escalated quickly.
@cinibar
@cinibar 5 жыл бұрын
@Blondie SL Dark matter....hmmmm I once cut open a dead flashlight battery and found it to be very dark, black as coal in fact. I just figure it got full of the dark that it was displacing with light, and died when it got full. :)
@nobodyspecial313
@nobodyspecial313 9 жыл бұрын
Sweet tutorial! Really like the illustrations that went along with your explanation. After looking at a few cool project videos where people are using Arduinos and other microcontrollers, it makes me wish my college had a class on these!
@iancorcoran7560
@iancorcoran7560 7 жыл бұрын
Dejan Nedelkovski
@Gupatik
@Gupatik 10 ай бұрын
it's been 8 years now or so, are you still alive bud, and did you learn this arduino and microcontrollers stuff. Anyways, hope you are doing good
@LaurinusPonpon
@LaurinusPonpon 3 жыл бұрын
I watched a few videos and this is the BEST explanation for I2C. Thanks
@HowToMechatronics
@HowToMechatronics 3 жыл бұрын
Glad it was helpful!
@sorenium
@sorenium 7 жыл бұрын
This is so beginner friendly! Thank you so much. I used the same illustrations to make few students understand the same. :)
@michaelvogt7787
@michaelvogt7787 8 жыл бұрын
Dejan, I was looking through youtube for a decent tutorial about the I2C bus as implemented on the Arduino. I have a class of high school students who could use a good demo. I didnt expect to find your EXCELLENT tutorial, one that would be useful even to professional electronics engineers. I wanted to let you know you did a nice job, and it was appreciated. Dr. Michael Vogt - North American Robotics
@Patrick-ky7ez
@Patrick-ky7ez 4 жыл бұрын
Amazing video. SOO many hours of reading pdfs with unnecessary tech jargon. You explained it perfectly.
@suzesiviter6083
@suzesiviter6083 6 жыл бұрын
To clarify; the I2C lines are either high impedance or 0, you never drive the bus line high directly; that is achieved by de-asserting the '0' and letting the internal pull up resistors tie it to Vcc. The high impedance or low state on the bus prevents bus contention; that is a ground connecting to Vcc directly causing a short between any masters or slaves.
@maxpolaris99
@maxpolaris99 4 жыл бұрын
Your examples are very helpful for us slow pokes with little to no insight. Good Job.
@kamuizero
@kamuizero 7 жыл бұрын
What a great video! Very clear explanation and simple demonstration on how to use it. Thank you very much.
@AliHSyed
@AliHSyed 7 жыл бұрын
OMG thank you so much, I've been so lost with i2c until I watched this video!
@nalorin
@nalorin 3 жыл бұрын
SUPER helpful tutorial! Thank you so much! I have an ALS31313, and all the code examples I could find online (including the manufacturer's website) don't work. Your tutorial makes things SO much clearer and I managed to get my magnetometer working within 15 minutes of watching your video! THANK YOU!!!
@HowToMechatronics
@HowToMechatronics 3 жыл бұрын
Glad to hear it, cheers!
@alexpelagaggi
@alexpelagaggi 7 жыл бұрын
Dejan Nedelkovski, you are the best. Thank you very much for making this video.
@markconger8049
@markconger8049 4 жыл бұрын
Thank you for this tutorial! I knew the overview of how i2c works but not the specifics. It looks similar to packets in TCP/IP.
@erniea5843
@erniea5843 5 ай бұрын
this video is still providing value after all these years!
@HowToMechatronics
@HowToMechatronics 5 ай бұрын
Happy to hear it!
@aubreydebliquy8051
@aubreydebliquy8051 4 жыл бұрын
Thank you for a clear explanation. I used only SPI to date but now I know how to use I2C ... thanks...
@michaelliles6755
@michaelliles6755 8 жыл бұрын
Finally someone who knows what he's talking about ! Thank you! Not one person on the Arduino site or any other place online have suggested hooking up scl to scl and sda to sda . Everyone says hook it up to A4 and A5 . I bought two units so far thinking that either I broke it or it was doa. well turns out that both work fine. why is this info missing from the arduino site?? anyway thank you very much!
@alterguy4327
@alterguy4327 3 жыл бұрын
This channel never gets old
8 жыл бұрын
Very useful for beginner like me, thank you! :)
@ngkhai5935
@ngkhai5935 3 жыл бұрын
There is an error at the circuit diagram. Instead of 5V you're connected to a GND. However, thank you so much, I learnt a lot from your wonderful video. Merry Christmas
@mohanmanoharan1387
@mohanmanoharan1387 8 жыл бұрын
super, really appreciate for the tutorial. Request similar other Serial protocols SPI explanation. CAN, UART. thanks
@omaralharran
@omaralharran 2 жыл бұрын
You are the best. Thank you for taking the time to explain I2C on such indepth level.
@cmulder007
@cmulder007 2 жыл бұрын
In the breadboard diagram at 5:56 both the + and - are connected to ground on the Arduino
@danielrufenacht3722
@danielrufenacht3722 9 жыл бұрын
Hello Dejan Many thanks for your time to spend in order to explain us these very clear tutorials. Daniel from Switzerland
@ipadize
@ipadize 2 жыл бұрын
i know its an old video and you probably already know that but you can shorten the Serial.print commands to one like this: Serial.print(String("X0= ") + (X0) + ("X1= ") + (X1)); then when the numbers are bigger or shorter it will automatically fit them together
@chinhcd
@chinhcd 8 жыл бұрын
It saved me so much time and hassle. Good job!
@alextrujillo8861
@alextrujillo8861 2 жыл бұрын
In the circuit diagram at 6:00, I notice GND is connected to the red and blue rail. Is this accurate or am I missing something? I thought I2C was active low? Was this a mistake in the wiring diagram?
@BigyanChap
@BigyanChap 7 жыл бұрын
I2C Communication -- Demystified! Thumbs up.
@danielmarques7279
@danielmarques7279 Жыл бұрын
Great video, really appreciate it! But I really think that explaining every line of the code would've been great!
@erichertsens
@erichertsens 9 жыл бұрын
thanks, appreciated from the Dominican Republic
@dorianmccarthy7602
@dorianmccarthy7602 8 жыл бұрын
Intro RIP headphones users. But great info :)
@matthewmorrison2071
@matthewmorrison2071 4 жыл бұрын
yep I almost died I swear
@JohnnyFaber
@JohnnyFaber 4 жыл бұрын
Same.
@skeeveskeeve
@skeeveskeeve 3 жыл бұрын
Best video I have seen on the subject.
@SathishKumarbalu
@SathishKumarbalu 8 жыл бұрын
Nice ! Now i got a clear idea what is I2C.
@schlo9358
@schlo9358 Ай бұрын
Thanks for your example with the wire libary
@MrJeppeholt
@MrJeppeholt 6 жыл бұрын
OMG dude that was perfect. I have been struggeling with i2c for a while now but this made it click. THANKS! :D
@naboulsikhalid7763
@naboulsikhalid7763 5 жыл бұрын
Hi, Mentor. What to say, thank you won't be enough. great, detailed video.
@excite236
@excite236 8 жыл бұрын
saved me so much time working gy-80 thanks man
@tarunrjain9748
@tarunrjain9748 2 жыл бұрын
Macha, I am a big fan of your channel. Macha I think u did a mistake .......in the tinkercad sample which u have shown in the video .....both the power supply are connected to ground.......Shouldn't the VCC one connect to 5v power supply? btw lots of luv from India ❣
@mitkopetrovik259
@mitkopetrovik259 8 жыл бұрын
Nice, it is desirable in the following tutorials to explain the I2S protocol and what is exactly the difference with I2C
@philippedrolet4853
@philippedrolet4853 5 жыл бұрын
May I take a screenshot of the diagram at 3:30 for my undergraduate research paper if I cite its origin?
@Syria..
@Syria.. 3 жыл бұрын
amazingggggg you did save me after reading datasheet for days
@EmciGad
@EmciGad 2 жыл бұрын
Very good and clear explanations! well done!
@icarossavvides2641
@icarossavvides2641 4 жыл бұрын
There are a lot of Tubes about I2C but none of them make note of the fact that I2C is an abbreviation of Inter IC Communication, it was invented by Philips to help reduce the amount of communication tracking between IC's on a PCB, consequently it is a reliable communication system when used over short distances in a controlled environment, a PCB, but it was never intended to be sent overlong pieces of wiring (>200mm?). If you use this to connect to devices over long lengths of wire, especially if there are noisy items around like motors etc, be prepared for random communication problems.
@adamsvette
@adamsvette 3 жыл бұрын
It's incredible that you can communicate with so many different devices using only 2 wires. also, the 2 SAME wires.
@ExtantFrodo2
@ExtantFrodo2 9 жыл бұрын
I now understand what I could not understand previously. Thank you.
@ElectroMentor
@ElectroMentor 4 жыл бұрын
Utterly informative video much appreciation 👍
@morgard211
@morgard211 6 жыл бұрын
Thanks! I didn't want to memorize it, but to understand it and it worked! :)
@fleshTH
@fleshTH 7 жыл бұрын
This was extremely well done! Good job! It was very clear and now i'm off to do some new projects.
@stevetobias4890
@stevetobias4890 4 жыл бұрын
Excellent explanation. Also helps me in a project where I will be using breakout boards for the first time. Thank you
@miguelluisrodrigues3704
@miguelluisrodrigues3704 4 жыл бұрын
Thank you brother, you help me a lot in my projects
@soniyachandran629
@soniyachandran629 3 жыл бұрын
Thank you for that simplified explanation :)
@HowToMechatronics
@HowToMechatronics 3 жыл бұрын
Glad it was helpful!
@jackm416
@jackm416 5 жыл бұрын
Great job of explanation ! Good graphics and clear explanation of the timing !
@HowToMechatronics
@HowToMechatronics 5 жыл бұрын
Thank you!
@laurentmenten4644
@laurentmenten4644 3 жыл бұрын
At 5:47, I noticed a small mistake in the wiring, both the VCC and GND on the breadboard are connected to a GND pin on the Arduino ... Anyway, great explanation ;)
@templocal
@templocal 3 жыл бұрын
You explain things very accurately! Thank you!
@krozareq
@krozareq Жыл бұрын
Good to know how all this works. I've used the Linux i2c and SMbus userspace tools, but never really knew the hardware functionality behind it. GPU lighting is generally i2c and motherboard controllers use SMbus (both very similar though). Knew just enough to be dangerous and change RGB colors or monitor temps with a very light shell script and even shell functions. The OpenRGB project has the addresses for most hardware, including USB (mouse, keyboards, and some mobos use USB for communication to controllers).
@reydus6651
@reydus6651 4 жыл бұрын
superb video mate. Explained it very easily.
@drcl7429
@drcl7429 5 жыл бұрын
Excellent. I thought i2c was going to be complicated
@henearkrip
@henearkrip 5 жыл бұрын
Nice Work! Very clear and simple explanation!!
@adolforosado
@adolforosado 4 жыл бұрын
Very clear and concise. Thank you. Seems books are written so you don't understand the stuff and you're made to pay more for tuition.
@MkmeOrg
@MkmeOrg 9 жыл бұрын
This is fantastic! Sharing on Mondays live show. Great vid. Cheers!
@riccardoz2953
@riccardoz2953 5 жыл бұрын
at the end u need 4 wires, ground, power, SCL and data. bewatre of voltages, couse recent sensors and some different arduino version need 3.7 and not 5v as powersupply. nice video|
@степаалександров-с5р
@степаалександров-с5р 7 жыл бұрын
your English is perfect!
@ЮжныйКот-м2э
@ЮжныйКот-м2э 4 жыл бұрын
Что то мне мерещится русский акцент у автора.
@BBRR442
@BBRR442 4 жыл бұрын
best tutorial on youtube thanks
@HowToMechatronics
@HowToMechatronics 4 жыл бұрын
Thanks!
@Gereon_
@Gereon_ 5 жыл бұрын
Very good explanation! Thank you very much.
@nikoslykouresis2275
@nikoslykouresis2275 5 жыл бұрын
Man I don't know if it's the weed, but your explanation made me understand most of this very clearly
@collenfisher3635
@collenfisher3635 Жыл бұрын
Brilliant, and exceptional narration.
@pietrotosoratti799
@pietrotosoratti799 4 жыл бұрын
Thank you for this useful video !! You explained the topic in such a clear way !!
@totalnewbie8619
@totalnewbie8619 5 жыл бұрын
This was an informative and helpful video. I also liked how you explained with graphics. It made things easier to understand.Thank you and please keep doing more videos like this for beginners like me. Best regards.
@HowToMechatronics
@HowToMechatronics 5 жыл бұрын
Thanks, I'm glad to hear that!
@jesseliverless9811
@jesseliverless9811 23 күн бұрын
At 6:00, you show both black and red coming from GND pins. Shouldn't the red come from 5V, and black at GND?
@ArtedaSerenidadeEstoica
@ArtedaSerenidadeEstoica 8 жыл бұрын
Nice explanation... the protocol I2c is very usefull, fast and need... Thank's for your time and information.
@Engineer9736
@Engineer9736 6 жыл бұрын
9:11 You have a bug in your code. You check if Wire.available() is equal to or less than 2. This would also result in true if Wire.available() returns 1. Then you read 2 bytes in any case. In the case 1 byte was received, you are reading one other random unknown byte.
@expectropetronus
@expectropetronus 8 жыл бұрын
Simple and lucid explanation... Thank you
@xealit
@xealit Жыл бұрын
6:05 the power and ground wires (red and black) are both connected to ground on the mega?
@victorchan8685
@victorchan8685 8 жыл бұрын
Appreciate for your excellent video, you speak very clear and explain in detail! You are wonderful! Help a lot!
@J-K-AG
@J-K-AG 8 жыл бұрын
Great tutorial mate. Just wondering is there any tutorial on how to change address on unique slave devices.
@J-K-AG
@J-K-AG 8 жыл бұрын
No problem. Thanks for the video anyway really helpful.
@astudyspace7272
@astudyspace7272 3 жыл бұрын
Thank you very much for this detailed explanation. You made this topic easy to absorb. 🐣
@TheSateef
@TheSateef 5 жыл бұрын
thanks, can you tell me in the program you test for Wire.available=2?
@spbains1966
@spbains1966 6 жыл бұрын
Excellent tutorial bringing out the details very clearly
@lan5053
@lan5053 5 жыл бұрын
So easy to understand. Thank you!
@BlagojceKolicoski
@BlagojceKolicoski 8 жыл бұрын
You have both VCC and GND connected to the GND on the Arduino @ 05:56. Is this a mistake?
@121yahya
@121yahya 8 жыл бұрын
very nice video, clear explanation and easy to understand
@PiCoVienna
@PiCoVienna 6 жыл бұрын
Excellent, easy to understand, very precise!
@chasenjohnson797
@chasenjohnson797 5 жыл бұрын
Great description of I2C. Thanks:)
@leuc2475
@leuc2475 Жыл бұрын
Thank you. It's simple to comprehend
@youseebruce5426
@youseebruce5426 6 жыл бұрын
A very clean and neat explanation... I understood clearly... Thank you very much.
@ronimine
@ronimine 8 жыл бұрын
Very clear and instructive. Well done. Thank you !
@rajsudhirsaran312
@rajsudhirsaran312 5 жыл бұрын
Very clear explanation
@HowToMechatronics
@HowToMechatronics 4 жыл бұрын
I hope you enjoyed this video and learned something new! If you'd like to support me making more content like this, please consider supporting me on Patreon: www.patreon.com/howtomechatronics
@Scudmaster11
@Scudmaster11 3 жыл бұрын
I know you can get composite video out of it or something
@jokopribadi6462
@jokopribadi6462 4 жыл бұрын
easier to understand in this video. Thanks
@PhDFernandoCoach
@PhDFernandoCoach 7 жыл бұрын
Thank you very much for this video, Dejan! The information is clear, well organized and dynamically illustrated!
@narendravasu6607
@narendravasu6607 7 жыл бұрын
Thank you sir Your explanation very simple and clearly. Very useful to me . onces again thank you sir
@iurifrederico8608
@iurifrederico8608 2 жыл бұрын
Nice! Very good explanation! Well done 👍
What is I2C, Basics for Beginners
18:30
nandland
Рет қаралды 169 М.
Arduino CNC Foam Cutting Machine (Complete Guide)
26:53
How To Mechatronics
Рет қаралды 1,5 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 17 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 2,7 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 63 МЛН
I2C Part 1 - Using 2 Arduinos
25:51
DroneBot Workshop
Рет қаралды 424 М.
MOSFETs and How to Use Them |  AddOhms #11
7:46
AddOhms
Рет қаралды 3,7 МЛН
CAN Bus: Serial Communication - How It Works?
11:25
Electronoobs
Рет қаралды 261 М.
I2C and SPI on a PCB Explained!
15:34
Altium Academy
Рет қаралды 158 М.
How are Images Compressed?  [46MB ↘↘ 4.07MB] JPEG In Depth
18:47
Branch Education
Рет қаралды 3,7 МЛН
Sensors - which one to use
17:06
Electronoobs
Рет қаралды 1,4 МЛН
PROTOCOLS: UART - I2C - SPI - Serial communications #001
11:58
Electronoobs
Рет қаралды 1,4 МЛН
Understanding SPI
11:50
Rohde Schwarz
Рет қаралды 112 М.
Solving I2C Address Conflicts - TCA9548A I2C Multiplexer
24:29
DroneBot Workshop
Рет қаралды 107 М.
I2C introduction: The protocol
15:47
Texas Instruments
Рет қаралды 48 М.