I2C tutorial in 5 minutes + Arduino & Raspberry Pi implementation. Electronics Crash course # 13

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I Square C is incredibly powerful and using these two wires we can connect up to 1008 devices within one I Square C loop I Square C is a communication protocol that's used to transmit information between electronics I Square C was developed by Philips in 1982 to assist with the communication between the CPU and the different peripherals within its audio and visual appliances since then it's been periodically updated and now can support transfer speeds of up to three point two megabits per second now before we continue we must understand that the two main devices within a nice quasi loop there's a master and slave the masters transmitting information the slave is receiving information masters are typically your microcontrollers or your brains and slaves are usually your peripherals such as you know an external sensor or display device etc like I mentioned before the two different wires where information in the I Square C loop is carried out through this SDE and the SCL which is sealed data and the CL clock now the actual information within an i square C loop is sent using something called a message now each message is broken down into different frames each frame is responsible for a different job firstly we have the stop condition the start condition basically signals and the message is going to be sent and get ready for it next we have the address field the address frame is basically responsible for identifying which device or which slave is the master trying to communicate to this is also followed by a read or write bit that means is the master requesting information or is a master sending information to the slave next we have the acknowledgment so once this information reaches the appropriate device the device will acknowledge okay yes this address is for me instead sending a post someone right once the post reaches your home you will acknowledge a by signing perhaps okay I have received this post in the mail after the signal that is received by the master the master will actually send the actual data that means the information that it's trying to transmit this is also followed by a few acknowledge bits just to make sure the data transmission is going smoothly lastly we have the finished condition just like the start condition this basically signals the end of the message let's use a real-life example to understand how I Square C works here we have a boss that sing listen up this is like a start condition next we have the boss calling out we need to talk to this is like an address next we have Kevin replying with an acknowledged bit now this is actual data transmitted when the boss says finish the report that's the instruction now Kevin again replies in college bit now lastly the boss ends the conversation with the end condition in this I square C demo the boss is the master and Kevin is asleep now that we've understood how I Square C works it's actually talked about some of the alternatives to I square C firstly we have serial communication now serial communication also uses two wires but its biggest drawback is that you can we use it to communicate between two devices you cannot to add more like I square C next we have SPI now SPI is similar to a square C in the sense that you can control multiple devices within one communication loop but SPI uses three to four wires as a minimum and every additional device that you connect to your master will have an additional wire which can make it very messy for bigger projects next let's talk what's on the downsides of I square C the actual software and the implementation of I square C is actually quite complicated however most of this work is done by the manufacturers and by using open source or libraries I square C implementation for hobbyists like you and I is very simple next I Square C is significantly slower than SPI but it can still be faster than serial now let's talk about some of the positives of I square C for C doesn't need a dedicated control line for each device such as SPI I Square C only uses 2 wires no matter how many devices you have connected next we can have multiple masters or transmitters within one communication loop again this is not possible by SPI and lastly the acknowledge frame within each message is a good way to ensure that your message is being properly received and nothing is wrong lastly let's talk about how you can implement I square C in your Raspberry Pi or Arduino power project for the Raspberry Pi you actually have to I square C compatible pin pairs the fauces pins 3 and 5 and then pins 27 and 28 to enable these pins you actually have to go into raspy config go into interfacing options and then enable I square C next to actually use it in your project you do need to have RPI the GPIO package installed within your Python code the arduino implementation of I square C is actually easier firstly to check which pins on your board double with i-square see for example on the arduino uno dos pins are pins a4 and pins a5 next to actually user in your code you have to go into libraries and import the wired of each library that's it for this quick tutorial now I'll be making dedicated videos for both SPI and serial communication if you have any questions comments you can leave them out in the comment section below and if you want to subscribe for more future videos or tutorials like these please feel free to subscribe thanks for watching [Music]
Info
Channel: Saral Tayal
Views: 41,957
Rating: undefined out of 5
Keywords: I2C, i2c tutorial, SPI tutorial, Serial Tutorial, electronics, diy, maker, raspberrypi, arduino, raspberry pi tutorial, arduino tutorial, computers
Id: mi24IxXEqzA
Channel Id: undefined
Length: 4min 54sec (294 seconds)
Published: Sun Mar 17 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.