Control raspberry pi power supply via relay arduino

Hi everyone,

I’m trying to turn on RPi only when needed using Arduino (due to power consumption).

As I only need RPi to compile and upload the Arduino code, it is not necessary to have it connected all the time. So using the Bluetooth module (HC-05), I issue a command to trigger the relay to power on the RPi.

And everything works well, the RPi starts powering ON, BUT after 5 seconds the Arduino seems to reboot, thus turning off the relay. This only happens if the Arduino is connected to RPi through USB cable.

The RPi is also used for other purposes, and the project is more complex, but this is the crucial part that is not working.

Is anyone can tell me why this is happening and how can I solve this?

In the attachment, there is a schematic of this situation.

I appreciate any help.


Yes, when the Pi boots, it opens the serial port to which the fake UNO is connected, which resets it as it does in a programming cycle.

There is a link pad on the PCB marked "RESET-EN" which enables this function - you can cut the little jumper in the middle to prevent this happening but you have to solder it over again if you wish to be able to re-program it easily.

This totally makes sense.

First, this jumper is located on Arduino or RPi?

Second, is there any other option to cut the jumper? Maybe I could connect Arduino to RPi in a different way? FTDI? Idk...

I think I'll use an additional Arduino Nano to power up the RPi. Because even if I disable auto-reset, on Arduino upload, I would have to reset the Arduino and this will reset the relay, thus turning off RPi.

Aside from solid-state relay or additional Arduino, I don't see here any other option.

Can you put a cap on the Arduino to ignore the reset?

Put where? Sorry I did not found the location

10uF capacitor between RESET and GND on the Arduino board that is being 'reset' when a serial connection is opened/closed.

First: I don't have the 10uF capacitor with :frowning:

Second: Arduino still needs to be reset once I upload the code from RPi, thus disabling the relay and power off the RPi.

The capacitor is indeed an alternate means to temporarily disable the auto-reset. It can be mounted on a jumper and inserted when required on the main six-pin "ICSP" header, removed for programming.

But this is a manual process - you only need to program the Arduino from time to time (in fact, very rarely) so you can simply bypass the relay to keep the Pi on when you need to do that.

A capacitor is indeed worked, but I'm required to remove the capacitor to upload because the Arduino stop responding.

A capacitor is indeed worked, but I’m required to remove the capacitor to upload because the Arduino stop responding.

Yes that will happen. The trouble is that you are reprogramming the Arduino that is controlling the power of the device that is programming it. Like trying to pull yourself up by your own boot straps. You are stuck in a loop of dependancies.

So you need another processor to do the power switching, like an ATtiny.