Contribute
Register

MacTester57's iMac G5 17" (A1058 Model)

Status
Not open for further replies.
Looking very good.

Thanks, Kiwi.

As you know, I was looking for a suitable P-channel Mosfet. I guess, I've found it - the tiny little FDN360P: http://www.distrelec.ch/Web/Downloads/_t/ds/fdn360p_eng_tds.pdf?mime=application/pdf

I also wanted to do some tests with SMD stuff.

So I decided to design a small "G5 Fan Tester" board.

The schematic with a totem pole driver:
G5 Fan Tester Schematic.png


The board from OHS Park ($4.25 for 3):
20150317-3174199.jpg


It's single sided and there is only a GND plane on the bottom.

After a bit of soldering:
20150317-3174202.jpg


The Mosfet is Q4. Note how tiny it is in comparison with the fan header!! The SMD soldering was done in accordance with this guide:

Size comparison with the G5 CPU fan:
20150317-3174206.jpg


Conclusion:
- SMD soldering is not as difficult as it looks
- The FDN360P stays very cool and appears to be the perfect solution for fans, which need to be switched on the P side.
- I've tested with 31.5kHz (with only a 100nF cap on the fan side) and with 123Hz (with an additional 47uF cap)
- the totem pole driver (which is used in this test setup) is not even necessary for low frequency PWM, so only an NPN transistor with a pullup is needed for driving the Mosfet.

MacTester
 
Last edited:
You goal for perfection is admerible, my question is what now for the smc you have already built?

Are you going to redesign it, or just augment with these small boards distributed in the case.

One of my goals for the smc board (manufactured) was to make the prospect of incorporating an SMC more achievable to the mainstream builder, including individual fan control ( your design) was a good enhancement, the liner lm317 wasn't really ideal.

Another goal was to extend this concept to maybe the G4, or other similad computers. I think surface mounted devices might put the average builder off, but really this is very specialised field so it is probably 50/50

from my perspective BJT, for the fan controller I think are perfectly good, but actually really it doesn't matter, both approaches are pwm compatible

My main goal now is to keep the size (height) of the smc to a minimum, to that end I have ordered some PNP transistors in the TO251 package, these are very small.

Keep posting your progress
 
Hi Mactester,

I just watched the eevblog video, and yes it doesn't look as difficult as I would have thought, so please ignore some of my comments in previous post.

Here is a thought, if you are going to re-do your board in SMD, then you can mount an Mega32U4, and PAM8403, etc right on the main board, and dispense with the custom modules altogether.

Just a thought ;)
 
You goal for perfection is admerible, my question is what now for the smc you have already built?

Thanks, Kiwi. I will not change my current SMC. The SMD test board is only intended to do some SMD soldering practice and to test the Mosfet. Based on the positive experience with this little board, I will probably do my next project in SMD technique.

I also have my solar MPPT project, which is working fine, but still scattered across several stripboards. This will probably be my next eagle board project...

One of my goals for the smc board (manufactured) was to make the prospect of incorporating an SMC more achievable to the mainstream builder

If someone is interested in doing that, he can choose one of our two current boards in thru-hole technique. Unfortunately it looks like, that we two are the only ones...

Here is a thought, if you are going to re-do your board in SMD, then you can mount an Mega32U4, and PAM8403, etc right on the main board, and dispense with the custom modules altogether.

Just a thought

This should be doable. Maybe I will do it one day...
 
MacTester I am very impressed with your project. I follow yours and Kiwi's postings daily. Even to the point that I am playing with a Arduino Leonardo.

I assume that you each have a fairly large following.

I am concerned that the general interest in case mods appears to have fallen off. Maybe these projects will get more people into new projects.

Anyway again I am very impressed with your new assembled SMC board.

Good modding,
neil
 
MacTester I am very impressed with your project.

Thanks, neilhart! :)

Even to the point that I am playing with a Arduino Leonardo.

Good to hear! :thumbup:

I am concerned that the general interest in case mods appears to have fallen off.

Yes, unfortunately it looks like you're right. There is not much activity in the Case Mod section anymore - especially in the iMac section (yes, I know, they are a bit difficult to do)... Maybe you should put more Case Mod threads to the start page?

MacTester
 
Hi Kiwi

As you suggested I've changed the serial baud rate to 115200. Seems to work fine with the slider applet and with terminal commands (both changed to 115200 too).

The critical "BA" and "BD" commands are still confirmed with "OK", but it looks like this is not even necessary. I've tested with all three fans connected (@ normal & high RPM). No missed commands anymore - fingers crossed...

To read the fan RPM, I've added the "FR" Fan Read command and tested it from the terminal. Do you know, how more than one variable could be read from the slider applet? Is it possible to read an array with the slider applet?

I know, stupid question, but I'm still not really familiar with Xcode... Why all that? I would like to add fan RPM and temperature readings to the slider applet.

My current Arduino sketch and slider applet are attached.

MacTester
 

Attachments

  • Archiv.zip
    21.5 MB · Views: 117
Hi Kiwi

As you suggested I've changed the serial baud rate to 115200. Seems to work fine with the slider applet and with terminal commands (both changed to 115200 too).

The critical "BA" and "BD" commands are still confirmed with "OK", but it looks like this is not even necessary. I've tested with all three fans connected (@ normal & high RPM). No missed commands anymore - fingers crossed...

To read the fan RPM, I've added the "FR" Fan Read command and tested it from the terminal. Do you know, how more than one variable could be read from the slider applet? Is it possible to read an array with the slider applet?

I know, stupid question, but I'm still not really familiar with Xcode... Why all that? I would like to add fan RPM and temperature readings to the slider applet.

