Contribute
Register

Ersterhernd's NUCiMac G4

Status
Not open for further replies.
Thx Mactester, that makes sense. What i will be doing is programming code into the chip for auto-calibration at startup. Ive written a basic routine that worked flawlessly, but since my LCD died it is on hold. I figured why not let the software do the work?

I may program an auto re-calibration at intervals too. Not sure yet. Will post the code when it's up and running.


Ersterhernd
 
What i will be doing is programming code into the chip for auto-calibration at startup

This is an excellent idea! It could be programmed in the "init:" section, which is only processed 1times @ startup.

MacTester
 
Yes Mactester that's exactly right. I had my dimming function performing flawlessly in the initial tests. There was really no way to implement a serial interface in my iMac like yours, so this seemed like a logical workaround.


Ersterhernd
 
The iMac G4 Screen Brightness Control is complete! Special thanks to MacTester for all his guidance with this, it would never have happened without his direction.

The goal was to implement a + and - touch sensor controlled screen brightness functionality by using two sensors, one placed internally at each end of the DVD door. This would provide a clear reference point and easy touch access on the front of the iMac. The locations of the hidden sensors are shown below. Post 108 of this thread shows the sensors mounted on the inner side of the DVD door.


9rlu.jpg




The brightess is controlled from the sensors by the Picaxe 08M2 MicroController chip. I bought the complete starter kit and a couple of extra chips. The kit comes with a project board that allows USB to Serial programming of the microcontroller. Its a great product for this type of application, and the programming interface is well documented. Once programmed, I mounted my 08M2 chip into a small breadboard that sits above the NUC in the fan bay. The Picaxe 08M2 sits in the center of the breadboard. Seven wires are plugged into the board to control the reference voltage sent to the green inverter wire in the screen. It is shown wired up in the photo below.


IMG_4249.JPG



The programming code that controls the iMac brightness automatically calibrates the touch sensor functionality at system startup, so no user intervention is required to fine-tune the touch sensors. Software handles it all. Also, the code allows the user to recalibrate the touch sensors on the fly if need be, by simply pressing both the - and + sensors simultaneously. The Picaxe Controller immediately dims the screen to alert the user that sensor calibration is taking place, then returns the screen to default 75% brightness when the process is complete. It takes about 10 seconds. The user has several seconds to get his fingers away from the sensors to allow accurate re-calibration.


I've made a video of the functionality. It shows clearly how the brightness works.

iMac G4 Touch Sensor Brightness Control Video


The code attached below can be opened with the free MacAXEPad software, the programming tool for the Picaxe controller.



Ersterhernd
 

Attachments

  • BrightnessControlFinal.zip
    1.7 KB · Views: 227
Special thanks to MacTester for all his guidance with this, it would never have happened without his direction.

You're welcome!

I have to say, that your self calibration-extension of my initially software is a masterpiece. Well done!:thumbup: I've just loaded it and it works fine. Not one single change in your code was necessary.

Cheers! ;)

MacTester
 
I'm glad it worked for you, Mactester! It ran on my iMac last night and I must have done 50 or more brightness cycles with it. No issues. One change I made to your setup was that I left the purple inverter wire taped off and floating. Jberg said it goes to 5V, yet you determined it goes to ATX ground. It made no difference in my test operation, so I decided to pull it.

As far as the LED pulse goes, I'd have to pull my LCD wiring apart again to access the 5v dvi red wire. Unless there's some other way to detect LCD sleep and trigger the picaxe chip, I don't want to unbutton that sealed wiring.

You're input is welcome. I've really enjoyed your cooperation in utilizing this micro controller technology into the iMac.


Cheers!


Ersterhernd
 
One change I made to your setup was that I left the purple inverter wire taped off and floating. Jberg said it goes to 5V, yet you determined it goes to ATX ground. It made no difference in my test operation, so I decided to pull it.

I've measured 0.7V in original condition during the iMac was on and 3V during sleep. So I've decided to tie it to GND... However, I can confirm, that it does not matter if this wire is left floating or not.

As far as the LED pulse goes, I'd have to pull my LCD wiring apart again to access the 5v dvi red wire. Unless there's some other way to detect LCD sleep and trigger the picaxe chip, I don't want to unbutton that sealed wiring.

This is not necessary. You only need Pin 4 of the NUC front panel header and 5V (red) from the pico PSU. Pin 9 goes to a BC548 transistor to activate the picoPSU. See here: http://www.tonymacx86.com/imac-mods/104625-mactester57s-hemimac-g4-8.html#post652582

The rest is software.

MacTester
 
Ok thx Mactester. I was under the impression that the LED would pulse under Display Sleep as well as system sleep, which would have required communication from the 5V VEDID. The way you have it figured is very do-able for me.


Ersterhernd
 
I put together a diagram of exactly how I wired my Picaxe Controller chip into the Inverter Wiring for the iMac G4 Brightness Control. This is only a slight variation to MacTester's original diagram of the same connection. Mine connects to 3.3V on the PSU, not 5V. The software to program the brightness control functionality is found attached to this post above.



CompleteInverterWiring.jpg







Ersterhernd
 
Hmm... Looks good, but I think, you've drawn a short: The PWM out goes via a black "bridge" without resistors to GND and to the green inverter wire.

MacTester
 
Status
Not open for further replies.
Back
Top