Workbench journal

Apple ][ Plus Cooling with The Arduino

This is a project which aims to enhance the cooling functionality of the Apple II+ computer. It had traditionally come only with passive cooling or cooling via convection. This is effective enough, certainly. But, once fills every expansion slot there can exist quite a bit of heat from the collective card use.

These are the two configurations I switch between usually on my Apple II+. Quite a lot of heat when slots 0-7 are full!

I have marked temperatures as high as 110 F on my Apple II+, but here is a pic of it registering 101 F.

As these computers and their parts get older and more difficult to obtain each day, it is important to preserve the history that is contained within. Thus, I’d like to assure these chips stay cool. The 6510 processor data sheet indicates it can operate maximally at 158F (70C). You can even store it idly in temps up to 302F (150C)! But, as I said…this is history! And not all the parts have these tolerances. Furthermore, it is emphatically true that the cooler a computer system is, the better.

Thus, I have used an Arduino Nano to build a temperature sensitive single-board cooling unit which nestles neatly atop the power supply. This cooling board controls a fan situated on the right side of the computer as one faces it.

A view of the Apple II Plus Computer and the situation of cooling components

The fan is operated on 12 V+ DC regulated by a 5V+ relay which the Arduino controls. I have used external power for the whole build as I don’t feel comfortable a) putting an inductive load (the fan) on the Apple II power rails and b) tapping the power at all really on this machine. This relay is turned on in conditions that suit the temp settings and it can be programmed to turn on for any combination of temp and humidity settings should one choose so.

I have set a “cooling curve” of ~10 degrees F.

This is a “cooling curve”. Here was a prototype curve where the high was set at 93F and the sought-after temp was 88F (5 degree curve)

This means that my “max_temp” is 98 F and I ask the Arduino to keep the fan on until it reaches 10 F degrees less than “max_temp”, thus 88F. Note the smooth decay of the line indicating an efficient temperature reduction.

Instead of merely setting a temp which the Apple II can not exceed (excluding an ideal low temp setting), this method avoids the “on/off” oscillation that is far too fast and cycles the relay ineffectively. With the “cooling curve” method it is possible to cool the computer to a protective and healthy temperature without over-cycling the fan or the relay.

What follows are some images of the build process.

Also, because I try and flex learning whenever possible, I used this as an opportunity to serial output the data the Arduino sees in nice readable format. This data could be Bluetoothed to an LCD module wirelessly for example thus reducing the little dongle wires that come out the top of the Apple II once fully assembled.

Here we see the exact moment the Apple II Fan switches on… a small propagation delay occurs. But at 98.06 F it acknowledges the demand for fan.

That’s just an idea, however. Right now, I don’t mind the little LCD screen as it is with its wires. Plus, it was very popular in the time of this computer to make your own mods and fill gaps the manufacturer’s couldn’t as technology was moving so rapidly and products had to make it out. DIY wires hanging out the Apple II is a natural sight. But I do consider this build very neat and tidy as mods go.

The picture doesn’t do the fidelity of the LCD justice. It’s very tidy and works a treat with clear display.

As an aside, this is the genius of Steve Wozniak’s expansion slot system for the Apple II. Though designed in the late 70s, Woz knew that tech was about to get really capable, really fast and the expansion ports kept the Apple II “open,” so to speak” to future enhancement. Steve Jobs, was notoriously against this idea and ended up achieving a “closed” system with the Lisa (much to his loss due to its failure as a market product) and the Macintosh (much to Apple’s gain due to the success of this machine).

What follows is the code for the Arduino for your perusal, edits, and own use. Have fun and stay cool!

///////////////////////////////////////////////////////////////////////////////////////////
//
//     Apple II Temp Controller
//
//     Controls custom APPLE II+ fan unit for cooling of a passively cooled machine.
//     I got a lot of cards in my APPLE II and it makes some heat. This allows me
//     to use an Arduino to "smart switch" a fan on when the temp exceeds x value
//     inside the APPLE II+.
//
//     I included serial output of this data for monitoring and fun!
///////////////////////////////////////////////////////////////////////////////////////////

#include <DHT.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <ShiftRegister74HC595.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
// Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity

ShiftRegister74HC595<1> sr(4, 8, 7);

#define FANPIN 13
#define DHTPIN 12
#define DHTTYPE DHT11

unsigned long previousMillis = 0;

//Refreshes the LCD once every 1000ms (1 second)
//without holding up the Arduino processor

