Mcp23017 as gpio input
Moderators: grovkillen, Stuntteam, TD-er
Mcp23017 as gpio input
I'm trying to use the inputs on the mcp23107 to sense garage door proton. Previously i was using gpio pins on the esp but I'm trying to combine the function of a few controllers to 1 so i need the port expander. The switches run about 9vdc and I'm using a voltage divider with the exact same value. Low is 0v high is about 2.73vdc which was enough to change the state on the esp gpio pins but i get no response from the mcp.
Even when i jump the pin to 3.3v it does not change state. Can anybody help? Using esp mega
Even when i jump the pin to 3.3v it does not change state. Can anybody help? Using esp mega
Re: Mcp23017 as gpio input
A bit more info would be nice, at least a screenshot of your ESPEasy configuration.
If you click the "Tool" tag and then I²C-Scan - is the MCP23017 shown in List?
Anyways: The MCP23017 has a reset pin (pin 18). This should be pulled to Vdd (pin 9) with a resistor 4.7 ... 10 KOhm.
If pin 18 is "low" the chip just doesn't show any reaction.
Regards
Shardan
If you click the "Tool" tag and then I²C-Scan - is the MCP23017 shown in List?
Anyways: The MCP23017 has a reset pin (pin 18). This should be pulled to Vdd (pin 9) with a resistor 4.7 ... 10 KOhm.
If pin 18 is "low" the chip just doesn't show any reaction.
Regards
Shardan
Regards
Shardan
Shardan
Re: Mcp23017 as gpio input
Yeah it shows up.
The A side outputs trigger a couple l293d chips and i get the desired response from that side.
The divider is gnd - 68k - mcp - 150k - 9vdc
Thanks for helping
Reset is tied to 3.3 no resistor.The A side outputs trigger a couple l293d chips and i get the desired response from that side.
The divider is gnd - 68k - mcp - 150k - 9vdc
Thanks for helping
Re: Mcp23017 as gpio input
Just for some testing:
Can you manually set the GPIO pin to low/high and see if you get a result?
I'm not sure to what the internal pull ups are set by ESPEasy, 68K/150K might be too high for the MCP23017 if an
internal pull up is set.
Regards
Shardan
Can you manually set the GPIO pin to low/high and see if you get a result?
I'm not sure to what the internal pull ups are set by ESPEasy, 68K/150K might be too high for the MCP23017 if an
internal pull up is set.
Regards
Shardan
Regards
Shardan
Shardan
Re: Mcp23017 as gpio input
I tried grounding and 3.3v directly a bit ago with no response. I'll try on an empty pin and see what happens
Re: Mcp23017 as gpio input
Grounding an empty pin works. State changes to 0 then back to 1 when disconnected
Re: Mcp23017 as gpio input
If i edit the plug-in is that something i can change or do i need to change resistors
Re: Mcp23017 as gpio input
Honestly i can't say if it is changeable by firmware - my programming knowledge is from last century literaly
For these purposes outside the house (or when machinery like pumps, motors or such are nearby) i'd prefer
a more protective way to convert down the level.
The schematic is shown in our Wiki: https://www.letscontrolit.com/wiki/inde ... _Converter
Scroll down to "precise unidirectional".
The resistor might have 330 Ohm...1KOhm, the Zener diode has 3.3V for direct connection to the ESP.
If your MCP23017 runs on 5V the ZD should have 4.7V
The advantage of this circuit: The voltage at the input pin of the ESP or MCP can not rise above the voltage of the ZD.
Regards
Shardan
For these purposes outside the house (or when machinery like pumps, motors or such are nearby) i'd prefer
a more protective way to convert down the level.
The schematic is shown in our Wiki: https://www.letscontrolit.com/wiki/inde ... _Converter
Scroll down to "precise unidirectional".
The resistor might have 330 Ohm...1KOhm, the Zener diode has 3.3V for direct connection to the ESP.
If your MCP23017 runs on 5V the ZD should have 4.7V
The advantage of this circuit: The voltage at the input pin of the ESP or MCP can not rise above the voltage of the ZD.
Regards
Shardan
Regards
Shardan
Shardan
Re: Mcp23017 as gpio input
Wow, who extended that part of the wiki so nicely?
Thanks shardan and grovkillen, you guys are awesome
Thanks shardan and grovkillen, you guys are awesome
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Mcp23017 as gpio input
Grovkillen and me
All the "Basics" and some sensor parts of the wikie, revamped partly by grovkillen, partly by me.
All the "Basics" and some sensor parts of the wikie, revamped partly by grovkillen, partly by me.
Regards
Shardan
Shardan
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Mcp23017 as gpio input
Thanks for appreciating our work.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Mcp23017 as gpio input
all that aside thanks for the heads up on the pull down being too high.
i don't have any zeners handy so using a 10k as the pull down part of the divider i can now get the inputs pulled to ground rather than floating
unlike the esp gpios it seems there's no selectable pull down.
there's still a chance to kill the mcp23017, i know, but at least its in a socket so i can replace it and go to zeners if its ever an issue.
i ran it for a month straight to the esp without issue. here's to my continued luck
i don't have any zeners handy so using a 10k as the pull down part of the divider i can now get the inputs pulled to ground rather than floating
unlike the esp gpios it seems there's no selectable pull down.
there's still a chance to kill the mcp23017, i know, but at least its in a socket so i can replace it and go to zeners if its ever an issue.
i ran it for a month straight to the esp without issue. here's to my continued luck
Who is online
Users browsing this forum: No registered users and 26 guests