Sunday 26 March 2017

Noctua 120mm fan testing (NF-F12 PWM) 7 x PWM using Teensy 2.0

Summary
This blog covers the replacement of a number of Cooler Master fans with Noctua PWM fans. Both fans were 120mm in size, to fit standard PC cases. Some measurements relating to PWM and current were taken as a comparison. PWM control was performed using a Teensy 2.0 programmed using Arduino.

Cooler Master Fan
Cooler Master Fan

Fan Replacement
The Cooler Master fans (A12025-12CB-3EN-F1) used in a tower of RAID drives, mentioned in this blog, were lacking the airflow to keep the temperature of the drives below 40 degrees Celsius. Noctua fans (NF-F12 PWM) were trialled with PWM control. 

It should be noted that the Cooler Master fans are rated at 2000RPM compared to the Noctua 1500RPM.
Noctua NF-F12 PWM
Noctua NF-F12 PWM

Fan PWM Control
Since PWM fan control from the existing motherboard was not possible, a Teensy 2.0 board was utilised. This board has seven PWM outputs and libraries for Arduino were already written. Image courtesy of PJRC.


Teensy 2.0 Pinouts
Teensy 2.0 Pinouts

When using the PWM outputs on the Teensy there was a difference in the frequency between some of the PWM output frequencies due to the timers. This turned out to be of no consequence as the Noctua fans worked across a large range of PWM frequencies. Even with the PWM frequency set in the low Kilohertz no clicking or other audible noises were heard from the Noctua fan.



Teensy 2.0 with Noctua NF-F12
Teensy 2.0 with Noctua NF-F12
For the fan connections, pinouts were referenced from the site All Pinouts. Power was applied to the required two relevant power pins. A common 0VDC connected was required between the fan and the GND pin on the Teensy. 


Teensy 2.0 Close Up
Teensy 2.0 Close Up

The image above has only PWM1 connected. A series 2.2k resistor for current limiting was connected between the PWM output of the Teensy to the PWM input of the fan.

Arduino Program
To control the duty for each PWM output, a simple program was written using Arduino. The code allowed each output to be individually changed. Only basic error checking was performed in the software, something to be aware of.

From a terminal program the number of the PWM output (1 to 7) followed by the duty cycle in percent (PWM ON time) was entered with a new line (enter key) to process the change. For example:

     Set PWM 1 to 75%: 175

     Set PWM 6 to 10%: 610

     Set PWM 7 to 100%: 7100

Example of working code below.


int PWM1 = 4;    /* PWM Output 1 */
int PWM2 = 5;    /* PWM Output 2 */
int PWM3 = 9;    /* PWM Output 3 */
int PWM4 = 10;   /* PWM Output 4 */
int PWM5 = 12;   /* PWM Output 5 */
int PWM6 = 14;   /* PWM Output 6 */
int PWM7 = 15;   /* PWM Output 7 */
int PWM = 0;
int PWM_Serial = 0;
int percent = 0;
char buffer[] = {' ',' ',' ',' '};

/* Start fans at full power then run down to approx 10% */
void setup() {
      Serial.begin(115200);
      pinMode(PWM1, OUTPUT);
      pinMode(PWM2, OUTPUT);
      pinMode(PWM3, OUTPUT);
      pinMode(PWM4, OUTPUT);
      pinMode(PWM5, OUTPUT);
      pinMode(PWM6, OUTPUT);
      pinMode(PWM7, OUTPUT);
      analogWrite(PWM1, 255);
      analogWrite(PWM2, 255);
      analogWrite(PWM3, 255);
      analogWrite(PWM4, 255);
      analogWrite(PWM5, 255);
      analogWrite(PWM6, 255);
      analogWrite(PWM7, 255);
      delay(2000);
      analogWrite(PWM1, 26);
      analogWrite(PWM2, 26);
      analogWrite(PWM3, 26);
      analogWrite(PWM4, 26);
      analogWrite(PWM5, 26);
      analogWrite(PWM6, 26);
      analogWrite(PWM7, 26);
}


