As the title says... Chat on...

User avatar
By forlotto
#29522 NodeMCUv2 is the hardware I am using.

Which GPIO's are safe to use for RELAYS without causing conflict with the NodeMCU?

I see there are many GPIO's but I have read many posts telling me not to use GIPO 0 and other ports as well as they are used for writing flash memory and other things.

From what I can tell there is only 5 safe GPIO's to use but I need a minimum of 8.

Which ones are safe to use if you needed 8 and why?
User avatar
By Barnabybear
#29558 Hi, looking at this there are 13 GPIO's broken out, all of which are useable depending on which function you set the pin to (pins with more than one label have more than one function see here).
If you don't need to use them then GPIO's 0, 2, 15 & 16 are best avoided as the set they boot mode on power up & wake from deep sleep. That said it is quite acceptable to use them they just have to be in a known state for the first 100mS during power up.
Last edited by Barnabybear on Tue Sep 22, 2015 3:39 am, edited 3 times in total.
User avatar
By martinayotte
#29581
Barnabybear wrote:That said it is quite acceptable to use them they just have to be in a known state for the first 100mS during power up.

Absolutely right !
Since GPIO2/GPIO0 need to be pulled-up during power up for normal EXEC boot mode, they are a perfect fit for an I2C Bus since this one also requires pulls-up. This means that an GPIO Expander such MCP23017 or PCF8574 can be easily added to provide any additional GPIOs.
User avatar
By forlotto
#29616 Most excellent folks this is good info but it conflicts with other info I have read such as the book http://neilkolban.com/tech/wp-content/u ... r-2015.pdf

Page 103 he has things laid out according to RISK as he calls it. Others are highlighed in red as well. So I guess this is where my confusion came from.

You will note the ones in RED are GPIO 0 - Pin controls state of ESP8266 at boot. Caution when used as an output
pin. (I assume it is because it may be pulled low and cause an undesirable circumstance?)

Thanks guys you folks are at least helping me put together the pieces of what is a small puzzle for me before I start doing anything though I figured I better get the GPIO's that are best to use known but according to what you say and what they say I will still need to modify what I have made thus far to reduce the chances of conflict something still tells me to stay away from GPIO 0 even just how you folks talk about the potential.

THANKS guys I cannot thank you enough this feels a bit more like a community effort wish you all the best and forgive me for not comprehending the mixed sources of information.