PDA

View Full Version : Any write-ups on the power button for the G4 Cube?




JamesAvery22
Jan 7, 2007, 12:10 PM
I know I can get the bulk of it here:
http://www.dvwarehouse.com/Board,-Power-Button,-PowerMac-G4-Cube-p-25616.html

But is there a controller board? I can't find any documentation on this thing. I want to use it for a PC. Making an acrylic top is no problem. Just looking for pin-outs, dimensions, and maybe some pictures of someone else dissecting one.



JamesAvery22
Jan 9, 2007, 09:05 AM
Eh never found the answer to my question. Found a project more suited to me though:

http://forums.bit-tech.net/showthread.php?t=100148

Googling the part number of the Cube power button found me this thread:

http://forum.insanelymac.com/index.php?showtopic=21358

Poster wanted to do the same thing and never got an answer. They told him to try cubeowner.com forums which I searched for a few hours and never found any actual pin-out definitions. Just photos of the connectors that showed what wires went where on the connector. Seemed common that people would rip the wires out. Naturally all the wires are black though...

California
Jan 9, 2007, 03:45 PM
Eh never found the answer to my question. Found a project more suited to me though:

http://forums.bit-tech.net/showthread.php?t=100148

Googling the part number of the Cube power button found me this thread:

http://forum.insanelymac.com/index.php?showtopic=21358

Poster wanted to do the same thing and never got an answer. They told him to try cubeowner.com forums which I searched for a few hours and never found any actual pin-out definitions. Just photos of the connectors that showed what wires went where on the connector. Seemed common that people would rip the wires out. Naturally all the wires are black though...

The fix on my cube with a bad power button was to get an iMac G3 keyboard with the power button on it. Yes, it turned on the Cube without the smoking powerbutton problem! BUT my cube had bad usb ports so I could not use the rest of the keyboard.

Cheap solution: get an iMac keyboard with the powerbutton.

JamesAvery22
Jan 9, 2007, 05:33 PM
Thanks. Im not trying to replace or fix a cube though. I was trying to use the powerbutton part from a cube in a PC I'm building.

linuxguru
Sep 20, 2008, 08:47 PM
I found this post when i was asking the same question, but there appear to be no answers out there...so I figured it out and here is the answer.

I put a writeup here:

http://www.digitalsushi.com/home/nathanb/MacCubePowerButton

but, just in case that goes away, I'll put it in text too.

Looking at the small 5 pin connector, the pinout is as follows:
(looking from the top)
---------
| 5____ +5 volts
| 4____ (not connected)
| 3____ Control Line from Cube
| 2____ LED Power (3.3v from the cube)
| 1____ GND (0 volts)
|
---------

Also, the frame that the button is mounted on must be connected to GND. Normally this is done with the frame of the Cube, however when testing it I had to use a wire clipped between them.

Now if you just connect 5v between +5 and GND, and stick your finger over the button you will find nothing happens. That is because pin 2 is the power input for the LED. I didn't want to deal with another power line going to it, so I just connected a 1k Ohm resistor between +5 and pin 2. This did the job just fine. You can go smaller than that, I ran it up to the full +5 volts without seeing any problems, however I would say it is a safer bet to stick the resistor in there.

If you look just off the the side of the connector, there is a "large" rectangular chip which is a Phillips microcontroller (uC). Pin 3 on the connector goes to pin 18 on the uC. Pin 2 on the connector goes to pin 10 on the uC. Pin 11 on the uC is the output to the LED, and goes up to about 1.25 volts when the LED is on.

As it is somewhat difficult to solder to the pin on the connector, I soldered the 1k resistor between pin 15 (+5v) on the uC to pin 10. The pins on that are a lot bigger, so it was more strait forward (see pictures on the web page above).

If you have done this, or connected 3.3v to the LED power in connector pin (2), then you can stick your finger over the button and it will light up. If you hold your finger over the button for 4 seconds or so, the light will shut off. I have it setup such that the button only lights up when I am "pressing" it.

ATX (and similar) systems turn on/off when the power switch pins are shorted. To simulate this, I used a transistor connected to pin 11 (the LED output on the uC). The one I used is a 2n3904 NPN transistor, like you can get at Radio Shack. Really any "run of the mill" NPN transistor you can get your hands on will work.

If you want to use a MOSFET transistor, you might find you don't have enough voltage to turn it on. I originally tried a 2n7000, but you need 2.1 volts to turn that on. The NPN transistor only needs about 0.7v or so, and it works just fine.

So how to connect it. You will need a 10k Ohm resistor. Solder a wire to pin 11 on the uC, and go to the 10k resistor. That should go into the Base of the transistor (probably the middle pin, but look up the data sheet for whichever one you have). On the transistor, the Collector pin should go the the positive (+) switch pin on the motherboard, and the Emitter should go to the negative (-) pin.

Here is some crude ASCII art of the transistor connections (the "..." are just so things line up right, white space gets removed...which is "bad" for ascii art)

.......................................2n3904
.
.MB PWR+ pin----------- ..........._ -------------MB PWR- Pin
................................. C \ ......... /| E
...................................... \____/
...........................................|...........10k
...........................................B -------/\/\/\/-----Pin 11 on uC

If you do this, when the light is on the two pins will be "shorted" because the transistor is acting like a switch that closes when the light is on. To hold things in place, I just hot glued the transistor to the metal plate that the board screws onto next to the board.

This also means you need +5v to work with before the computer is on. If you lookup the ATX power connector pinout online, you will find that one of the pins is a +5v Standby (usually called +5vSTBY or something). This is the power the motherboard uses to run the power on/off stuff, wake-on-LAN, etc. You can connect to that power line (splice in, solder on, whatever) and use that to power the power switch board. The peak current pulled by the board is about 110mA when the LED is on, and less than 5mA when it is off (my Power supply only shows that low, in any case it is all far less than the +5v standby line can supply).

For those who want to keep the light on, the way you do that is as follows. The microcontroller monitors pin 18 (pin 3 on the connector) to see if it changes while the button is being "pressed." If you want the light to stay on, you have to pull connector pin 3 low while the light is on. If you do this, the light will stay on after you remove your finger. You can turn it off again by holding your finger over it for 4 seconds. I didn't do it this way, so I didn't have to deal with how to flip the switch on and off while the light stays on. You could do it with a one-shot type circuit (look it up on the web, they are common) that fires on the rising edge of the LED coming on. Like I said, I didn't do that.

linuxguru
Sep 20, 2008, 08:53 PM
I forgot to put this in my last reply, but here it is for completeness.

I think the Cube is determining that the button is being pressed by sensing that the LED is on via the current being drawn on pin 2 of the connector. That seems like the only line of "information" that goes back to the cube, and it would be pretty easy to sense it on that end.

AshmanE
Jan 25, 2009, 06:36 AM
linuxguru: This is great. I'd also come to the same conclusions about the pinout by reverse-engineering the connection to the Philips chip.

However, I'm wondering how well the setup works for putting a machine into sleep mode.

I guess if I set it up the way you describe and then hold my finger on the switch, the light will light up for 4 seconds. It seems that this should do the trick.

However, if you set it up using the one-shot to keep the light on while the machine is powered on, it seems like this would take away the ability to hold your finger on the switch and put your machine into sleep mode.

Any thoughts?

linuxguru
Jan 26, 2009, 07:50 PM
I'm not sure how well it would work for going to sleep. It depends a lot on how you have you hardware configured to know that it should go to sleep.

Putting your finger over the button for 4 seconds will turn the machine off completely. It sends a shutdown signal to the power supply that is running it. This is part of the PC98 standard (I think). Basically, it is just a hardware override to let you kill the power, since the button doesn't actually break the circuit like it did on the old AT style machines.

You could probably just tell your computer that you want it to go to sleep when the power button is pressed, and then you can just touch it and have it go to sleep. In Ubuntu (what I am running on mine), I have it configured to ask if I want to shutdown/switch user/restart/etc. It's the same as poking the button on a regular case.

If you want to do this, you might want to consider doing something for debouncing the button. If found that if I touch the button while it is on, it effectively gives 2 to 6 button press events. I didn't put anything on there to debounce it, so that is really my fault. You could probably just use an RC filter on the base of the transistor to cut down on the glitches. If you make the time constant (1/RC) something "long", maybe 0.1 seconds or something.

If you want to use the one-shot approach to keep the light on, then you could build in the functionality to give a pulse to put it to sleep. Just something that would pass though a button press event without turning off the light if the power was already on (monitor a hard drive power connector or something to tell when it is on).

Personally, I don't like having lights on, so I would leave it off and just put some debouncing on it.

choodalls
Feb 16, 2009, 04:50 AM
Hi,
No need for all the resistor and transistor stuff to get it to work. The whole purpose of the board is to perform the proximity switching function, so adding an extra switching transistor is NOT required as it over complicates an essentially quite simple device.
The 3.3v referred to by Linuxguru is simply intended to be the positive side of the PC "On" button and the GND connection should instead be referred to as the negative side of the PC "On" button. To say it differently, these are the outputs from the MOBO on/off power connection.
The rest of the write up by Linuxguru is fine, +5v connection is correct and the important point about grounding the plate on which the switch sits is also critical to how everything works.
To try and clearly set out how this switch can be used, I made a write-up (http://web.me.com/professionalpatents/MacMini/Cube_Switch.html) of this recently.
Waking, sleeping and on/off functions all work fine. Hope this helps.

Clive At Five
Apr 20, 2009, 08:00 AM
Wow, great write-up, choodalls and others. Question, though on the voltage amounts for +ve. Must it be 3.3v? I'm attaching this power switch to the D945GCLF2 (Atom Dual-Core) board from Intel, which I'm pretty sure throws out 5v from the + header. Sure I can use Linux Guru's resistor trick, but wouldn't that result in an always-on state?

Edit: Nevermind, it's -ve that changes... duh.

Thanks,

-Clive

Clive At Five
Apr 21, 2009, 01:47 AM
I now have some legitimate issues with the walkthroughs. I tested the voltages and +ve is indeed 3.3V from the intel D945GCLF2 board. I tied pin 1 to stby +5V, pin 4 to +ve and pin 5 to -ve. When plugged in, the circuit returns an "always on" state, which results in a 5-second power-up/reset cycle. Sure, I can start it by simply short-circuiting the header pins but I really want to get this touch switch to work.

Any suggestions? I suppose I could try the transistor business, but my recollection of my circuits class is a little hazy, and I'd at least like to have some sort of idea as to what is going on...

Thanks,

choodalls
Apr 21, 2009, 02:15 PM
Hi,
Only comment I can make is that my set-up definitely works with switching a Mac Mini on, off and into and out of sleep, and I am pretty much 100% certain the momentary switching requirements of the Mini are exactly the same as for the on/off switching of MOBOs in general use.
Important to realise that on the picture I put together, although I list five connections top to bottom, there are only three of interest. These are the +5v standby voltage you can get from your ATX, and the two wires that would normally be shorted by your push to make power switch. The ground wire of those two is the "bottom" wire, the other (next one up from bottom of my picture if I recall correctly) is the positive side of the switch - which when not shorted to ground by a proximity condition sits at around 3.3v.
With this arrangement, you must also make sure the actual shield area of the touch switch is properly earthed too, otherwise, some really bizarre things happen with it trying to turn on/off repeatedly. The plate part of the switch that attaches with a pair of short screws is crucial in this too, as if it becomes loose or detached the switch doesn't work and displays the same bizarre behaviours.
I would put money on the problem you are experiencing being either one of the two above switch panel earthing type issues, or you having something in the area of the switch that is perpetually sending it into an on state - or you have a faulty switch board!
Remember that when hooked up, the LED only pulses when the switch is actually activated by approaching finger, at all other times it will be off.
The dodge I use to make it look as if it is a proper "power on" LED is achieved by using a normal power on LED that shines through the base of the proximity switch LED and I am sorry I never got around to actually including a picture of that....I hope you get what I mean though.
I really wouldn't bother with farting about with transistors and stuff as it is over-complicating what I believe to be a supremely simple arrangement.
Good luck!

Clive At Five
Apr 22, 2009, 01:17 PM
I would put money on the problem you are experiencing being either one of the two above switch panel earthing type issues

This was indeed what the problem was... unfortunately, I discovered this after I had wired up all the crazy transistors & resistors. I knew that I was supposed to make sure the unit had proper grounding, but I didn't realize that it specifically referenced the screw hole! After playing around with my multimeter, I discovered that the one to the right of the circular switch (oriented with the connector in the top-right corner) is connected to the circuitry of the board. Since my controller board doesn't have room to mount in the original position, I simply attached it, via wire, to pin 5, which I connected to ground per "linuxguru's" instructions.

I presume that your method would work as well, but now that I have everything all soldered up and working, I don't have the will to mess with it. Maybe I'll try it with my next Cube ;)

I'll upload pictures and maybe a movie of everything in operation sometime soon.

Thanks for the guidance. I truly appreciate it!

-Clive

choodalls
Apr 23, 2009, 02:59 AM
Well, the main thing is you have it working! :)
I had that screw fall out at one point and saw the board go through the spiral of on/off rapid re-boots, so knew it was critical. Maybe i should adjust my write up on the web page to just underline that issue.........

choodalls
Jun 22, 2009, 09:17 AM
Just thought I'd post here that I have updated my write up of the switch function, see here. (http://web.me.com/professionalpatents/MacMini/Cube_Switch.html)
The update is just to make a couple of things clearer and also to share another workaround to make the switch LED function better.
I am using these switches now both in my modded Mac Mini installation and in a Mini-ITX project.
Hope someone finds the write up useful.

Toshibo
Oct 1, 2012, 11:27 AM
thanks for all hard work u guy thid! please upload pics hot to connect all cable on mini-itx mod! thanks

Just thought I'd post here that I have updated my write up of the switch function, see here. (http://web.me.com/professionalpatents/MacMini/Cube_Switch.html)
The update is just to make a couple of things clearer and also to share another workaround to make the switch LED function better.
I am using these switches now both in my modded Mac Mini installation and in a Mini-ITX project.
Hope someone finds the write up useful.

choodalls
Oct 2, 2012, 02:31 AM
thanks for all hard work u guy thid! please upload pics hot to connect all cable on mini-itx mod! thanks

You should find all you need at this link:

http://www.tonymacx86.com/case-mods/43924-cube-switch-modding.html