Arduino Best expander Input/Output | GPIO Expansion module | MCP23017, MCP23S17

  Рет қаралды 26,724

DIY GUY Chris

DIY GUY Chris

Күн бұрын

You will certainly learn something new from this video!
Here I go with a new DIY breakout module, and this time I axplained how to design and use a GPIO expansion module that could be used by any microcontroller like #Arduino, Raspberry Pico, STM32, NodeMCU or any other MCU dev board as long as it has a I²C bus
This MCP23017 Module board has been designed under Altium Designer and you can start a FREE TRIAL of this EDA software through this link :
www.altium.com...
★☆★ Trusted sources ★☆★
Check out the FREE Altium 365 advantages: www.altium365....
PCB manufacturing : jlcpcb.com/PCH
Arduino Portenta : store.arduino.....
★☆★ DOWNLOAD PCB GERBER FILES ★☆★
GERBER files : www.mediafire....
★☆★ DOWNLOAD SCHEMATICS ★☆★
Download PDF : www.mediafire....
★☆★ ARDUINO CODES ★☆★
★☆★ My Video filming tools ★☆★
Main Camera Canon Rebel T7 : www.amazon.com...
Macro Camera lens : www.amazon.com...
Secondary camera Gopro Hero 8 : www.amazon.com...
LED Video lighting : www.amazon.com...
★☆★ 💻 FOLLOW ME BELOW 💻 ★☆★
Instructables: www.instructab...
Hackaday : hackaday.io/DI...
Facebook : / diyguychris
Twitter : / chris_diy
Hackster : www.hackster.i...
TikTok : vm.tiktok.com/...
Keywords
#ArduinoProject #MCP23017 #Electronics #Maker #diy #howToDiy #HowToDesignPCB #Altium # #PCBAssembly #SMD #EasyTutorial #STEM #circuitDesign

