arduino nano to uno i2c communication mike pluma the-bao nguyen ee 444 spring 2013
TRANSCRIPT
![Page 1: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/1.jpg)
Arduino Nano to Uno I2C Communication
Mike Pluma
The-Bao Nguyen
EE 444
Spring 2013
![Page 2: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/2.jpg)
I2C Protocol
• Two Wire Serial Communication (SDA, SCL)• Built into standard Arduino library (wire.h)• Up to 127 simultaneous connected peripheral
devices (slaves)• Unique address directs communication between
Master device and connected slaves• Interrupt based
![Page 3: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/3.jpg)
The Big Idea
• IR sensors take in data which is processed by the Nano
• The Uno asks the Nano for range data from the IR sensors
• The Uno uses rangedata.h to output the distance in cm
![Page 4: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/4.jpg)
The Tricky Bit
• In order to mount the Nano to the sensor platform as shown in the picture it is necessary to desolder the male header pins and replace them with female header sockets.
![Page 5: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/5.jpg)
Lab Setup
• Wire the Nano and the Uno as in the diagram
• You will need to have IR Lab Completed and a usable rangedata.h file
• Copy rangedata.h into the UNOrange working folder
![Page 6: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/6.jpg)
Lab Procedure
• Upload NANOrange to the Arduino Nano
• Upload UNOrange to the Arduino Uno
• Open the Serial Monitor for each and confirm the data read and data transfer
![Page 7: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/7.jpg)
Results
• The Nano should output the Dn it is reading on it’s serial monitor.
• The Uno should output the Range associated with that Dn as referenced in the rangedata.h lookup table
![Page 8: Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649dcf5503460f94ac4197/html5/thumbnails/8.jpg)
ADD THIS
• Modify sample size, and delay time, max short range,
• Make sure you have a good rangedata.h file
Click icon to add clip art