SkalTura
Posts: 12
Joined: Sun Oct 18, 2015 7:13 am
Location: Tilburg, The Netherlands

AXT style powerswitch fail

Sat Nov 14, 2015 9:27 am

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 806 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 ?
In the beginning there was nothing, but even that exploded

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: AXT style powerswitch fail

Sat Nov 14, 2015 7:41 pm

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.

SkalTura
Posts: 12
Joined: Sun Oct 18, 2015 7:13 am
Location: Tilburg, The Netherlands

Re: AXT style powerswitch fail

Sun Nov 15, 2015 11:40 am

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.
In the beginning there was nothing, but even that exploded

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: AXT style powerswitch fail

Sun Nov 15, 2015 1:29 pm

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.

SkalTura
Posts: 12
Joined: Sun Oct 18, 2015 7:13 am
Location: Tilburg, The Netherlands

Re: AXT style powerswitch fail

Sun Nov 15, 2015 2:56 pm

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.
In the beginning there was nothing, but even that exploded

Return to “Other projects”