esp12e nodemcu sink current 3.3v to D4 gpio2
Posted: Sat Nov 04, 2017 12:46 pm
greetings,
i have a NC reed switch connected from 3.3v to D4 (gpio2) on the nodemcu. i was doing some reading and i found out gpios can only source (supply) 12mA and sink (receive) 20mA. so i hooked up a multi meter between D4 and a potentiometer and the potentiometer to 3.3v to measure how much current was being sunk to D4. it turns out 20mA wasn't enough to change the state of D4 from low to high so that my blynk app reports "door closed". interesting enough, the light for d4 shuts off but it took about 38mA for the state to change. i was hoping to use a resistor in series with the reed switch to limit the current being sunk to D4 from 3.3v to 20mA to stay in spec but it looks like i can't.
if it helps, in arduino i have pinMode(D4, OUTPUT); is this correct?
is it ok to have about 40mA going from 3.3v to D4?
is it possible to have a NC reed switch hooked up to D4 and have the onboard light of the esp12e off when there is a connection (closed circuit) and on with disconnection (open circuit) ? the only way i've been able to do this is to have 3.3v connected with the reed switch to D4 and have D4 as an output in the arduino sketch. but, 40mA is being sunk from 3.3 to D4. i don't get why D4 has to be set as output since current is being sunk into it from 3.3v. it won't work at all if i set D4 as input or input_pullup. you'd think D4 would have to be an input since the current is going from 3.3 to D4?
i have a NC reed switch connected from 3.3v to D4 (gpio2) on the nodemcu. i was doing some reading and i found out gpios can only source (supply) 12mA and sink (receive) 20mA. so i hooked up a multi meter between D4 and a potentiometer and the potentiometer to 3.3v to measure how much current was being sunk to D4. it turns out 20mA wasn't enough to change the state of D4 from low to high so that my blynk app reports "door closed". interesting enough, the light for d4 shuts off but it took about 38mA for the state to change. i was hoping to use a resistor in series with the reed switch to limit the current being sunk to D4 from 3.3v to 20mA to stay in spec but it looks like i can't.
if it helps, in arduino i have pinMode(D4, OUTPUT); is this correct?
is it ok to have about 40mA going from 3.3v to D4?
is it possible to have a NC reed switch hooked up to D4 and have the onboard light of the esp12e off when there is a connection (closed circuit) and on with disconnection (open circuit) ? the only way i've been able to do this is to have 3.3v connected with the reed switch to D4 and have D4 as an output in the arduino sketch. but, 40mA is being sunk from 3.3 to D4. i don't get why D4 has to be set as output since current is being sunk into it from 3.3v. it won't work at all if i set D4 as input or input_pullup. you'd think D4 would have to be an input since the current is going from 3.3 to D4?