Тёмный
No video :(

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

DIY GUY Chris
Подписаться 36 тыс.
Просмотров 26 тыс.
50% 1

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 ★☆★
PCB designing tool : www.altium.com...
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

Опубликовано:

 

27 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 65   
@safadjobbi7773
@safadjobbi7773 2 года назад
We need more videos like this 👏 🙏 keep up the good work 👏
@DIYGUYChris
@DIYGUYChris 2 года назад
Thanks 🙈
@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 🙈
@yosrahmedi4753
@yosrahmedi4753 2 года назад
ohhh ça déchiiiire 😍gooood joob Chris
@DIYGUYChris
@DIYGUYChris 2 года назад
Merci 🙈
@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 4 месяца назад
how is the pin state at startup of the expander? high or low?
@Hangs4Fun
@Hangs4Fun 6 месяцев назад
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 6 месяцев назад
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 6 месяцев назад
@@DIYGUYChris that is how I handle "Button Presses" too
@Hangs4Fun
@Hangs4Fun 6 месяцев назад
@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
@tayebaouadi1413
@tayebaouadi1413 2 года назад
Great work, good continuation 👏
@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 🙈
@abdallahkhmeri6570
@abdallahkhmeri6570 2 года назад
very good M'ester belkhir
@br52685
@br52685 5 месяцев назад
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 5 месяцев назад
Sure thing, it is as same as you set the arduino pin I/O
@Electronicshobbyy
@Electronicshobbyy 2 года назад
As always in the top 🎩
@DIYGUYChris
@DIYGUYChris 2 года назад
As always continued support 🙈
@amenighraibi5153
@amenighraibi5153 2 года назад
Top project
@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
@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.
@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.
@temyraverdana6421
@temyraverdana6421 2 года назад
Thanks, useful project.
@DIYGUYChris
@DIYGUYChris 2 года назад
Thanks
@jendoubimarouan3914
@jendoubimarouan3914 2 года назад
Good work ✌️🇨🇦
@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
@dasaikat
@dasaikat 7 месяцев назад
Can you please help me to find an gpio extension upto 2600 output
@DIYGUYChris
@DIYGUYChris 7 месяцев назад
shift registers is an option
@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) !
@mohamedkamel7897
@mohamedkamel7897 2 года назад
Good job 🎖️
@DIYGUYChris
@DIYGUYChris 2 года назад
Thanks 🙈
@eyarihani528
@eyarihani528 2 года назад
Good job 😉
@DIYGUYChris
@DIYGUYChris 2 года назад
Thanks 🙏
@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
@pierrejeanes
@pierrejeanes Год назад
Does it work with esp32 ?
@DIYGUYChris
@DIYGUYChris Год назад
Indeed, it works with all MCUs
@medhasnaoui1533
@medhasnaoui1533 2 года назад
👍🎉👏👏👏👏
@pierrejeanes
@pierrejeanes Год назад
What is that
@DIYGUYChris
@DIYGUYChris Год назад
MCP23017 Breakout board
@yhyamostafa7247
@yhyamostafa7247 2 года назад
You can make robot dog
@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
Далее
IO Expander with I2C
14:49
Просмотров 11 тыс.
Try these 16 Brilliant ESP32 projects!!!
11:18
Просмотров 570 тыс.
#363 Which ESP32 pins are safe to use?
11:53
Просмотров 129 тыс.
Why build an entire computer on breadboards?
28:43
Просмотров 3,1 млн
Expand your GPIO! PCF8574 & MCP23008
9:12
Просмотров 12 тыс.