/* Main to parse serial commands, no error handling */
void loop() {
  if (Serial.available() >0) {
    PWM_Serial = Serial.read() - '0';
    switch (PWM_Serial) {
      case 1: PWM = PWM1; break;
      case 2: PWM = PWM2; break;
      case 3: PWM = PWM3; break;
      case 4: PWM = PWM4; break;
      case 5: PWM = PWM5; break;
      case 6: PWM = PWM6; break;
      case 7: PWM = PWM7; break;
      default: break;
    }
    while (!Serial.available());
    Serial.readBytesUntil('n', buffer, 4);
    percent = ((atoi(buffer)) * 255)/100;
    analogWrite(PWM, percent);
  }
}


The terminal application TeraTerm, was used to send the commands to the Teensy. As there was no feedback provided by the Arduino code, the actual PWM signal was monitored using an oscilloscope. The Tacho output was also connected to the oscilloscope.

Power supply current and oscilloscope frequency measurements were taken for the duty cycle range of 10% to 100%.

Measurements
To determine what current (mA) the Noctua fans would consume, the duty cycle of the PWM was varied with a single fan connected and the current measured using a multimeter.


Noctua Current vs Duty Cycle
Noctua Current vs Duty Cycle

Undoubtedly the Noctua fans Tacho output against duty cycle, as seen below, has been recorded before however for completeness this was also measured.


Noctua Tacho Output vs Duty Cycle
Noctua Tacho Output vs Duty Cycle

Measurements were performed with the PWM duty starting at 10%, as the fan stall speed occurred at a duty between 7-10%.

Cable Assemblies
As a side note, Noctua provide a number of adapter cables with the fan. These range from an extension cable, Y adapter and a Low Noise adapter. Regarding the low noise adapter the Noctua cable features what appears to be a single 82R resistor, meaning that low noise is simply a by-product of limiting the total current to the fan. The same result could be implemented by adjusting the total power to the fan.


Noctua Low Noise Adaptor
Noctua Low Noise Adaptor
Adding the low noise adapter in series with the power supply to the Noctua fan, reduces the fan speed. The current drawn by the fan is reduced to around 40mA.


Noctua Low Noise Adapter Unsheathed
Noctua Low Noise Adapter Unsheathed

Operational Temperature
In relation to the heat generated by the fan itself, a thermal camera was used to measure the Noctua fan motor which was running at full speed in free air. After several minutes, with an ambient temperature of 24C, the temperature of the fan motor was approximately 28C.

Noctua Fan Temperature
Noctua Fan Temperature
Testing
For testing the effectiveness of the Noctua fans, the RAID system inside a server was kept running using Caffeine on Linux Mint Cinnamon. The system (RAID) did not spin the drives down.


Caffeine Package
Caffeine Package
The server was left powered and running the application Caffeine for 60min to stabilise the internal temperature without fans. The temperature of the drives was taken from the Smart data available under the Disks app. The highest drive temperature was 41C.


RAID No Cooling
No Cooling RAID Temperature
A single the Cooler Master fan was tested first. After 60min the temperature of the warmest drive was 37C.

Single Cooler Master RAID Temperature
Single Cooler Master Fan - RAID Temperature
For the second test the original fan was removed and the RAID was allowed to reach 41C again. A single Noctua fan was then tested. After 60min the temperature of the warmest drive was 38C. 

Single Noctua Fan - RAID Temperature
Single Noctua Fan - RAID Temperature
For the next test the Noctua fan was stopped and RAID was allowed to reach 41C again. Dual Noctua fans were tested. After 60min the temperature of the warmest drive was 32C.

Twin Noctua Fans - RAID Temperature
Twin Noctua Fans - RAID Temperature
Three fans were tried although no difference in RAID temperature was noted when compared to two Noctua fans.

Final Thoughts
There is little doubt the Noctua NF-F12PWM fan performs extremely well, almost as well as a fan running 15% faster, for the limited tests conducted above. It shall be noted however that at the time of writing this blog, the Noctua fan was four times more expensive than a Cooler Master fan or a nearest equivalent non PWM fan. This cost may be prohibitive to some looking to move to PWM. 

Additionally if large airflow is all that is required then a fast, reliable, non-PWM fan may be the more cost effective solution. Mass air flow fans manufactured by Delta or Orion may be more suitable for some installations. Orions models such as the OD1238-12HBXJ10 have an airflow of 250CFM compared to the Noctua's 56CFM however the Orion fan has an ear drumming 69dBA, compared to the Noctua almost inaudible acoustics at 23dBA.

For alternate installations such as a media centre, bedroom computer, home cinema or similar installation were low noise is paramount, then a PWM fan would be an ideal solution.

Sunday 19 March 2017

Testing PC Computer Fans, Cooler Master, with Multimeter or Oscilloscope (A12025012CB-3BN-F1)

Summary
Cooler Master towers have usually been my computer case of choice for several years. The latest tower used four removable SSD's in the top bay using an Icy Doc adaptor with a separate four Western Digital red drives in RAID for mass storage. Needless to say on occasions the drives in the tower generated some heat which required the three Cooler Master internal fans for some airflow!


N300 Cooler Master Case
N300 Cooler Master Mid Tower Case

Cooler Master Fan Type
Shipped with the Cooler Master tower were three 120mm fans - A12025012CB-3BN-F1. Spinning at 1200RPM the fans were not particularly noisy so when one or two failed for different reasons this was initially not recognised. For those running Linux (Ubuntu in this box) lm-sensors is strongly recommended to prevent such issues.

Fan Testing Digital Multimeter
After removing the fans the 3 pin connector was verified using site All Pinouts


Cooler Master Fans
Cooler Master Fans
As described, on the All Pinouts site, the connections were:
  1. 0VDC
  2. 12VDC
  3. Tacho
Power was connected to both fans pin 1 and 2. A Digital Multimeter 'DMM' with a frequency function was used to measure the tacho output. This measurement was performed between the tacho output and 0VDC with a 220k pullup resistor fitted between the tacho output and 12VDC. 

DMM Measuring Fan Tacho
DMM Measuring Fan Tacho

The second fan did not register any frequency.

Fan Testing Oscilloscope
Using an Oscillscope whether top of the range Yokogowa, or a pocket SeedStudio device, to sight a waveform, regardless of the novelty of the signal, can yield useful information that a traditional DMM cannot provide.

Below are the two captures of the tacho outputs for each fan.

Cooler Master Fan 1
Cooler Master Fan 1

Cooler Master Fan 2
Cooler Master Fan 2
From the two captures shown above, fan 1 was running below its rated speed and the tacho output on fan 2 appeared to be damaged. Both fans were replaced with a newer model, as shown below.

Cooler Master Replacement Fan
Cooler Master Replacement Fan
As a reference, the same pullup resistor was fitted to the tacho output of the new fan, with expected results shown below.


Cooler Master Replacement Fan Tacho Output
Cooler Master Replacement Fan Tacho Output
Summary
Diagnosing a faulty fan can be achieved with the requisite hardware support on a PC motherboard and a suitable application, a DMM with frequency input or an oscilloscope of some variety. All methods provide diagnostic methods for fans with tacho feedback.

Thursday 16 March 2017

Asko W6342 Tripping Circuit Breaker - Hot Wash

Summary
Quick repair of an Asko W6342 that was tripping the earth leakage circuit breaker (safety switch) only during hot washes. Blog includes a tear down of the front panel electronics.


Asko W6342
Asko W6342

Symptoms

Following a decade of hard work washing, the ever reliable Asko was tripping the 40A safety switch in the house power box. Changing the wash to cold prevented the tripping.

Diagnosing
Knowing that the internal heater or associated circuitry may be faulty, the rear panel of the Asko machine was removed and the heater element checked. Using the ohms range the element measured 25R which appeared to be acceptable. Time to take a peek under the hood at the electronics.

Removing the top metal cover on the Asko, a ten year single page machine electrical schematic was found inside the machine.


W6342 Original Machine Electrical Schematics
W6342 Original Machine Electrical Schematics
Checking online for some keywords shown on the electrical diagram a manual was found for the WM25 at Appliance Diagnostic. Pages 16 to 20 of the manual contained a plethora of detail regarding the operation of the Akso and the operational cycle.

Front Control Panel
The front panel is removed with a screwdriver and levering some well-placed clips. Once the cables are unplugged from the unit the control panel comes out as a single assembly.


ASKO W6342 Control Panel
ASKO W6342 Control Panel


ASKO W6342 Control Panel Rear
ASKO W6342 Control Panel Rear

Removing the buttons from the front control panel and opening the unit shows two PCB's.

ASKO W6342 Control Panel Internals
ASKO W6342 Control Panel Internals

Pulling the two boards out from the housing a visual inspection was performed and basic measurements of the relays and SCR shown to the right on the PCB below.
 
ASKO W6342 PCBs
ASKO W6342 Logic and Power PCB's

For those interested the Asko W3642 used a Freescale MC68HC908AP32 processor as the brains for the operation.

Asko Freescale CPU
Asko Freescale CPU

With no visible issues on either PCB or apparent faults with the parts it was back to the heater element.

Heater Element Insulation Testing
Both the power connections to the heater element were removed however the earth connection was left connected. A Honeytek A60B Insulation Tester was used to check between the internal heater element and the outside earthed casing. 

Honeytek A60B Insulation tester
Honeytek A60B Insulation tester

The measurement shown on the tester was markedly below the Kilohms region indicating there was some breakdown of the insulation. After a decade of washing this was not surprising. Below is an image of the old element.

Asko Heater Element
Asko Heater Element

A new element was ordered from Nation Wide Spares and changed for the damaged element. A great reference video for replacing the element is available at RepairClinic.

Once the Asko was reassembled a warm wash was performed to ensure that the safety switch did not trip and to verify there were no leaks from the newly installed heater element.

Thursday 9 March 2017

Asus X202E Changing to Ubuntu Mate from Windows

Summary
After upgrading an Asus X202E from Windows 8 to 10 the notebook became far too slow for web browsing and anything video related. The notebook was acceptable for simple programming and serial port debugging. The decision was made to change to Ubuntu Mate to see if the usability of the laptop could be improved.


Asus X202E
Asus X202E
Ubuntu Flavour
A number of lightweight Ubuntu distros were reviewed and upon reading the recommendations on a few sites such as www.linux.com and hereUbuntu Mate was chosen as the system of choice.

Ubuntu Mate Installation Disk Creation

For the installation disk the common method of creation by using another Ubuntu system, together with the Ubuntu Mate ISO and the application Ubuntu 'Disks' was used. 

For the purposes of this installation an external USB Samsung SSD was used for speed.


Ubuntu Disks Application to Restore Disk Image
Ubuntu Disks Application: Restore Image

Netbook BIOS Changes to Boot Ubuntu Mate Install Disk
The Ubuntu Mate drive will not boot with the default Asus X202E settings. There are a number of settings to change, at least to run for this installation. Further details for the Asus X202E BIOS configuration and related issues, for a Mac install, can be found on this lengthy but quite informative thread at www.tonymaxx86.com

Drive Upgrade
To start off the change to Ubuntu, a replacement Samsung 840 SSD was installed. The Samsung 800 series are 7mm in height which is a must to fit in the netbook. Larger drives will not fit.

There were 9 screws holding the bottom plastic cover plate of the netbook in place. Once the screws were removed the cover was easily removed by lifting the from the display hinge end.

Only 3 screws held the old drive in position. The old drive was held in place with two metal bars, each having two bolts secured into the drive.


Asus X202E SSD
Asus X202E SSD

Netbook BIOS Changes
After the new SSD was installed, bottom cover fitted again, the BIOS was activated on X202E using the F2 key. For my model X202E the F2 key was pressed then the power button pressed. The F2 key was only released when the BIOS was displayed. Original reference in Asus website FAQ.

Under the 'Advanced' menu the USB Legacy support was enabled to ensure booting from the external drive was possible. XHCI pre-boot was disabled also.


X202E BIOS Advanced Settings
X202E BIOS Advanced Settings

For the 'Boot' menu settings both the Fast Boot and Launch CSM were disabled after reading some issues in the thread at www.tonymaxx86.com

X202E BIOS Boot Settings
X202E BIOS Boot Settings
Lastly under the 'Security' menu, most important of all, was to disable the Secure Boot which would allow non-Windows drives to boot.

X202E BIOS Security Settings
X202E BIOS Security Settings
Changes were saved and the X202E allowed to reboot with the Ubuntu Mate install drive connected to the USB.

Installing Ubuntu Mate
There were no issues booting from the external SSD. The install Ubuntu Mate option was chosen from the installer splash screen.

After configuring the language option the next screen on the installer allows the latest updates and third party drivers to be downloaded. Both these options were selected. For some reason 'Secure Boot' was checked, this was deselected.


Ubuntu Mate Download Settings
Ubuntu Mate Download Settings
For the new Samsung SSD the 'Erase Disk' option was chosen.

Ubuntu Mate Installation Settings
Ubuntu Mate Installation Settings
After clicking 'Install' the program confirms the changes.

Ubuntu Mate Disk Changes
Ubuntu Mate Installation Disk Changes
 The install program copied all required files.

Ubuntu Mate Installation
Ubuntu Mate Installation Copying Files

Ubuntu Mate Installation Restart
Ubuntu Mate Installation Restart
Ubuntu Mate Performance
The Ubuntu Mate installation was updated using the tools from the menu then a benchmarking tool was installed. No other changes or additions were made.

Ubuntu Mate Desktop
Ubuntu Mate Desktop
Hardinfo was used as the benchmarking tool, a portion of the results are listed below. The following link is the complete HardInfo results, with IP address' altered.

Benchmarks

CPU Blowfish
CPU Blowfish
This Machine1100 MHz16.396
Intel(R) Celeron(R) M processor 1.50GHz(null)26.1876862
PowerPC 740/750 (280.00MHz)(null)172.816713
CPU CryptoHash
CPU CryptoHash
This Machine1100 MHz91.171
CPU Fibonacci
CPU Fibonacci
This Machine1100 MHz4.906
Intel(R) Celeron(R) M processor 1.50GHz(null)8.1375674
PowerPC 740/750 (280.00MHz)(null)58.07682
CPU N-Queens
CPU N-Queens
This Machine1100 MHz19.652
FPU FFT
FPU FFT
This Machine1100 MHz5.927
FPU Raytracing
FPU Raytracing
This Machine1100 MHz12.788
Intel(R) Celeron(R) M processor 1.50GHz(null)40.8816714
PowerPC 740/750 (280.00MHz)(null)161.312647



Wednesday 1 March 2017

PLC Input Circuit for PSoC, Raspberry Pi, Beagle, OLinuXino, Cubieboard - High voltage tolerant

Summary
This blog features a PLC input circuit that can be adapted for microcontrollers such as PSoC, Amtel, PIC and mini-PC boards such as the Raspberry Pi, Beagle, OLinuXino and Cubieboard to name a few.

Typical PLC Input Circuits
In order to keep used Printed Circuit Board (PCB) area and productionisation costs at a minimum, some commercial PLC input circuits are understandably designed with minimal components and protection. With the addition of a few components, these input sections can be made more robust with respect to the input voltage.


Example PLC Input Circuit
Example PLC Input Circuit

PLC Input Circuit Improvement
The input circuit in the illustration below contains the requisite optocoupler 'opto' LED current limiting resistor R1, which also forms a voltage divider with R2. This divider prevents the maximum LED voltage of opto O1 being exceeded in normal operation. These parts also define the turn ON behaviour for the input, depending on some of opto characteristics. Added to the design were the dual Zener D1 and capacitor C1.


Improved PLC Input Circuit
Improved PLC Input Circuit
The Zener was added to protect the input and allow the input to take constant over-voltage up to 100VDC with brief exposure of voltages up to 150VDC. 