Пікірлер: 65
@safadjobbi7773
@safadjobbi7773 2 жыл бұрын
We need more videos like this 👏 🙏 keep up the good work 👏
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Thanks 🙈
@dasaikat
@dasaikat 8 ай бұрын
Can you please help me to find an gpio extension upto 2600 output
@DIYGUYChris
@DIYGUYChris 8 ай бұрын
shift registers is an option
@giantkherva2141
@giantkherva2141 Жыл бұрын
In a project, altera max ii fpga ic and mcu atmega328p are installed, altera max ii was used to expand io pins. Only the MCU must be programmed. Or both the Altera Max II and the MCU will be programmed.
@chaimajabri1710
@chaimajabri1710 2 жыл бұрын
I have followed all stages on your Instagram too it's seems so cool good job👏
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Thanks 🙈
@luizpollo
@luizpollo 2 жыл бұрын
Sooo, could you make a 3d printer with raspberry pi pico now that you can expand its IO pins?
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
You can make 3D printer without any need of expansion : )
@luizpollo
@luizpollo 2 жыл бұрын
@@DIYGUYChris But for a 3d printer usually you have to have at least one stepper per axis and an extra for the extruder, i think the pico doesn't have that much IO pins
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
@@luizpollo you will not get the steppers powered directly from Pico, there you will have stepper motor drivers, A4988 is one of these drivers. In this case no need for extra GPIOs
@brentonrowland8613
@brentonrowland8613 2 жыл бұрын
Excellent project Chris. Any plans for an analogue version of the multiplexer?
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Do you have any suggestions about some AD devices? I'm doing digital all the time but I have some interest to make some analog modules so any recommendations from you will be very appreciated
@Daniel-odanio
@Daniel-odanio 5 ай бұрын
how is the pin state at startup of the expander? high or low?
@br52685
@br52685 7 ай бұрын
In your example sketches, one demonstrated OUTPUT and the second demonstrated INPUT. Can this expander have some pins set to OUTPUT and different pins set to INPUT (within the same sketch)?
@DIYGUYChris
@DIYGUYChris 7 ай бұрын
Sure thing, it is as same as you set the arduino pin I/O
@mr.satishfy
@mr.satishfy Жыл бұрын
Can we use ic 7219 mux For conneting more relay in case of attiny mcu
@DIYGUYChris
@DIYGUYChris Жыл бұрын
Do you mean the TMUX7219? That's a switch not an MCU.
@user-ml1jx3oi8r
@user-ml1jx3oi8r Жыл бұрын
Is it possible to use audio input (e.g. inmp441 i2s) or audio output (e.g. max98357A i2s) via this port expander? If yes how is it done, especially the pin config? Thanks for any advice. I only got buttons, leds, encoders to work.
@DIYGUYChris
@DIYGUYChris Жыл бұрын
I²S is an audio communication protocal that requires an I²S data line which is not existing in MCP expander not even in other GPIO Expander because these will provide General Purpose IO but I²S is specific IO for sound. I hope you can distinguish these two terms (I²S and GPIO) !
@vijuthomas7880
@vijuthomas7880 2 жыл бұрын
Hi , like your project, can you pls do Nodmcu with water tank Level indicator IoT.?
@angzarr9584
@angzarr9584 Жыл бұрын
its exactly the same just use the i2c pins on the nodemcu
@yhyamostafa7247
@yhyamostafa7247 2 жыл бұрын
You can make robot dog
@abdallahkhmeri6570
@abdallahkhmeri6570 2 жыл бұрын
very good M'ester belkhir
@pierrejeanes
@pierrejeanes Жыл бұрын
What is that
@DIYGUYChris
@DIYGUYChris Жыл бұрын
MCP23017 Breakout board
@Hangs4Fun
@Hangs4Fun 7 ай бұрын
does that adafruit library handle the debouncing of the switch or did you add a 5ms piece of logic in there yourself? I noticed you got precisely only one message per push down and one for release. Normally momentary switches (especially ones that are not top quality) will "bounce" as the mechanical plate causes a bounce (you can see on the o scope) when you get close to closing. debouncing usually removes this or putting in about a 5ms logic to handle it. Very cool video. I have used a dozens of PCA9685 modules and love anything i2c
@DIYGUYChris
@DIYGUYChris 7 ай бұрын
That's a good point to highlight, I got the inputs to interpret the clicks through logic edge because edges appear one time but logic level is continuous so I suggest you add a boolean variable as a flag for each input reading and add it to the input read if() statement so for example instead of writing if(digitalRead(input)) { Serial.println("message"); } You write if(digitalRead(input)&&flagInput) { Serial.println("message"); flagInput=0; } if(!digitalRead(input)) { flagInput=1; } This way the flagInput variable will ensure that we get the message one time only once the input is high. This will cost you some of the dynamic memory of your MCU due to variables use. Instead you could add a short delay of around 200 ms just inside the "if" statement so it becomes like this if(digitalRead(input)) { delay(200); Serial.println("message"); } But this will keep you getting the message on the serial as long as the button is clicked. I hope this is clear
@Hangs4Fun
@Hangs4Fun 7 ай бұрын
@@DIYGUYChris that is how I handle "Button Presses" too
@Hangs4Fun
@Hangs4Fun 7 ай бұрын
@DIYGUYChris well, except the delay, I despise delay in microcontroller code. I either use Millis or interrupts with a simple Finite State Machine logic to give the illusion of "pauses or delays" but still have processor "free" to provide a multi task feel. This becomes VERY important when you want to react quickly to things like button presses, especially of you have a bunch of them
@medhasnaoui1533
@medhasnaoui1533 2 жыл бұрын
👍🎉👏👏👏👏
@kevinhoublon8630
@kevinhoublon8630 Жыл бұрын
Hello, great video 😄. I'm a beginner and I have a question : Can you use the MCP23017 with the TCA9548A multiplexer? Thank you in advance for your precious support 😁. Cordially.
@DIYGUYChris
@DIYGUYChris Жыл бұрын
Indeed
@kevinhoublon8630
@kevinhoublon8630 Жыл бұрын
@@DIYGUYChris Hello, thank you very much for your feedback 😁. Have a nice weekend 😄. Cordially.
@giantkherva2141
@giantkherva2141 Жыл бұрын
I have used mcp23s17 in a project to extend the io pins.but the speed is getting with 16-bit remote bidirectional 10mhz. What can i use instead of mcp23s17 to increase capacity. Can i connect mcp23s17 in parrallel to solve my problem? The problem in this project is that ic above 128kb is not being read,i want to read 192kb ic. Application need more io pin because of laptop keyboard connector is 32 pin connect to my pcb. I used mcu atmega88 in my project. This my programmer is only able to read io ic 128kb of laptop. Cannot read 192kb ic. How to solve this problem. Please help or make video on this topic. Thank you
@DIYGUYChris
@DIYGUYChris Жыл бұрын
You are already using the MCP23S17 in parrallel because it uses SPI communication which is already the fastest communication port for MCPs, maybe you need more software solution rather than hardware, try to read/write ports instead of reading or writing one bit at a time, it helped me to speed up the outputs writing for my MCP23017 once.
@giantkherva2141
@giantkherva2141 Жыл бұрын
program SPI_Communication; {$APPTYPE CONSOLE} uses SysUtils, Windows; const FT232RL_VENDOR_ID = $0403; FT232RL_PRODUCT_ID = $6001; SPI_MODE_0 = 0; SPI_MODE_1 = 1; SPI_MODE_2 = 2; SPI_MODE_3 = 3; type TTransferOptions = record Pin: byte; Mode: byte; BitsPerWord: byte; Speed: DWORD; end; var hDevice: THandle; TransferOptions: TTransferOptions; MCP23S17_ADDRESS: byte; IODIRA: byte; IODIRB: byte; GPIOA: byte; GPIOB: byte; procedure SpiInit; begin // set SPI mode 0 TransferOptions.Mode := SPI_MODE_0; // set SPI clock speed to 1 MHz TransferOptions.Speed := 1000000; // set bits per word to 8 TransferOptions.BitsPerWord := 8; end; procedure SpiTransfer(address, registerAddress, data: byte); var Buffer: array[0..2] of byte; BytesTransferred: DWORD; begin Buffer[0] := address or $80; // set MSB to 1 for write operation Buffer[1] := registerAddress; Buffer[2] := data; // perform SPI transfer if not DeviceIoControl(hDevice, $22200b, @TransferOptions, SizeOf(TransferOptions), @Buffer, SizeOf(Buffer), BytesTransferred, nil) then Writeln('Error: ', SysErrorMessage(GetLastError)); end; procedure MCP23S17Init; begin // set IO direction of Port B as output SpiTransfer(MCP23S17_ADDRESS, IODIRB, 0); end; procedure MCP23S17Write(data: byte); begin // write data to Port B SpiTransfer(MCP23S17_ADDRESS, GPIOB, data); end; begin // initialize FT232RL USB to serial converter hDevice := CreateFile('\\.\FTDIBUS0', GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED, 0); if hDevice = INVALID_HANDLE_VALUE then begin Writeln('Error: Unable to open device!'); Exit; end; // set vendor and product IDs for FT232RL if not DeviceIoControl(hDevice, $A2320001, @FT232RL_VENDOR_ID, SizeOf(FT232RL_VENDOR_ID), nil, 0, DWORD(nil^), nil) then begin Writeln('Error: Unable to set vendor ID!'); CloseHandle(hDevice); Exit; end; if not DeviceIoControl(hDevice, $A2320002, @FT232RL_PRODUCT_ID, SizeOf(FT232RL_PRODUCT_ID), nil, 0, DWORD(nil^), nil) then begin Writeln('Error: Unable to set product ID!'); CloseHandle(hDevice); Exit; end; // set up SPI communication SpiInit; // set up MCP23S17 MCP23S17_ADDRESS := $40; IODIRA := $00
@giantkherva2141
@giantkherva2141 Жыл бұрын
Please suggest what is the mistak in delphy code.
@abdallahkhmeri6570
@abdallahkhmeri6570 2 жыл бұрын
top borject
@jendoubimarouan3914
@jendoubimarouan3914 2 жыл бұрын
Good work ✌️🇨🇦
@amenighraibi5153
@amenighraibi5153 2 жыл бұрын
Top project
@pierrejeanes
@pierrejeanes Жыл бұрын
Does it work with esp32 ?
@DIYGUYChris
@DIYGUYChris Жыл бұрын
Indeed, it works with all MCUs
@temyraverdana6421
@temyraverdana6421 2 жыл бұрын
Thanks, useful project.
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Thanks
@Electronicshobbyy
@Electronicshobbyy 2 жыл бұрын
As always in the top 🎩
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
As always continued support 🙈
@tayebaouadi1413
@tayebaouadi1413 2 жыл бұрын
Great work, good continuation 👏
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Thanks 🙏
@yosrahmedi4753
@yosrahmedi4753 2 жыл бұрын
ohhh ça déchiiiire 😍gooood joob Chris
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Merci 🙈
@mohamedkamel7897
@mohamedkamel7897 2 жыл бұрын
Good job 🎖️
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Thanks 🙈
@eyarihani528
@eyarihani528 2 жыл бұрын
Good job 😉
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Thanks 🙏
@inlywang8157
@inlywang8157 2 жыл бұрын
Nice to see your new video, I wonder how long you spent on hand solder, the board is small, but you did a fantastic job.
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Yeah, soldering was challenging because of the tiny components size 🙈
@topreviews7690
@topreviews7690 2 жыл бұрын
I will need your help
@DIYGUYChris
@DIYGUYChris 2 жыл бұрын
Okay
@topreviews7690
@topreviews7690 2 жыл бұрын
@@DIYGUYChris I would like a hat that can hold up to 96 GPIO pin hat. With its own power supply from a 12v -24V DC BATTERY THAT 🔋 and cand a Automatically be controlled with the raspberry pie depending on load
@topreviews7690
@topreviews7690 2 жыл бұрын
@@DIYGUYChris I want to use R GB W on my 2005 theater Sequoia I'll be able to control it from a raspberry pie app inside the car
@topreviews7690
@topreviews7690 2 жыл бұрын
@@DIYGUYChris I need if I can make another GPL or USB HATt that could control all the 4k cameras on the S UV and store in a external SSD, like tasla camara blind spot camaras. I would like to know if there's a 3-D program that I could use for my vehicle to select toggle switches for my LED light on my car display inside the car
@topreviews7690
@topreviews7690 2 жыл бұрын
@@DIYGUYChris I want the raspberry pie depending on my command to tell if the door is open and if I can turn on the light what color will it be and what color can I change it to or if the Ignition switches on or off when till start loading data into it is hard drive
MCP23017 Port Expander and ESPHome: Add More I/O Pins to Your Project
20:39
Is Linux A Bad Brand?
13:20
WitheredTechnology
Рет қаралды 3,7 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 54 МЛН
Arduino Multiplexor - MUX INPUTS & OUTPUTS - ANALOG and PWM
13:21
Electronoobs
Рет қаралды 107 М.
Make your own Circuit Module | Decoder CD4515 | STM32 Nucleo tutorial
8:06
CHEAP DIY BOOST GAUGE
43:58
upir
Рет қаралды 186 М.
IO Expander with I2C
14:49
nLab
Рет қаралды 11 М.
MCP23017 GPIO Expander Demo PCB: Arduino Uno Relay Driver
9:46
Gadget Reboot
Рет қаралды 9 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33