I2C with Arduino and Raspberry Pi - Two Methods

preview_player
Показать описание
In the third installment of the I2C series, I will show you two ways to interface a 3.3-volt Raspberry Pi with a 5-volt Arduino Uno.

Today we are back working with the I2C bus, and this time we’ll be interfacing an Arduino with a Raspberry Pi.

By hooking an Arduino to a Raspberry Pi we can get the best of both worlds. The Raspberry Pi is a powerful single-board computer, capable of running a Linux operating system and connecting natively to the internet. The Arduino is a very capable microcontroller with several I/O pins, an Analog to Digital converter, and precise timing and interrupt capabilities. Together, they make an incredible team.

But one issue is that the two devices use different logic levels. The Raspberry Pi GPIO (General Purpose Input/.Output) bus operates using 3.3-volt logic, while most Arduino’s use 5-volt logic. Incorrectly interfacing them can lead to a non-functional Raspberry Pi, a situation best avoided!

You CAN hook the two devices together directly, providing that certain specific conditions are met. Alternatively, you can use a very inexpensive logic level converter to isolate the 3.3-volt and 5-volt logic safely. In this video, I will show you both methods.

Here is what you will see in today's video:

00:00 - Introduction
03:42 - I2C Logic Levels
06:47 - Raspberry Pi I2C Busses
08:30 - Setting up the Raspberry Pi
14:15 - Direct Hookup
15:35- Arduino Sketch
17:31- Raspberry Pi Python Code
20:30- Running the Demo
24:02- Using a Logic Converter

While the demonstration is extremely simple it does effectively illustrate how easy it is to interface these two popular boards.

We will be looking at I2C one more time, in a couple of weeks. So if you haven’t subscribed to the channel yet please do, that way you won’t miss out on anything.

Thanks for watching! Looking forward to chatting with you on the DroneBot Workshop Forum soon.
Рекомендации по теме
Комментарии
Автор

This is the best channel for IoT devices, soo much detail and clarity - amazing tutorials, thank you!

Dalamain
Автор

Hello ! I'm french and I think you are the best youtube channel in english to explain electronic simply ! It's clear and understandable ! 👍👏 Thank you for your work ! ( Sorry for my english if I make a mistake ) 😁

fabricemotard
Автор

Thank You for covering this subject. I was having an issue powering/grounding an IoT project that has an UNO R3 connected to a DHT11 with 2 way communicating with an ESP8266 that is connected to wi-fi and a 4-way relay. The 3.3/5 volt common grounding was giving me a head ach, and causing issues with the sensor data transmitting continuously. No one else really covers things as well as you do. AWWWsome and thank you again.

Itheath
Автор

I would like to see a comparison video on using UART vs i2c vs SPI, etc... As means to establish communication between an Arduino and a Raspberry Pi (or between 2 arduinos and etc). As a quick guide on why should you use one protocol over another one for your project.

caffeinatedinsanity
Автор

Glad to see you're back with your superbly detailed videos. Now I'm anxious to get my Pi talking to my Arduino. Also looking forward to the installment where you address increasing the distance I2C can be used over. Great work Bill. Top notch YouTube presentation.

MysticDreamer
Автор

I give you the award for the best video explaining I2C and warnings for I2V Bus 0 and voltage considerations. If you find yourself in East Lansing, MI I will present the Award to you at the local brewery. Nice job, I like you video technique and editing hope you don't mind if I copy parts of that technique. Keep broadcasting!!

GeekMustHave
Автор

Again an excellent and easy to follow instruction video! Looking forward to I2C part 2!

la
Автор

once again learned something with joy. great explains how to connect a raspberry pi to an arduino Thank you from Germany

gerhardseipp
Автор

I'm impressed with your presentation's. I also follow Mr Carlson's Lab. Your are both clear and concise.

tubeDude
Автор

You are genius.Your detailing and way of description is just marvelous. If you can make some videos related to some basic electronics, It would be so useful for laymen like me.

ratanpal
Автор

Another excellent, useful, educational video. Awaiting part two.... Thanks!

quaternion-pi
Автор

Absolutely Love your Workshop!!
Keep up the Good Work :)

rahulas
Автор

These are the most easily understood and trustworthy tutorials I have seen. I'm trying something similar but unsuccessfully so far. Does an Arduino Nano have a 5V I2C pull up? Specifically, can I use an Arduino Nano (5V) slave with an ESP8266 ESP01 (3.3V) master without a Logic Level Converter?

davidmc
Автор

Thanks, I just ordered a five pack of the converters.

kenseastrand
Автор

nailed the camera transitions *thumbs up*

heyitsdrew
Автор

Loved the episode. Looking forward to the next I2C episode. THANK YOU for making these.

ericmcgrath
Автор

always a concise explainer. Thanks heaps. Keep up the amazing videos.

mandelbro
Автор

Very nice and professionally prepared.

SufiShahHamidJalali
Автор

You are amazing, your videos are very much usefull to me, keep it up don't stop your tutorials, thank you so much🤖

gokulraj
Автор

Super high quality instruction. Thank you for this video.

vincentcaudo-engelmann