My current Arduino sketch and slider applet are attached.

MacTester
Good that the baud rate change improved things, I will make this change also. As for the OK response, I will keep this on the BA and BD commands (only) since it is something that needs to work.

Passing multiple pieces of information in a single message really comes down to a will formatted string. Probably the simplest convention to adopt is JSON. e.g.

Code:
{ "fan1rpm":2100, "fan1rpm":2150, "fan1rpm":2200, "temp1":21.3, "temp2":25.3, "temp3":29.3 }

So a single printed line would contain the above message. From there it is a relatively easy job to extract the information.

The other convention that I have adopted during my own testing are commands to enable and disable logging. i.e. Once enabled, every five seconds (or so) the message would be sent from the Arduino and could be read by the Menu code and acted on as appropriate.

The hassle of this is that we have a single serial port to play with, so menu code needs to differentiate the incoming message. Without making it complicated simply detecting a "{" as the first character could be used to know that it was a measurement data packet.

However you have probably realised that I am not really a Mac developer myself, thus the Preferences window in the Menu never got developed. Thus my plan is to adapt the following project

https://github.com/kozlek/HWSensors

to read and display temperature and RPM values. It already has a plugin architecture with several existing code examples, and a community to support it ;)

The only complexity with this is is that (as hinted above) serial port communication is single user, thus one of the two application (would suggest HWSensors) controls the serial port, and the Menu then sends and receives commands via HWSensors. Communicating between two processes should be relatively easy to achieve.

Kiwi
 
Hi Kiwi

Thanks for your hints. Enhancing HWSensors would be the perfect solution, because It's already installed on all my hacks.

In the meantime I've managed to transfer all the RPM and temperature readings to the Slider applet.

Arduino code:
Code:
//----Fan serial interface

// This function processes the fan related serial commands
void processCommandFan(String subCmd, String extraCmd) {

  noInterrupts();

  if (subCmd.equals("R")) {
    // Fan Read (Slider Applet reads from the Arduino)
    Serial.print(fan1Rpm);
    Serial.print(";");
    Serial.print(fan2Rpm);
    Serial.print(";");
    Serial.print(fan3Rpm);
    Serial.print(";");
    Serial.print(sens0Temp);
    Serial.print(";");
    Serial.print(sens1Temp);
    Serial.print(";");
    Serial.println(sens2Temp);

  } else {
    Serial.println(F("Fan Command Unknown: FR (read)"));
  }
  interrupts();
}

Slider Applet.

Global Variables in AppController.h:
Code:
double fan1Rpm;
double fan2Rpm;
double fan3Rpm;
float sens0Temp;
float sens1Temp;
float sens2Temp;

get_rpm function:
Code:
- (double) get_rpm {
    
    //
    // Get fan RPM and temperature sensor readings from the Arduino
    //
    
    // make sure serial port open
    if (serialHandle<=0) serialHandle= serialport_init([serialPort UTF8String], serialBaud);
    
    // The command we send the the Serial port "F" Fan "R" Read
    char buf[32] = {"FR\n"};
    serialport_write(serialHandle, buf);
   
    // read result from serial port, until receive ; or \n, then convert the value in the buffer to 7bit ASCII
    serialport_read_until(serialHandle, buf, ';', 32, 1000);
    NSString *val1 = [NSString stringWithCString:buf encoding:NSASCIIStringEncoding];
    
    serialport_read_until(serialHandle, buf, ';', 32, 1000);
    NSString *val2 = [NSString stringWithCString:buf encoding:NSASCIIStringEncoding];
    
    serialport_read_until(serialHandle, buf, ';', 32, 1000);
    NSString *val3 = [NSString stringWithCString:buf encoding:NSASCIIStringEncoding];
    
    serialport_read_until(serialHandle, buf, ';', 32, 1000);
    NSString *val4 = [NSString stringWithCString:buf encoding:NSASCIIStringEncoding];
    
    serialport_read_until(serialHandle, buf, ';', 32, 1000);
    NSString *val5 = [NSString stringWithCString:buf encoding:NSASCIIStringEncoding];
    
    serialport_read_until(serialHandle, buf, '\n', 32, 1000);
    NSString *val6 = [NSString stringWithCString:buf encoding:NSASCIIStringEncoding];
    
    fan1Rpm = [val1 doubleValue];
    fan2Rpm = [val2 doubleValue];
    fan3Rpm = [val3 doubleValue];
    sens0Temp = [val4 floatValue];
    sens1Temp = [val5 floatValue];
    sens2Temp = [val6 floatValue];
    
    
    // return the ASCII value as double
    return [val1 doubleValue];
}

Menu Did Close:
Code:
    NSLog(@"Menu did close");
    NSLog(@"Fan1 RPM = %f", fan1Rpm);
    NSLog(@"Fan2 RPM = %f", fan2Rpm);
    NSLog(@"Fan3 RPM = %f", fan3Rpm);
    NSLog(@"Temperature 0 [°C] = %f", sens0Temp);
    NSLog(@"Temperature 1 [°C] = %f", sens1Temp);
    NSLog(@"Temperature 2 [°C] = %f", sens2Temp);

Result:
Multiple%20Readings.png


The next step will be to display the readings somewhere on the GUI

MacTester
 
Last edited:
Readings window in the Slider Applet

After some tinkering with Xcode, I was finally able to enhance the Slider Applet with a readings window. It displays the readings from the SMC board.
Readings Window.png


I will post the enhanced Applet, as soon as it is finished...

MacTester
 
Last edited:
Status
Not open for further replies.
Back
Top