unsigned long interval = 1000;

//input the "MAX ALLOWABLE TEMP INSIDE THE AII+ BEFORE FAN TURNS ON HERE (DEGREES F)"

int max_temp = 98;

DHT dht(DHTPIN, DHTTYPE); //initialize DHT sensor

///floating point precision setup

double Fahrenheit(double celsius) {
  return ((double)(9 / 5) * celsius) + 32;
}

double Kelvin(double celsius) {
  return celsius + 273.15;
}

void setup()
{
  dht.begin();
  pinMode(FANPIN, OUTPUT);
  digitalWrite(FANPIN, LOW);

  lcd.begin(16, 2);
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(1, 0);
  lcd.print("APPLE ][ PLUS");
  lcd.setCursor(1, 1);
  lcd.print("TMP REGULATOR");
  delay(3000);
  lcd.clear();
  lcd.print("Initializing...");
  delay(3000);
  Serial.begin(9600);
}

void loop() {
  float temp = dht.readTemperature(true); //read temp in F (true is Farenheit)
  float humi = dht.readHumidity();

  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Temp");
    lcd.setCursor(0, 1);
    lcd.print("Humidity");
    lcd.setCursor(11, 0);
    lcd.print((int)temp);
    lcd.print(" F");
    lcd.setCursor(11, 1);
    lcd.print((int)humi);
    lcd.print(" %");

    // set 7seg pins in binary orientation for the number "0", Common Anode Display (Invert for CC)
    uint8_t pinValues[] = { B1000000};
    sr.setAll(pinValues);
    
    Serial.print(" ");
    Serial.print(temp);
    Serial.print("F");
    Serial.print(" ");
    Serial.println(" :Fan Off");

    while (temp >= max_temp)
    {
      float temp = dht.readTemperature(true); //read temp in F (true is F)
      float humi = dht.readHumidity();

      digitalWrite (FANPIN, HIGH);

      // set 7seg pins in binary orientation for the number "1", Common Anode Display (Invert for CC)
      uint8_t pinValues[] = { B1111001};
      sr.setAll(pinValues);

      unsigned long currentMillis = millis();
      if (currentMillis - previousMillis > interval) {
        previousMillis = currentMillis;

        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Temp");
        lcd.setCursor(0, 1);
        lcd.print("Humidity");
        lcd.setCursor(11, 0);
        lcd.print((int)temp);
        lcd.print(" F");

        lcd.setCursor(0, 1);
        lcd.print("*SYSTEM COOLING*");

        Serial.print(" ");
        Serial.print(temp);
        Serial.print("F");
        Serial.print(" ");
        Serial.println(" :Fan On");

        //here i have defined that the fan will turn off only after it has achieved 10 degrees less than max_temp (change this value for new conditions)
        //this "range" avoids the on/off on/off relay activity as the temp hovers around max_temp, and then gets cooled immediately
        // also this, to me, just *feels* like a healthy cycle for a fan, it's a smooth cooling curve if you check the serial plotter

        if (temp <= (max_temp - 10)) {
          digitalWrite(FANPIN, LOW);
          break;
        }
      }
    }
  }
}

6 responses to “Apple ][ Plus Cooling with The Arduino”

  1. […] the increasing scarcity of replacement hardware convinced [Joshua Coleman] to come up with a more robust active cooling solution for his Apple II+, increasing the likelihood that it will keep on crunching numbers for decades to […]

  2. […] the increasing scarcity of replacement hardware convinced [Joshua Coleman] to come up with a more robust active cooling solution for his Apple II+, increasing the likelihood that it will keep on crunching numbers for decades to […]

  3. […] the growing shortage of alternative {hardware} satisfied [Joshua Coleman] to provide you with a extra strong energetic cooling answer for his Apple II+, growing the probability that it’ll carry on crunching numbers for many years to come […]

  4. […] the growing shortage of substitute {hardware} satisfied [Joshua Coleman] to provide you with a more robust active cooling solution for his Apple II+, growing the probability that it’ll carry on crunching numbers for many years to […]

  5. […] the increasing scarcity of replacement hardware convinced [Joshua Coleman] to come up with a more robust active cooling solution for his Apple II+, increasing the likelihood that it will keep on crunching numbers for decades to […]

  6. […] the increasing scarcity of replacement hardware convinced [Joshua Coleman] to come up with a more robust active cooling solution for his Apple II+, increasing the likelihood that it will keep on crunching numbers for decades to […]

Leave a Reply