Hands-On Arduino 4: I2C Communication

preview_player
Показать описание
Here we give a demonstration of using I2C communication. This video gives two examples. One has the Master send a command to the Slave, the second has the Slave send data to the Master upon request.

To see lecture slides, go to
open?id=0B5jlwlXJI8pJVGgwOEg5TFNBTGs
Рекомендации по теме
Комментарии
Автор

7 years later and this helped solve my issue! Thank you!

DesignCell
Автор

Thank you for a great introduction to using I2C with the Arduino.

I think you have missed the point of the twisted pair in your diagrams however. The idea behind a twisted pair, is to make sure that no single conductor spends more time next to a source of noise than the other. This ensures that the same amount of noise is present in each leg of the twisted pair this is called common mode noise. Since most communication circuits can handle common mode noise quite well, this noise is easily rejected.

In your setup, you are effectively biasing the one communications lead to ground while biasing the other to VCC. If the ground is nice and stable and the system is injecting noise on the VCC line when relays click and lights turn on and off, then this switching will be evident on the comms conductor wound around the VCC lead. This will increase the error rate.

It would give more reliable communications over longer distances if you use a single twisted pair for the supply (VCC and GND wrapped together) and a separate twisted pair for the I2S comms (SCL and SDA wrapped together). This is especially true if the power and comms pairs are to run next to each other over considerable distances.

albertsjoberg
Автор

Thank you Robert Paz, exceptional presentation

joserobertoz
Автор

Excellent presentation. Very clearly explained. Thank you Robert.

kenasuea
Автор

Nice video Robert, thank you for sharing your knowledge!!

PhDFernandoCoach
Автор

awsome video. Thanks Robert.
And you explain very well.

PiGoElectronics
Автор

Excellent info and well presented. Thanks!

capiberra
Автор

You are my TOP one! THX for your so good presentation.:-))

simonmailhot
Автор

Very Nice, Robert! I have a question: I noticed that you declared the variable `volts` in the two sketches. The name of this variable must be exactly the same in both or it doesn`t matter? Thank you!

endell
Автор

Great presentation! What software did you used to superimpose your face and the desktop recorder?

kwongchiewfoong
Автор

Hi Mr RobertI have a question for youIf I have two int data to send to master from the slave how can I do it?My project has one slave with 2 counter and I have to send they to the master via I2C protocolIn your video there is just one dataI tried to insert new data but on serial monitor displayed  the first data fine but the second data -1I dont know how modified the sketch can you help me?Tks Gianni

giannigallo
Автор

Is it possible to send master to slave a string or multiple carector instead a char?

amunkc
Автор

That's a nice tuturial! I hope I can adapt to my project... Have you tried comunicate a slave arduino running an RFID aplication? thanks a lot!!

edufeq
Автор

I can't download the slides! the webpage you've provided isn't direct me to the slides, why that? Could you help me, please?
Regards.sam

Sambay.
Автор

I successfully make i2c with two leonardo. Leonardo1 is master and leonardo2 is slave. Can i make two way communication where the master is also the slave and vice versa?

jamesis
Автор

Hi, I've been wanting to code my I2c with mq-135. Can anyone please help me. ASAP.

yourstrulysol
Автор

I did exactly what you are telling, except I used Arduino Nano as a master and Arduino Uno as a slave, and It didn't work.Am I wrong when I did it in this way ? Please give me some advice.Thanks a lot.

minhly
Автор

Can anyone suggest some sources for learning the arduino programming?

NotLays
Автор

capacity 1 analog slave to signal the ashes of 2 variables how ?

hienngv
Автор

DO NOT FORGET TO PUT THAT Function receiveEvent just after #Wire.h, NOT AFTER loop...
because you will get an error: ....Fn not in the rest is ok!

simonmailhot