Hi,
I know that I can reset Pi by shorting two pins marked «RUN».
I need to be able to reset Pi from Arduino and the most obvious solution is to use a relay to short «RUN» pins. At the same moment it looks like an overkill. Is there a simpler way? Can I just connect one of the Arduino's pins to one of the «RUN» pins and just set this Arduino's pin to HIGH whenever I need to reset my Pi? Maybe there are other solutions?
Thanks.
- Burngate
- Posts: 6427
- Joined: Thu Sep 29, 2011 4:34 pm
- Location: Berkshire UK Tralfamadore
- Contact: Website
Re: Reset Raspberry Pi from Arduino
Probably not a good idea, as the Pi requires a short to reset it, not a High signal....connect one of the Arduino's pins to one of the «RUN» pins and just set this Arduino's pin to HIGH whenever I need to reset my Pi?
However, a FET could do the job for you - ground and Run to source and drain, gate to Arduino.
Re: Reset Raspberry Pi from Arduino
Not familiar with Arduino chips but the RUN pin appears to be a pull to 0V connection. In which case one should be able to use an I/O pin set output low to reset, input to leave it floating and allow the SoC to run.
-
- Posts: 623
- Joined: Sun Sep 27, 2015 3:26 pm
Re: Reset Raspberry Pi from Arduino
What about a transistor?
This signature intentionally left blank.
Re: Reset Raspberry Pi from Arduino
hippy's proposal elegantly avoids the need for external components, whilst avoiding any 5V/3V3 issues - the Arduino pin is either a high impedance input, or driven low as output briefly to reset the Pi
It might be worth including a series resistor from Arduino output to RUN input of a couple of kohm or so, just in case, for peace of mind. Or investigate whether setting the Arduino input's internal pull-down is sufficient to reset the Pi, instead of output driven low.
Open collector/drain junction transistor or fet would work too. Your choice.
It might be worth including a series resistor from Arduino output to RUN input of a couple of kohm or so, just in case, for peace of mind. Or investigate whether setting the Arduino input's internal pull-down is sufficient to reset the Pi, instead of output driven low.
Open collector/drain junction transistor or fet would work too. Your choice.
Re: Reset Raspberry Pi from Arduino
one question: do you really need a hard reset? or would it be sufficient to let the OS reboot?
regards,
MikeDK
regards,
MikeDK
Re: Reset Raspberry Pi from Arduino
From the Compute Module schematics, "run" is an input to the SOC with a 10k Ohm pullup. (https://www.raspberrypi.org/documentati ... EMATIC.pdf From this one would expect that pulling it low would reset the SOC and letting it go high would allow the SOC to boot.
Since I had the pieces at hand, I tried this out with a 3.3V microcontroller (MCU), an STM8S, not an Arduino, and it seems to work as expected. From the serial terminal, I logged into the Pi (2B), halted it, and then toggled the MCU gpio pin attached to "run". The Pi booted when the "run" pin was released. I also tried holding the Pi reset with MCU, applied power to the Pi, and then from the MCU released the Pi to boot.
I'm not sure what the original poster had in mind, but this would allow the MCU to start the Pi after it has halted, to reduce power perhaps, and it allows the MCU to hold the Pi in a reset state until it decides to let it boot, for system sequencing perhaps.
It should be noted that a lot of Arduinos are 5V I/O so appropriate measures would need to be taken when interfacing with the 3.3 V Pi I/O.
Since I had the pieces at hand, I tried this out with a 3.3V microcontroller (MCU), an STM8S, not an Arduino, and it seems to work as expected. From the serial terminal, I logged into the Pi (2B), halted it, and then toggled the MCU gpio pin attached to "run". The Pi booted when the "run" pin was released. I also tried holding the Pi reset with MCU, applied power to the Pi, and then from the MCU released the Pi to boot.
I'm not sure what the original poster had in mind, but this would allow the MCU to start the Pi after it has halted, to reduce power perhaps, and it allows the MCU to hold the Pi in a reset state until it decides to let it boot, for system sequencing perhaps.
It should be noted that a lot of Arduinos are 5V I/O so appropriate measures would need to be taken when interfacing with the 3.3 V Pi I/O.
Re: Reset Raspberry Pi from Arduino
Thank you all very much!
My goal is to implement a watchdog. I expect that my Pi might hang up from time to time and want to automatically reset it.
My goal is to implement a watchdog. I expect that my Pi might hang up from time to time and want to automatically reset it.
A dumb question: to which of two RUN pins (there are round one and square one) of the Pi should I apply 3.3V? I already have a logic level converter (like this one https://www.sparkfun.com/products/12009) since my Arduino and Pi talk via Pi's build in UART serial port, so I have a free line to convert 5V to 3.3V already.MarkTF wrote:Since I had the pieces at hand, I tried this out with a 3.3V microcontroller (MCU), an STM8S, not an Arduino, and it seems to work as expected. From the serial terminal, I logged into the Pi (2B), halted it, and then toggled the MCU gpio pin attached to "run". The Pi booted when the "run" pin was released. I also tried holding the Pi reset with MCU, applied power to the Pi, and then from the MCU released the Pi to boot.
- DougieLawson
- Posts: 40820
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: Reset Raspberry Pi from Arduino
If you hit the RUN pins at the wrong time it may not reboot (the hardware will do the hard reset, but the OS may not come back up). If an operating system is running and busy (not halted) then you could damage your root filesystem.hoho wrote: I know that I can reset Pi by shorting two pins marked «RUN».
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
- Burngate
- Posts: 6427
- Joined: Thu Sep 29, 2011 4:34 pm
- Location: Berkshire UK Tralfamadore
- Contact: Website
Re: Reset Raspberry Pi from Arduino
An fet is a transistor ... ah, you mean a bipolar transistor ... yes that would work, but the discussion has moved on ... apparently neither is needed!blaablaaguy wrote:What about a transistor?
Re: Reset Raspberry Pi from Arduino
I understand that. The hardware reset will be used as a last resort and with a quite reasonable timeout. Before that I'll do all possible software watchdogs. It's just if the device is totally not responding for, say, an hour, it's more likely that the OS will recover the filesystem (if needed) after the hardware reset than that it'll unhang again.DougieLawson wrote:If you hit the RUN pins at the wrong time it may not reboot (the hardware will do the hard reset, but the OS may not come back up). If an operating system is running and busy (not halted) then you could damage your root filesystem.
- DougieLawson
- Posts: 40820
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: Reset Raspberry Pi from Arduino
Having just had a RPi 1B reach 170 days without a reboot (last time was after a whole house power down for some plumbing / electrical maintenance, without that it would now be at 360 days uptime), I think you're overcomplicating things.hoho wrote: I understand that. The hardware reset will be used as a last resort and with a quite reasonable timeout. Before that I'll do all possible software watchdogs. It's just if the device is totally not responding for, say, an hour, it's more likely that the OS will recover the filesystem (if needed) after the hardware reset than that it'll unhang again.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: Reset Raspberry Pi from Arduino
It's the square one on my Pi 2B, the one further from the circuit board edge. The other pad is ground. I'd check this with an ohmmeter if you have a different version.hoho wrote:Thank you all very much!
A dumb question: to which of two RUN pins (there are round one and square one) of the Pi should I apply 3.3V? I already have a logic level converter (like this one https://www.sparkfun.com/products/12009) since my Arduino and Pi talk via Pi's build in UART serial port, so I have a free line to convert 5V to 3.3V already.
-
- Posts: 90
- Joined: Thu Jan 16, 2014 2:16 pm
Re: Reset Raspberry Pi from Arduino
I've Arduino Pro Mini (5V) version. I'd like to use one of the available pin of Arduino to hard reset Raspberry.
What would be most conevenient way to do it from Arduino? I have a bunch of resistors and leds I could use.
What would be most conevenient way to do it from Arduino? I have a bunch of resistors and leds I could use.
Re: Reset Raspberry Pi from Arduino
The issue is that your Arduino wants to output 5V as a logic high which exceeds the specification for a RPi input.John Public wrote: ↑Fri Feb 02, 2018 4:27 pmI've Arduino Pro Mini (5V) version. I'd like to use one of the available pin of Arduino to hard reset Raspberry.
What would be most conevenient way to do it from Arduino? I have a bunch of resistors and leds I could use.
The safest way to interface might be to use a dedicated logic level converter as linked above by "hoho".
In Arduino software you can do a limited emulation of an "open collector" output, that is, an output that is either logic low or high impedance, as follows. The risk with this approach is that a programming error on the Arduino has the potential to damage the RPi.
Code: Select all
void setup ()
{
digitalWrite (resetPin, LOW) ;
}
void loop ()
{
...
pinMode (resetPin, OUTPUT) ; // drive pin low
..
pinMode (resetPin, INPUT) ; // hi-Z state
}
Re: Reset Raspberry Pi from Arduino
The best way is to use an Arduino 3,3V Pro, so you won't have any problem with level conversions.
A regular 5V Pro mini will work at 3,3 V as well, if you aren't using a overdemanding sketch. Just put 3,3V on VCC.
When powered with 3,3V it should work @8MHz and working @16MHz will be theoretically somewhat overclocked, but practically it will do.
Re: Reset Raspberry Pi from Arduino
To avoid voltage problems, complicated code, one can simply use a diode. Set the output low to reset the PI, set it high or as input to let it run -
Code: Select all
-.-
.|.
.------. |_| .-----.
| | | | |
| Pi |---^---(O------|>|---| Ard |
| | .---(O---. | |
`------' _|_ _|_ `-----'
Re: Reset Raspberry Pi from Arduino
The Raspberry Pi SoC has a built-in hardware watchdog that can do that. You can enable it with a boot-time parameter (and run a userspace process which monitors the system and kicks the watchdog periodically)
But one thing it can't do is wake up the Pi if it's in shutdown mode, so you might use your microcontroller to periodically wake up a sleeping Pi by pulling its reset pin. Others in this thread have explored ways to do this electrically.
-
- Posts: 90
- Joined: Thu Jan 16, 2014 2:16 pm
Re: Reset Raspberry Pi from Arduino
Assuming that I have set the voltage to 3.3v in the Arduino what should I connect to the two "run" pins on the Raspberry. The "run" connection are rectangel and round -versions?
Re: Reset Raspberry Pi from Arduino
Possibly not what the OP wants, but my Arduino is connected to the PI via USB.
The Pi runs a python script (that runs automatically at startup).
It I press a particular button on the Arduino, it sends a serial message to the Pi.
The python script picks it up and issues a reboot command...
sudo shutdown - r now
The Pi runs a python script (that runs automatically at startup).
It I press a particular button on the Arduino, it sends a serial message to the Pi.
The python script picks it up and issues a reboot command...
sudo shutdown - r now
-
- Posts: 90
- Joined: Thu Jan 16, 2014 2:16 pm
Re: Reset Raspberry Pi from Arduino
I need a hard reset when system has locked up and needs a power down & power up.
With that in mind what wires from Arduino shoul go to the run pins?
With that in mind what wires from Arduino shoul go to the run pins?
Re: Reset Raspberry Pi from Arduino
When you say "locked up", do you mean you can't VNC in, or your application stops responding.
My Pi has seemingly locked up in the past, but the very simple script running in the background has always picked up the serial message from the Arduino over the USB and managed to either shutdown or restart depending upon what I ask it to do...
My Pi has seemingly locked up in the past, but the very simple script running in the background has always picked up the serial message from the Arduino over the USB and managed to either shutdown or restart depending upon what I ask it to do...
-
- Posts: 7545
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: Reset Raspberry Pi from Arduino
As has already been mentioned above..... The square pad is the reset and the round pad is ground.John Public wrote: ↑Sat Feb 03, 2018 7:19 amAssuming that I have set the voltage to 3.3v in the Arduino what should I connect to the two "run" pins on the Raspberry. The "run" connection are rectangel and round -versions?
In addition to the reset connection, a ground connection is also needed between the RPi and Arduino. The round pad next to the reset can be used or any other ground point.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 622
- Joined: Wed Jan 03, 2018 5:43 pm
Re: Reset Raspberry Pi from Arduino
Given this a small bit of thought, what I come up with is to get a few NE555 adjustable timer modules. Test the 555's till you find one that will run reliably at 3.3 volts. Have the output of the 555 go to what ever pin you want for what deed you want, may need to add a PN2222 to invert the 555 output. Whenever the RPi receives and process data from the Uno or Mega, have the RPI3 reset the 555 so it starts the timing sequence all over.hoho wrote: ↑Thu Jun 02, 2016 10:59 pmHi,
I know that I can reset Pi by shorting two pins marked «RUN».
I need to be able to reset Pi from Arduino and the most obvious solution is to use a relay to short «RUN» pins. At the same moment it looks like an overkill. Is there a simpler way? Can I just connect one of the Arduino's pins to one of the «RUN» pins and just set this Arduino's pin to HIGH whenever I need to reset my Pi? Maybe there are other solutions?
Thanks.
As long as the RPi is putting the 555 into reset from processing the Uno/Mega info the RPi 'works.' When the RPi does not put the NE555 into reset, the NE555 times out, switches state and the deed is done.
I checked out 5 NE555's and all 5 worked at 3.3volts.
Idaho, U.S.A.
-
- Posts: 565
- Joined: Fri Aug 25, 2017 2:58 pm
- Location: Blackstone River Valley, MA, USA
- Contact: Website
Re: Reset Raspberry Pi from Arduino
The TLC555 & LMC555 CMOS versions of the NE555 are designed to operate down to 2V & 1.5V respectively and over time and full temperature range.