I designed a PWS (personal weather station) which will be placed in a difficult to access location. In case of the master crashing and not requesting from the slave for a certain amount of time (stay alive protocol), is it possible to reset the master from the slave by powering a digital pin?
Note, I improvised a pull down circuit so that the Arduino Nano's D7 (or any other digital pin) 5V output could be pulled down to 3.3V.
-
1for me it didn't work for Wemos D1 mini. with level shifter it worked. I don't know why. but you should have a level shifter for esp8266 RX tooJuraj– Juraj ♦2019年07月26日 15:18:09 +00:00Commented Jul 26, 2019 at 15:18
-
care to elaborate into an answer? tks @Jurajtony gil– tony gil2019年07月26日 15:57:20 +00:00Commented Jul 26, 2019 at 15:57
-
1I plan esp-01S wiring experiments this weekend and the reset of the esp8266 from Arduino is one of the goalsJuraj– Juraj ♦2019年07月27日 06:17:27 +00:00Commented Jul 27, 2019 at 6:17
-
1The "RST" (reset pin) should work, try it w/o the other device, to see if it actually resets.aaa– aaa2019年07月27日 07:12:27 +00:00Commented Jul 27, 2019 at 7:12
-
@Juraj da man! tell me how that goes, please! Do you want me to post this fritzing diagram as an fzz somewhere?tony gil– tony gil2019年07月27日 08:55:04 +00:00Commented Jul 27, 2019 at 8:55
2 Answers 2
There is no need for a voltage divider or a level conversion on the reset pin of the esp8266. The esp8266 has internal pull-up on reset pin. To reset the esp8266 the reset pin must be connected to ground for a very short moment.
To pull the reset pin LOW with pin of the other MCU we do:
void resetEsp() {
pinMode(ESP_RESET_PIN, OUTPUT);
delay(1);
pinMode(ESP_RESET_PIN, INPUT);
}
ESP_RESET_PIN is the pin wired to reset pin of the esp8266. It is not configured in setup()
and it is never set HIGH
(we don't want to send 5 V to esp8266). Setting the ESP_RESET_PIN to OUTPUT
connects it to ground, setting it back to INPUT
hands the control of the line back to esp8266 reset pin's internal pull-up.
-
not sure i understand the wiring. Does that mean that my Arduino (MCU) digital out is connected directly to NodeMCU RST pin? If not, do you mind posting a Fritzing diagram?
UPVOTED
pending clarification for eventualACCEPT AS CORRECT ANSWER
.tony gil– tony gil2019年07月29日 17:36:14 +00:00Commented Jul 29, 2019 at 17:36 -
i am posting a Fritzing as an answer, please comment if correct or incorrect. Vote (up or down) if you will.tony gil– tony gil2019年07月29日 17:43:31 +00:00Commented Jul 29, 2019 at 17:43
-
yes direct connection, because there is never 5 V from Nano side. it only pulls the reset LOW2019年07月29日 18:13:46 +00:00Commented Jul 29, 2019 at 18:13
-
As per verification from Juraj, this would be correct wiring for his answer:
-
the point of reset from other MCU is not in wiring, but in code.2019年07月29日 18:11:48 +00:00Commented Jul 29, 2019 at 18:11
-
so is my original diagram correct, with the voltage divider?tony gil– tony gil2019年07月29日 18:25:18 +00:00Commented Jul 29, 2019 at 18:25
-
I removed my comments about level conversion on I2C following Majenko's explanation here: arduino.stackexchange.com/questions/67461/…2019年07月30日 09:11:22 +00:00Commented Jul 30, 2019 at 9:11
-
as I write in the answer you don't need voltage divider on reset because it has nothing to divide. there is never 5 V2019年07月30日 09:12:34 +00:00Commented Jul 30, 2019 at 9:12
-
1yes. of course there is a risk that some other unintentionally to Nano uploaded sketch sets the pin as output high.2019年07月30日 09:34:44 +00:00Commented Jul 30, 2019 at 9:34