Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Yet annother Retroflag NESPi case with Mausberry, Softshutdown, DUO-LED, Momentary switches



  • UPDATE: Link to working bash script with general software shutdown method

    So maybe @Yahmez and others can make use of this. This is my last script for this year ;)

    Hello fellows,

    my first build with a full grown RPi. The Retroflag NesPi housing is a real eye catcher and offers lots of space. Inspired by so much threads about the NESPi I decided to build my own.

    Grettings fly out @Yahmez for his nice hacking of the original switches (I take annother route and tried to rebuild the PCB with momentary switches)
    to @caver01 he inspired me to do the software shutdown (Not with a NPN transistor, as I now owe a Mausberry switch I revealed that you just need to set ground to high... ) by using a 0,5ct Si-diode
    to @meleu for his shutdown service... there are still things to solve ;)
    to @obsidianspider - or Mr. "A Raspberry fits everywhere" from whom I think he will also get in touch with such a project ;)
    The setup is very easy...

    The DUOLED is a green/red one:
    If the Mausberry is powered on, the green LED lights up
    If the Shutdown script is loaded (so we can get in touch to use the buttons) the red LED is also activated and results in orange.
    We press the Shutdown button (or software shutdown) the Mausberry shutsoff (green LED goes out) the red LED is still powered by the RPi and indicates shutdown activity.

    Two momentary switches:
    One is just for power, as the mausberry has a build in reset and you hold the button for 5s the switch will cut power without waiting for shutdown
    The other is the reset switch. It is intendend to act as physical reset to terminate any emulator and to restart ES.
    This one are also cent articels.

    I used the original buttons ... luckily they are long enough to act the momentary switches. I was also able to use the orignial screws, LED lighttube and even the little spacer nippels so this PCB fits as perfect as the original

    The SoftShutdown
    I got a smalltalk with @caver01 how to do this. My first idea was to use optomosfets that just acts as "physical" switch and the circuits of switch and Pi are separated (great advantage). You can also use a transistor NPN type and use the base current to switch the powerdown current (this also works).
    My route is much easier as it just used a Si-diode connected to mausberry-switch-ground. Advantage here - very cheap, only one point to solder and the Pi is protected to current backdraws. (PLEASE REPORT IF I'M WRONG HERE!!!! I don't take this as offense!)

    IMPORTANT note
    Set GPIO for softshutdown high for maybe 1-2seconds and then set them low!
    If you do this longer as 5s the Mausberry will do a reset and a hard reset is performed!

    # Initiate the GPIO for softshutdown
    GPIOpinSftShtdwn=16
            sudo echo 1 > /sys/class/gpio/gpio$GPIOpinSftShtdwn/value
            sleep 2
            sudo echo 0 > /sys/class/gpio/gpio$GPIOpinSftShtdwn/value
    

    The Mausberry
    Was just modified to remove the spring holder. I directly soldered to power output. There is also no need to cut the Mausberry (someone here did that!). Just use a Dremel/Proxxon and make a small cut in the holding column of the NESPi. The mausberry size is perfect for this case! I used a thin sheet of PEI/Capton (Kapton?) for isolation. Just covered the Mausberry with that.

    The Raspberry
    It's just a RPi2 but as I got a small wifi and BT dongle in my house I used this to get wireless connection. There is also space for a small USB data stick so the housing outside offers 4 USB slots.

    Am I satiesfied with it?
    No - it's a cheap build! I've done in my spare time
    The PCB is a breadboard - I don't like that!
    The GPIO cables are all soldered. It's better to use plugs.
    Better design a PCB board and etch it yourself.

    Pictures

    Perfect fitting Mausberry

    Mausberry

    The full mashine without topcase

    The full mashine

    Original bumpers and the fitting of the modified PCB

    switchs and the PCB

    The bare PCB - rebuild and modified

    the PCB

    Green Status - Mausberry is activ, shutdown buttons not initiated!

    Green status

    Orange Status - All buttons functional now

    Ready to go

    Red Status - I'm powering down

    Shutdown



  • nice!

    Im working on this as we speak, waiting on my mausberry to get here. do you have a schematic for your breadboard and pics of the wire layout overall?



  • @cyperghost I think you went a tad overboard with the custom pcb breadboard. I just modified the original board by cutting traces.
    2_1507498890410_B869753C-F5B9-4EBC-98CE-FA1336FDC62A.jpeg 1_1507498890410_960095A9-41EC-4A2B-A295-1AE2BBA2BA21.jpeg 0_1507498890409_25315586-1187-4717-9149-46A33B3B5F3E.jpeg
    Also showing the mauseberry wired in and the reset GPIO circuit that exits the running game like the real nes classic.



  • @lostless I am looking to do something sort of in between you two. There is no need for the stock power as the mausberry fits there, and your reset schematic seems over complicated. All you need to do since you cut the leads is wire one side of the reset to a ground and the other to a gpio. Do you guys know why the reset and power have 3 leads and not two?



  • @jmcfsu13 the switches can either be used as always on or always off. Or be set as one of 2 positions. My mauseberry was a broken one laying around where the micro sd port was broken so I removed the faulty port and just soldered the wires directly to the usb pads. I’m aware I can just run wires with a internal pull up resistor, but did the actual pull-up with resistors as a precaution. It doesnt effect the circuit at all, just lowers current flowing into the GPIO pin. But one resistor is required so the 3.3 is not shorted to ground when the button is presseed.



  • 0_1507506851160_6328F4FC-D7F1-4C96-B109-3D204F18DE65.jpeg
    How the reset button is hooked up. It’s programmed to trigger on a low and reads high by default.



  • @lostless cool thanks, can you tell me in a little more detail about the 3 leads on the switches? ive just seen it wired like 3 different ways now that seem to be able to all work.



  • @jmcfsu13 there are 3 sets of 2 pins. Each set is connected internally. Internally you can switch between the front and center or rear and center. The way it’s wired up by defualt is the power can latch between front and center or rear and center. But only the rear and center are wired up making it act just like a simple on off switch. The reset is a temporary push button that has its internals wires with the front and center hooked up so it’s on when not pressed. so when you press it, it opens and cuts power. I wired it in the opposite pins so it’s open when not pushed in. I hope that makes sence



  • @lostless dude thank you so much, yes that makes perfect thanks.

    what i was thinking with the reset is that you dont need to supply 3v to it. The way the basic powerswitch directions work is just by bridging pins 5 and 6 and then scripting to listen for the event. Cant you do the same with the reset button and since you cut all connections to it, just wire 1 side to 5 and the other to 6?



  • @jmcfsu13 i hooked up the reset switch as a pull up. The pin reads 3.3V by default, but you need, from what i understand, to feed a pin set to an input with 3.3 volts to read. I did it that way is so noise can't set off the pin. Its harder for a spike of voltage to go too far down to read low if i'm already at high. Im not using pin 5, but a standard gpio pin like pin 33. I don't know what the difference is between pin 5 and and the others . Maybe someone else can explain that.



  • @lostless said in Yet annother Retroflag NESPi case with Mausberry, Softshutdown, DUO-LED, Momentary switches:

    I think you went a tad overboard with the custom pcb breadboard. I just modified the original board by cutting traces.

    Well I wanted to avoid solering on a ready setted PCB - these aren't ready for soldering as the solder is lead free and needs higher temps to get liquid. You properly will damage the board and the wire insulation will melt. That does generally looks not clean and the soldering points are very weak towards mechanical stress.

    Second point is that you get issues if you perform software shutdown with the mausberry. This switch is intended to be the "captain" of all shutdown. As ES offers a shutdown menu the Pie powers down and the mausberry still provides power and is only useable again if you reset it or cut main power.
    To avoid this you need to press the button by remote - via GPIO signal.

    Maybe other power circuits behave better (@petrockblog 's PowerBlock seems to me the smartest device on the market) and it will be the perfect soultion here because the case offers much space .... so just pack a small PCB topside of the GPIO.

    @jmcfsu13 said in Yet annother Retroflag NESPi case with Mausberry, Softshutdown, DUO-LED, Momentary switches:

    Im working on this as we speak, waiting on my mausberry to get here. do you have a schematic for your breadboard and pics of the wire layout overall?

    Well I needed 9 connections.
    2 for the switch out from Mausberry to switchPCB
    2 for the LED out from Mausberry to green-LED (+150R ground) on switchPCB
    1 from Pi GPIO to switchPCB to red-LED (don't forget the resistor above or your red LED is dead)
    1 from Pi GPIO to Diode to Mausberryground connection on switchPCB (Softwareshutdown)

    Reset switch shematic is the same as drawn by @lostless
    1 RPi 3,3V
    1 RPi ground
    1 RPi GPIO with resistor (7k-22k)
    It set's GPIO via pullip to high and if you press switch the status gets low. So you are waitung for a change from value 1 to 0.

    The issues with the reset switch resulted as I wasn't able to get clean signal from the Mausberry LED ground... This is a bit floating so I was forced to use the 3,3 power rails from RPi :(



  • @cyperghost said in Yet annother Retroflag NESPi case with Mausberry, Softshutdown, DUO-LED, Momentary switches:

    these aren't ready for soldering as the solder is lead free and needs higher temps to get liquid

    The trick is to add leaded solder to the mix, then it’s easier to work with. Plus my iron gets hot enough, but been there where it’s not and it’s like working with putty. I’ve been an eletronics tech for 10 years and have done my share of modifying things.



  • @lostless Yes that's true you can solder if you mix with leaded one. But The connection is still not save against mechanical force therefore I used a new PCB and soldered through lugs (??).

    This is a high modded switch ...
    It has DUOLED support, software shutdown - surly doable with the orginial one but I don't like free wiring ;)
    But I think I will make a better solution with an etched PCB. I think I can organize all the needed equipment.



  • @cyperghost I don’t I’ll be pulling at these cables so not worried about that. Plus there is a beauty with cables all over the place. Looks more impressive to the technologically ignorant. Lol.



  • @lostless Well it doesn't matter as u usally don't look inside ;)
    But I checked your connections - well done ;)



  • @cyperghost thx. Not my first project. 😜



  • @cyperghost said in Yet annother Retroflag NESPi case with Mausberry, Softshutdown, DUO-LED, Momentary switches:

    My route is much easier as it just used a Si-diode connected to mausberry-switch-ground.

    Are you saying you figured out a way to get the Mausberry circuit to cut power after a software-initiated shutdown using just a diode? Can you explain what you did with that diode given the fact that my circuit looks like this:
    0_1507566566886_NES_large.png



  • @caver01 If the SW brown is the ground of the switch then just connect any GPIO wire to it. This shutdowns the mausberry.

      GPIO                               MAUSBERRY
    from Pie          DIODE            switch ground
       O---------------->|----------------O
    

    I measured a voltage of 3-4V between the switch poles.
    The mausberry don't cares of the voltage source.
    Is it from the switch or feed from the diode ;)
    The diode is just for protection of the Pie against voltage feed-backs.
    But the transistor also works....



  • @cyperghost
    I see. So you are merely simulating the voltage that would go there if the switch were triggered by supplying that voltage from the GPIO. That makes sense, and definitely easier than connecting a solid state relay or transistor across both switch poles.



  • @caver01 Exactly. As the Mausberry mains provides the same ground to all connected devices I see no problem with different ground potentials also. So this should work in general. But it would be nice if you report back.



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.