Under normal conditions, low voltages to 24VDC, D1b has little to no effect as the voltage at the divider of R1 and R2 is marginally lower than the Zener breakdown voltage. At higher voltages D1b conducts protecting the opto LED. However some of the components risk irreversible damage from over voltage or failure from overheating if the input is exposed to higher voltages for long periods. Higher rated components can be chosen to mitigate this issue.

The filter capacitor C1 was added to add some filtering to the input signal however it lowers the response of the input to the low kilohertz region. Lowering the value of C1, or removing C1 completely could be one solution to improving the input response, although noise can become an issue.

PLC Input Sensitivity
While the proposed PLC circuit in this blog was not designed to adhere to PLC standards such as EN61131-2, this design could be loosely considered a Type 3 low power design (2-15mA).

To update the design into a Type 2 design (6-30mA) the resistor R1 could be reduced to 2.7k 1W and R2 to 470R. These resistor values can be adjusted up and down depending on the practical application.

PLC Inputs: Practical Example
For example purposes a jellybean 4N28 opto in a practical setup, wired in saturated mode, was implemented. For differences between opto modes of operation such as linear and saturated mode, see Learn About Electronics.


4N28 Optocoupler
4N28 - Courtesy Vishay

Consider the implementation of the PLC circuit on breadboard.


Breadboard Improved PLC Input Circuit
Breadboard Input Circuit

In the image above the Yellow wire is the equivalent PLC input and the Green wire toward the bottom of the image is the 0V. The Red wire is a separate 3.3VDC supply with the Green wire at the upper right of the image being the 0V.

A benchtop triple output power supply was operated with two outputs in series to achieve a 0 - 70VDC range and the third output was fixed at 3.3VDC to supply a LED driven from the 4N28.


Power supply voltage settings showing 70VDC operation
Power Supply - Voltage Settings

Adjusting the input voltage between 0 to 8VDC yielded little change in the state of the LED. The minimum turn on voltage for the LED was 9V which allowed only a few micro amps flowing through the LED. The current flowing through the 220R dropper resistor was measured as a function of the PLC input voltage.



Forward LED Current vs Input Voltage (PLC Input)
Forward LED Current vs Input Voltage (PLC Input)
The data shown below is for the above graph.

Measurements of Forward LED Current and Input Voltage (PLC Input)
Measurements of Forward LED Current and Input Voltage (PLC Input)

Since the LED used for the example was a superbright RED, the LED turn ON was easily visible at approximately 14V DC in daylight. However under low light conditions the LED could be seen to turn ON at 10V DC.

Adding a Schmitt Gate
Next a Schmitt gate was added to the output of the opto. Two gates (inverting outputs) were connected in series, then the LED was driven from the output of the second gate. The opto remained configured in saturated mode however the input of the 74HC14 gate is driven by a pull-up on the collector of the opto output. The gate input is a high impedance CMOS input which has defined voltage thresholds for operation.

PLC input with buffer
PLC input with buffer
Part of the functionality of the HC14 gate is hysteresis. Adding the gate to the design results in the LED turning ON when the input voltage, IN+, is 10.8V DC and OFF at 10.5V DC. The defined LED behaviour follows the gate input voltage thresholds, unlike the output of the opto which is dependent on forward current through the LED and the current transfer ratio. If the 300mV hysteresis is not required, another gate/buffer or even a Darlington opto could be used in its place.

PLC Input with Buffer
PLC Input with Buffer

Furthermore, if input isolation is not required then the opto itself may be replaced with a suitable gate of choice, resulting in a further simplified PLC input design.

Other Alternatives
There are a few alternatives that come to mind to replace the humble opto. These include the magnetic, inductive and capacitive coupled Digital Isolators such as the devices from Silicon Labs, Texas Instruments and Analog Devices to name a few. At a slightly higher cost and more suited as output devices, are the ranges of Solid State Relays. SSR's are manufactured by companies such as Ixys, PanasonicToshiba and Vishay.