How to connect the MCP23017 GPIO Expander to an Arduino and Raspberry Pi

preview_player
Показать описание
In this episode, we take a look at the MCP23017 GPIO Expander IC. With this IC, we can add 16 GPIO pins to the existing GPIO pins on an Arduino, Raspberry Pi, or any micro controller that has an i2c bus. They can be "stacked" for up to 128 additional GPIO pins! Bring on the LED's!

In this video we cover:
► Physical connection of the MCP23017 to a Raspberry Pi
► Code examples for the Raspberry PI in Python
► Physical connection of the MCP23017 to an Arduino UNO
► Code examples for the Arduino

As promised, all the code used in this video is on Github!

Parts that were used in this video:

Now go get creative! Share what you have made with me. I can be found at

If you liked this video, please consider subscribing. You can enable notifications for new videos when they are posted!

See ya next time!

#arduino #raspberrypi #makers
Рекомендации по теме
Комментарии
Автор

Working on a 16 step switch project. Each key has an embedded led. For 16 switches I actually need 32 gpio. Your video helped me to figure out how to work with this chip properly with a Pi Pico. Very helpful video! Thank you.

DevonsWorkshop
Автор

Sounds like this is what I might need to control my custom pin on a budget :)

YoBrewster
Автор

This is soo helpful, I couldn't find any proper explanation anywhere else
Helped me for my project

aryansatpathy
Автор

Happy to stumble across your channel. Clear and concise, thank you!

samk
Автор

Tip: Check the Red & Blue lines on the power rails for any breaks that indicate power termination. Nice video, subbed :D

croll_uk
Автор

Very helpful. I’m attempting to revive the old diamond rio MP3 player parallel interface so I can get some new music on my 23 year old MP3 player :)

deanhuff
Автор

Are the indicator LEDs at the left just wired between VCC and ground? Do I not need a resistor?

MattRose
Автор

I really need to know how I can chain these together in a RPI3B+. Also How many can be chained together? Are the bandwidth considerations? I am trying to figure out a way to hook up about 20 stepper motors and a camera with a few sensors also. BTW awesome channel. Thank in advance for your reply.

rccowboys
Автор

Check the datasheet to confirm that you don't need a resistor on the Reset pin. Connect it directly to the positive supply.

chuckhole
Автор

Hello, At first thanks for informations, just i want to ask why we use R 1K to reset pin?

YoucefYazid
Автор

thanks dude!!!, you saved my life, get my like

pruch
Автор

I am somewhat new to using the Raspberry Pi (3 B+) and I would like to expand my GPIO as shown in this video. I already have a 20x4 LCD display using pin 3 (SDA.1) and pin 5 (SCL.1). Can pin 27 (SDA.0) and pin 28 (SCL.0) be used instead to setup the expansion board while the LCD display is still connected to pin3 and pin 5?

_teknq
Автор

thank you very helpful video. one question, if modify the speed of i2c on raspberry, what the maximum number of chips we can use?

abdulkarim.jamal.kanaan
Автор

I wouldn't recommend hooking up with power applied. Connect, check, then apply power.

dfmayes
Автор

Nice explaining!! How can I use this in Domoticz?

JeroenUE
Автор

Have you measured how many microseconds it takes for digitalRead() and digitalWrite() using these 16 GPIO pins via I2C compard to the pins which come on the microcontroller? Just wondering how much slower it is. Hopefully it doesn't take more than say 100 microseconds.

jenniferw
Автор

Can you do a video on how to use this to control 1 or 2 i2c modules (say an I2C LCD to start with) using the arduino. For instance, how would you read from an I2C module and write to an I2C LCD through the MCP23017 (or MCP23S17 for SPI). Thanks.

djsbriscoe
Автор

Damn this was good. Subscription added!

muaddibinho
Автор

What about esp32 running micropython? Thanks.

qozia
Автор

hi is it possible to have the Arduino and Raspberry Pi connected to the same ic2 line at the same time?

roystervi