Safe Shutdown Schematic, Help!

Having trouble with your GBZ build? Ask your questions here!
Post Reply
User avatar
Melonhead
Posts: 2
Joined: Sun Jul 07, 2019 12:18 am
Been thanked: 12 times
Contact:

Safe Shutdown Schematic, Help!

Post by Melonhead » Thu Aug 01, 2019 1:43 am

Hey there!

I've been working on building a simple, yet effective safe shutdown circuit for anyone wanting to not have to worry about corrupting their raspberry pi OS. I've come to a solution of my own but I'm having a dumb electrical problem, so let me walk you through the basic idea, and then I'll get to my issue.

Image

So the red wire is the 5v power line that feeds into the first pin of a basic power switch. The blue wire is the power line connected to the pi in order to power it. So if you turn the power switch to the left, the pi turns on, yay! After the pi turns on, GPIO pin 14 (UART0_TXD) goes high (3.3v) and it won't go low until the pi is in a shutdown state. GPIO pin 14 does this by default, so no extra coding is needed. Pin 14 then feeds into an electrical switch, which will be closed if 3.3v is applied on it's input pin, and open if 0v is applied. That electrical switch then bridges the pin 1 and 2 of the power switch, meaning that if the power switch is flipped off, then power will still be supplied to the pi. Finally, the green wire is connected to pin 3 of the power switch, and is connected to one of the pi's open GPIO pins (pin 18 for example) through a voltage divider. This way, when the power switch is flipped "off" the electrical switch will supply 5v to pin 3 of the power switch, also creating a HIGH value on GPIO 18, informing the pi to initiate a shutdown. Once shutdown, the UART0_TXD pin will stop supplying power to the electrical switch, cutting power to the whole circuit.

This schematic sounds all good, but there is one major problem. I can't find a suitable component to serve as the electrical switch. All that component needs to do, is connect pin 1 and 2 of the power switch, when 3.3v is supplied from GPIO 14.

I've taken a few electrical engineering classes, but I wouldn't call myself proficient at electrical design either. I've currently tried using N-channel MOSFETs and solid state relays to serve as this "electrical switch," but I can't seem to get anything to work. I might just be missing something small, and I might feel stupid later for asking :lol: , but do any of you have ANY idea what to use for this switch, and how to wire it up to this schematic? Do you know if this schematic would even work in the first place?

You're input would be greatly appreciated :D

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: Safe Shutdown Schematic, Help!

Post by tinkerBOY » Sat Aug 10, 2019 7:52 am

You need a mosfet with logic level gate. :) Something like a IRF510 or IRF520.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest