Contribute
Register

Ersterhernd's NUCiMac G4

Status
Not open for further replies.
The software-controlled LED is now functional on the iMac. Using a Picaxe Micro-Controller and MacTester's pulsing LED code (thx MacTester!) that I modified slightly to suit my build, the LED in the iMac display now does the following...

1. Intializes with USB 5V power at system startup
2. Stays lit at about 20% brightness during operation
3. Pulses in an emulated 'breathing' rhythm during system sleep
4. Re-wakes to 20% brightness up system wake from sleep
5. Shuts off at system shutdown


To control the LED, the following power configuration is utilized...

1. 5V USB power for supplying Picaxe Micro Controller.
- This allows the Picaxe to function during system sleep and shut down when powered off

2. 5V Front Panel Pin 9 for detection of sleep or wake state
- Pin 9 of the Front Panel Header goes to 0V during sleep, 5V during wake

3. PWM output power from Picaxe Chip to power the LED
- Continuous 20% PWM output during wake
- Pulsing PWM power output during system sleep



The Picaxe LED circuit is wired into a small breadboard that is wrapped in electrical tape. Five wires come out of it, they are...

1. 5V supply in from USB to Picaxe Controller
2. GND to the PicoPSU for Picaxe Controller
3. 5V from Pin 9 Front Panel Header to pin C.3 of Picaxe (for sleep/wake detect)
4. 5V USB power output via 330 Ohm resistor to iMac LED
5. PWM Power Return from iMac LED via BC547B transistor/PWM control to PicoPSU ground


Here's the circuit layout diagram

LEDPulseCircuit.jpg




Wrapped in electrical tape and mounted in the iMac, Picaxe chip remains accessible for re-programming.

IMG_4274.JPG




Here is a Video Demonstration of Startup, Sleep, Re-Wake and Shutdown.


The code for the Picaxe Controller is attached below.



Ersterhernd
 

Attachments

  • SleepLEDFinal.zip
    1.3 KB · Views: 280
A Video Demonstration of this board is available on YouTube. It uses a small test LED, which shows exactly how the board will function when installed in the iMac G4 connected to the actual power LED at the bottom right of the LCD Display. The video link is here.


Ersterhernd
 
The Sleep Pulse LED circuit is now installed into the first NUCiMac machine. It was another 'head scratcher' because of an elusive problem that was randomly occurring after the install. Everything was wired in exactly as it was in the other machine, which is running flawless. With this G4, though, the LED was randomly flickering (either during normal use or sleep state) like there was some loose connection somewhere in the circuit.

I tried everything I could think of to fix it, but no solution. Finally I found the issue, it turned out to be that I needed the circuit grounded to a USB ground. Grounding it to the PicoPSU like in the other machine caused the flickering LED issue. Once I spliced it into a black USB GND wire, the G4 LED now stays firmly lit and controlled by the Picaxe chip.

I've modified my original diagram to show the change. I thought a ground was a ground, but I guess not. o_O


LEDPulseCircuit.jpg




A short video demonstrating the Picaxe controlled LED during S3 sleep is available here.




Ersterhernd
 
DONE!

Both iMac G4's (aka NUCiMacs) are now officially complete! The final work was completed this week with installation of the pulsing sleep LED's in both units. I have one in my office, and my wife is using the other in her office upstairs.


d4ov.jpg




Hardware Summary
Both systems run identical hardware. Each 17" iMac G4 contains:

- Intel NUC DC3217IYE with i3 processor
- 8 GB 1333 RAM
- 128 GB mSATA SSD Storage (Plextor and Crucial)
- Apple A1181 Bluetooth
- Broadcom Wifi
- Internal 19V NUC PSU
- Internal PicoPSU WI-25-120 PSU
- BC547B Transistor actuated PicoPSU on/off control
- Picaxe 08M2 Micro-Controller for touch-sensor LCD brightness control
- Picaxe 08M2 Micro-Controller for pulsing sleep LED
- Picaxe 08M2 Micro-Controller for PWM case fan control
- Startech HDMI to DVI converter with MOLEX PN 74320-4004 connector
- Noctua NF-B9 92mm Case Fan with software PWM speed control
- SYBA SD-CM-UAUD USB Stereo Audio Adapter
- 3.5mm Audio Jack
- Original iMac G4 'bowling ball' speakers
- External 20W amplifier
- 3 x USB 2.0 port
- Gigabit Ethernet port
- Original Power Plug
- Original Power Button
- Hard Reset button
- Apple BT Trackpad/Wireless Keyboard/Wireless Mouse
- DVD-ROM not installed


Software Summary

- OS X Mountain Lion 10.8.5
- Working App Store/iCloud/iMessage
- Fully functional Sleep and Re-Wake
- Full Speed-Step Functionality


Special Acknowledgements

- MacTester57 for his technical assistance with the Picaxe Controllers
- Jberg44 (aka The Dremel Junkie) for his comprehensive tutorials
- The two vendors on Craigslist who sold me their 17" G4 machines ;)


Post-Build Comments

These two builds were by far the most challenging to date that I've completed. The wiring, the fitment and the troubleshooting of the various issues along the way proved to be much more involved than I had originally anticipated. I made a couple of mistakes along the way, one cost me my LCD display and burnt PicoPSU. That wasn't fun. Getting the Intel NUC to properly sleep and re-wake was difficult, too.

Now that both machines are fully operational, I have to say that the project was well worth the effort. They are a gorgeous white showpiece, and a pleasure to use. They are whisper quiet and the adjustable display positioning is a real treat! Combined with an ultra-sensitive touch sensor brightness control, the LCD provides a rich experience and great color. While sleeping, the gently 'breathing' LED pulses silently, just as it did on the original machines. The 1440x900 resolution is adequate for desktop use. This LCD came very early in this type of techonology, and still looks great even 10+ years later.

The 'cherry on top' of the entire project is watching OS X Mountain Lion appear in seconds on the LCD screen. Now able to perform functions like fullscreen HD Video, the old iMac G4's have a 'coolness factor' that is above and beyond any other build I've done to date. I enjoy the G4 every time I turn it on.

I hope to see others take on this project. Inspiration of more G4 mods was one of the primary reasons I started it in the first place. Seeing MacTester57's completed build was a sweet experience for me. It would be great to watch others jump on board.


Ersterhernd
 
One more addition to the NUCiMacs... PWM Case Fan control.

MacTester came up with this idea (credit goes to him!) and I liked it, so I decided to install my own implementation of it. It uses the existing fan I have mounted in the iMac, a Noctua NF-B9 1600, which will run at 1600, 1300 and 1000 rpm out of the box, using included noise adapters from Noctua.

I will start out by saying that this machine was already 'whisper quiet' with the 92mm Noctua NF-B9 running throttled down via it's included U.L.N.A at 1000 rpm. That said, it wasn't silent. A gentle 'whirrrrrr' of air could be heard blowing from the top vent holes in the dome. I'm happy to report that the machine is now DEAD SILENT with the added PWM Fan control, courtesy of the Picaxe 08M2 Micro Controller.

I did not add adjustment touch sensors or temperature sensors to the fan, the object of this exercise was simply to control the fan through software to obtain silence with as little temperature gain as possible. I've accomplished that goal with this latest modification.

Here's the details...

Through Picaxe PWM control, the Noctua 92mm fan (a non-pwm 3-wire version) now operates by:

1. Full power for 3 seconds at startup to get fan spinning.
2. Operates for 30 seconds at a medium speed
3. Operates for 30 seconds at a very low speed (just barely keeps the fan blades turning)
4. Steps 2 & 3 repeat three times
5. Every three cycles of steps 2 & 3 (three minutes total) the fan goes to a high speed setting (still silent) for 20 seconds.
6. The cycle repeats again starting at step 2.

This is probably overly complex, but it works, and runs completely in the background via control of the Picaxe chip. The user has no idea the fan is even running, let alone changing speeds every 30 seconds. A slight breath of air can be felt blowing out the top vent holes in the dome.


The wiring schematic

a4gp.jpg




Connection to the Noctua Ultra Low Noise Adapter (U.L.N.A)

qlzy.jpg




The added Picaxe Controller chip mounted in the same breadboard as the LCD dimmer controller

k9uh.jpg





Heres the code for the PWM control

Code:
'iMac G4 17" Hackintosh Case Fan Control by Ersterhernd

setfreq m4						'set chip frequency to 4MHz

#Picaxe 08M2						'set Picaxe chip type to 08M2

symbol lowspeed = w0		'variables and constants assignment in this section
symbol mediumspeed = w1
symbol highestspeed = w2
symbol startupspeed = w3
symbol loopcounter = b9		
symbol FAN = c.2

init: 
	
	let loopcounter = 0
	let startupspeed = 400
	let highestspeed = 180
	let mediumspeed = 145
	let lowspeed = 110
	
	pwmout FAN,99,400		'set PWM duty to 10KHz @ 100%			
	pwmduty FAN, startupspeed	'Max fan speed 3 secs at startup
	pause 3000

loopstart:
	
	if loopcounter = 3 then			'every 3 minutes run fan slightly faster for 20 secs
		let loopcounter = 0
		pwmduty FAN, highestspeed
		pause 20000
	end if
					
	pwmduty FAN, mediumspeed		'medium speed 30 secs
	
	pause 30000
	
	pwmduty FAN, lowspeed		'low speed 30 secs
	
	pause 30000
	
	loopcounter = loopcounter + 1

	goto loopstart




Ersterhernd
 
I did not add adjustment touch sensors or temperature sensors to the fan, the object of this exercise was simply to control the fan through software to obtain silence with as little temperature gain as possible. I've accomplished that goal with this latest modification.

Here's the details...

Through Picaxe PWM control, the Noctua 92mm fan (a non-pwm 3-wire version) now operates by:

1. Full power for 3 seconds at startup to get fan spinning.
2. Operates for 30 seconds at a medium speed
3. Operates for 30 seconds at a very low speed (just barely keeps the fan blades turning)
4. Steps 2 & 3 repeat three times
5. Every three cycles of steps 2 & 3 (three minutes total) the fan goes to a high speed setting (still silent) for 20 seconds.
6. The cycle repeats again starting at step 2.

This is probably overly complex, ...
Not at all it is a very simple way of reducing the noise. Question is does this impact CPU temperatures under full CPU stress testing, or are they similar to before? It would be very easy to add temperature control it seems to be directly supported, and trivial to implement.

http://www.picaxe.com/Circuit-Creator/Sensors/DS18B20-Digital-Temperature/
 
Thx for that link Kiwi. It indeed looks easy to add a sensor. I've just ordered a handful of the DS18B20 units off eBay. Sure is nice n quiet now. Haven't tried CPU stress tests yet, maybe I will wait to install the DS18B20 first so I can program in a maximum threshold temp that activates a full on fan.

The picaxe pwm fan control is definitely the way to go, as the NUC doesn't have a fan header on board.


Cheers!
 
MacTester came up with this idea (credit goes to him!)...

Thanks for mention!

I would recommend to use 25kHz PWM frequency (above the hearable range). I had hearable high frequency noise here with 10kHz. If I will use the NF-B9 fan, then I will use a BCX38C darlington transistor (800mA).

The Temperature sensor will be a DS18B20. I will try to calculate the PWM frequency out of the temperature reading, using gain and offset values. If that works then the fan rpm control will work very smooth.

I'm not yet sure, if I will replace a 08m2 Picaxe processor with a 14m2 or add a third 08m2 for the fan control.

MacTester
 
Hi Mactester, thx for that info. I didn't notice any whining whatsoever, but will try a higher freq and a BCX38C transistor. The BC547B seemed to work, but should I be running a more robust one like the BCX38C instead?

Pls advise. Thx.


Ersterhernd
 
Hi Ersterhernd. The Transistor must be able to handle the maximum fan current. See Datasheet. Heat dissipation is no problem with PWM. I've just tried a BXC38C (Darlington, Peak Pulse Current 2A, Continuous Collector Current 800mA), works fine.

Cheers! (Prost) ;)
 
Status
Not open for further replies.
Back
Top