I2C Communication | Detailed Tutorial | Arduino and NodeMCU ESP8266

preview_player
Показать описание
Learn about I2C Communication | Detailed Tutorial | Arduino and NodeMCU ESP8266
SDA Serial Data
SCL Serial Clock

The I2C protocol involves using two lines to send and receive data: a serial clock pin (SCL) that the Arduino or Genuino Master board pulses at a regular interval, and a serial data pin (SDA) over which data is sent between the two devices. As the clock line changes from low to high (known as the rising edge of the clock pulse), a single bit of information - that will form in sequence the address of a specific device and a a command or data - is transferred from the board to the I2C device over the SDA line. When this information is sent - bit after bit -, the called upon device executes the request and transmits it's data back - if required - to the board over the same line using the clock signal still generated by the Master on SCL as timing.

Because the I2C protocol allows for each enabled device to have it's own unique address, and as both master and slave devices to take turns communicating over a single line, it is possible for your Arduino or Genuino board to communicate (in turn) with many devices, or other boards, while using just two pins of your microcontroller.
Рекомендации по теме
Комментарии
Автор

the only place where I found that the ESP8266 has to be the master in order to avoid the voltage difference. It helped me a lot. Thank you very much!

facundosibona
Автор

It works, thanks. But can't connect two esp8266. Both are to be connected D1-D1 D2-D2? Same sketches?

yarogniew
Автор

Thanks for this. Followed along and it all worked. Subscribed. I am in the process of adding WiFi to a number of old existing Arduino projects so will be using an ESP acting as a Master to poll the data to then onward transmit over WiFi to my Iphone. OK I have to level shift on 2 pins but that is far easier than replacing the Arduino with the ESP and have to change the voltages of my sensors. Thanks for posting. I liked the simple step-by-step approach, including your minor errors! All too often these videos are too fast and slick and do not give us time to follow along. We can alway playback at higher speeds if things are too slow, but not to have the detail in the first place is a mistake for many YT vids. (Just a note on the ESP8266NodeMCU you do not need to define the pins. Wire.begin(); works fine)

whitefields
Автор

I have a doubt why you haven't mentioned the slave address in the master code for the communication.

varundesai
Автор

Hello Sir, i came across your video and tried to get the I2C working. I followed your instructions but nothing shows up when i open the serial monitor of the slave device (The Arduino). Any idea what could be the reason?

haroldderidder
Автор

Decent video and decent explanation of I2C. New subscriber!

garyhalsey
Автор

I wonder why should sda arduino connect to scl esp8266 ? Isn't that sda connect to sda right

davidarx
Автор

It was a useful and educational video.

electronic
Автор

I have a problem when I try to Act my ESP32 as Slave Device And another device as the master. But It has error said " Multiple libraries were found for "Wire.h". How can I fix this problem?

makarapunmakaramani
Автор

How can I make my Esp8266 as slave and Arduino Uno as master?

rushalidhar
Автор

Well explained! I like it and I will now subscribe

nghnino
Автор

Πολύ Καλή δουλειά αλλά στο τέλος έπρεπε να έχει και ένα παράδειγμα.

kostassomataridis