Page 1 of 1

AXT style powerswitch fail

Posted: Sat Nov 14, 2015 9:27 am
by SkalTura
Hello,

Sort explanation: I'm using a microcontroller to switch on a relay, that switches on/off the Raspberry.
When the OS is loaded, one of the GPIO pins turns high, so the microcontroller detects that the OS is loaded, and when you press the power button again for a few seconds, the microcontroller sends a shutdown command to the Raspberry so it will shutdown properly. Then the GPIO pin is low again, so the microcontroller turns off the relay, turning of the power to the Raspberry.
Sounds simply, right ?
PiPower.jpg
PiPower.jpg (47.71 KiB) Viewed 807 times
But for some reason, when the relay switches on the Raspberry, my microcontroller shorts out and the relay switched off immediately.
When I switch on the relay first, and then attach the Raspberry, it works fine...
(NOTE: The GPIO pins were not connected when testing this, so they didn't cause the short of other weird power problems)

So there is some sort of huge power spike when the Raspberry is switched on...?
Any know of this problem, or any have a solution ?

Re: AXT style powerswitch fail

Posted: Sat Nov 14, 2015 7:41 pm
by JimmyN
It sounds more a voltage drop problem due to the load.

When energizing the relay and the RPi at the same time the voltage drops too low and the microcontroller drops out. If the relay is energized first, then adding the RPi startup power doesn't cause the problem.

Check the 5V input with a meter. Power up the relay and see what the voltage does, add the RPi and see what the voltage does. Then power up the relay and RPi at the same time, and check to see how much the voltage drops.

Re: AXT style powerswitch fail

Posted: Sun Nov 15, 2015 11:40 am
by SkalTura
That is what I thought at first, but if it was simply a voltage drop, the microcontroller would only reset.
If I leave the power no, the microcontroller gets very very hot, so it's not just the voltage drop.

Re: AXT style powerswitch fail

Posted: Sun Nov 15, 2015 1:29 pm
by ame
SkalTura wrote:That is what I thought at first, but if it was simply a voltage drop, the microcontroller would only reset.
If I leave the power no, the microcontroller gets very very hot, so it's not just the voltage drop.
The micro is probably latching up. You need to protect the micro's power from the relay/Pi power. It may be as simple as a bigger capacitor on the supply, or a Schottky diode to prevent power being drawn away from the micro.

Re: AXT style powerswitch fail

Posted: Sun Nov 15, 2015 2:56 pm
by SkalTura
When I place a diode between the power output to the RPi, it seems to work fine.
Only problem then is, that the diode take away a bit of the power, so the RPi keeps "saying" that the power is low.

I will try a diode in the powerline of the microcontroller, see what happens then.