Skip to content

mattheas/Experimenting-With-PS3-PWM-Fan-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PS3 PWM Fan Control

Problem

Playstation 3 is suffering from overheating due to it being stored in a small, enclosed space.

Solution

Use the pulse width modulation signal(PWM) generated by the Playstation 3 for it's internal fan in conjuntction with an Arduino Mega to control an external fan that circulates air inside the enclosed space, for the ultimate goal of significantly reducing or completely elimnating overheating.

Criteria

My goal is to use a Y splitter cable to split the PWM signal coming from the inside the console. Then using one of the outputs to drive the internal fan, leaving the original Playstation 3 cooling unaffected. The cable carrying the second output will be routed oustide the Playstation and will be read in by the Arduino. From here the Arduino will either pass the original duty cycle of the signal onto the external fan unaffected or if requested by the user the signal can be modified, effectively changing the speed of the external fan. This communication will be done over a Arduino Ethernet Shield.

Procedure

Analyzing PWM signal from Playstaion

I dissasembled the Playstation 3 to reach internal fan and PWM connector. I started by removing a handful of philips and tamper proof torx screws from the bottom of the console, then flipping the console over and lifting the top cover off to expose its fan and wires, one of which is the PWM, the other two being GND and +12V. The origin of these wires seemed to be coming from under the power supply. I simply unplugged the two connectors circled below and I was then able to remove the power supply.

Once the power supply was removed it was easy to see where the fan wires originated from, simply pulling up on the connector was enough to unplug it. With some research I was able to find out that the Grey wire is the PWM, the Brown is +12V and the Black is GND [1].

Once I had access to where the PWM signal came from I decided to analayze it, mostly due to the fact that information about the frequency and amplitude are sparse. This proved to be challenging as the power supply had to be installed again to run the Playstation, making it impossible to attach a oscilloscope probe and ground directly, it was also near impossible to measure where the wires attached to the fan as they were encased in plastic. I solved this by using 2 male to female jumper wires from my Arduino kit, removing the plastic shells on the female end of the wires and crimping down the size with pliers to make them fit snuggly on the the male end located under the power supply, this was also done because with the plastic shells still installed on the female end it would not fit into the original connector. These two wires were connected to GND and PWM. I also took the precatiuon of wrapping a small bit of electrical tape around the now exposed female ends to make sure there were no short circuits once I began testing. Below is a picture of the female end with its plastic shell removed in the process of being crimped.

After the wires were prepared I connected them as shown below.

Then I installed the power supply again also reconnecting the two connectors I had prevously disconnected during inital disassembly. The probe and ground were now connected to the male ends of the jumper wires.

Now it was time to locate the actual signal on the oscilloscope. From my research into using PWM for controlling a fan I knew a couple things, first and foremost I was looking for a square wave, secondly I knew that the frequency was going to be in a range of 20-28kHz [2], and lastly I knew that the amplitude of the square wave would most likely be in the range of 3.3-5V [2]. Using the given range of frequencies I calculated the range of periods I could expect to be from 35.7 to 50 microseconds, I could then approximate the TIME/DIV to set the oscilloscope to, as well as that knowing the potential range of amplitude I set my VOLTS/DIV accordingly. With this I started adjusting the scope to find the signal, the fan had to be left unplugged during this time so I made sure not to have the Playstation run continiusly as I did not want to overheat the components. Barring a few hiccups I eventually found my signal as shown below.

Positioning the signal so that it lined up as squarely with the grid as possible I easily calculated the period to be 40 micro seconds (TIME/DIV = 10 micro seconds), this period gives a frequecny of 25kHz which upon further research appears to be a common target frequecny for some fans [2]. I was also able to read the amplitude of the wave to be 3.2V (VOLTS/DIV = 2V) which also seemed to be a acceptable value, I believe that I may have introduced some error when I read it off the scope and it was was most likely 3.3V amplitude. Wanting to analyze it further I found code [3] shown below, that was able to read in a PWM signal and return the time in micro seconds that the signal was on "HIGH". I then took that number and divided it by the period, that will give you the duty cycle, multiplying that ratio by 100 gives the duty cycle in percentage.

I wanted to observe the duty cycle of the wave change on the oscilliscope while I also watched duration pulse change on the serial monitor. To do this simultaneously I used a breadboard and some jumper wires to connect the GND coming from the Playstation to both the ground on the Arduino and the ground of the probe, I did something similar for the PWM wire, except one went into the digital pin 3 of the arduino and the other to the probe.

With the wiring completed as shown above I started testing. The testing started with the Playstation 3 completely cooled down. This testing was purely done to observe how the PWM signal changed as function of CPU/GPU temperature and to ensure the previously mentioned code worked as needed. When initally switched on the duty cycle was 30% (a pulse width of 12 micro seconds as measured by Arduino), after ~4 seconds it dropped down to 20% duty cycle(8 micro seconds). The pulse width then linearly increased in 1 micro second intervals until the duty cycle was at 40% (16 microsecond pulse width). Further increases in duty cycles happened at a more exponential rate. After 40% it jumped to 50%, then 67.5% and lastly 97.5%. And then upon shutdown of console the duty cycle momentarily dropped down to 20% again before the console was fully off. It should be noted that the duty cycles mentioned above were calculated by dividing the pulse widths read in by the Arduino by the period. There was some extraneous data observed from the Arduino as seen below. Although it was relatively uncommon to see this type of data it was still noted down in case there was a need to address it at a later date if there was unwanted behaviour from the external fan.

Here is a screenshot of how the pulse width/ duty cycle was impacted due to the Playstation being shutdown. Initally the duty cycle was near 100% then briefly dropped down 20% when the power button was pressed and then followed by 0. It can also be seen again that there is some data that is skewed. I think it is not a huge cause of concern as the fluxation tends to be quite small and uncommon, but if it does adversely affect external fan behaviour, then these anomalies will be handled in the program design.

I also wanted to mention that the duty cycle could be calculated by using a DC voltmeter. If the DC voltage is meausred between the PWM wire and GND the average voltage will be read, and since the amplitude of the signal is measured to be ~3.2-3.3V simply dividing the average voltage by the amplitude will also give the duty cycle. As an example when the pulse width was 8 micro seconds I measured the voltage to be 0.63V, dividing this by 3.3V and turned into a percentage gives us a duty cycle of 19.1% which is close to the expected 20%. This confirmed that the Arduino was measuring the pulse width relatively accurately and this method could be used in the project.

Code Design

The three main objectives of the program is that it needed to read in a 25kHz PWM signal and be able to determine its duty cycle (which we achieved already when testing the PWM signal), it also needed to be able to generate a 25kHz square wave with different duty cycles and lastly it needed to communicate with my laptop so I could manually control the fan speed or let it automatically adjust itself to run at the same speed as the internal PS3 fan. I found two articles that were of great help with configuring an ethernet shield and setting up a webpage to communicate with my laptop [4] and for generating a 25kHz signal with an Arduino [5]. I used the code written in both these articles as a starting point and made alterations to suit my requirements.

A simple explanation to anyone reading this is as follows. On startup of the Arduino it will set the fan operation into automatic mode. Which continually changes the PWM signal of the external fan to match that of the internal fan. Simply put the external fan will spin at the same speed as the internal fan. This is also one of the options that can be selected from the webpage. The other two options are to manually increase or decrease the speed of the external fan irregardless of the speed of the Playstation's fan. Anytime an increase or decrease button is pressed it will respectively change the speed of the fan by 10% from it's current speed. Minimum and maximum values have been programmed in so that the speed of the fan cannot fall below 20% or exceed 100%.

Assembling Project

Assembly of the project was relatively simple. First it consisted of wiring in the Y splitter cable. I first started by cutting the original fan wires a few inches away from the female connector as shown below. This was done so the wires were long enough to reach out from underneath the power supply, this issue was touched upon earlier when first analzying the PWM signal.

I then stripped the ends of the wires and crimped on the Dupont connectors.

Followed by installing the Dupont housing.

A similar process was followed for the wires attached to the fan. With all the crimping completed and the Y splitter installed this is what the final product looked like without the lid of the PS3 installed. All the exposed wiring will be covered up once the PS3 is reassembled and only three wires shown in the bottom left of the image which are GND, +12V and PWM will be routed outside the PS3. This approach leaves the internal fan operation unaffected as previously mentioned but gives access to the PWM signal.

With the internal wiring completed that left the installation of the external fan and then wiring all the components together. This was relatively simple. I used the fan itself as a stencil and drew the outline of the fan to give me an idea of what material I needed to remove and where I needed to drill the mounting holes. The picture below shows my progress about halfway through. Two mounting holes are already drilled based on my stenciling and I am using a file to get the correct shape to maxamize air flow.

This is the final result with the fan mounted.

With the fan mounted I proceeded to test everything together. The wiring was quite hectic as seen below. I powered the external fan from the +12V and GND from the PS3. I did notice that if the external fan was powered on there was a slight drop in internal fan speed. I assumed that with both fans running off the same +12V and GND the circuit became a current divider, and so with both fans running together they would indiviudally spin slower as compared to one fan by itself as they were getting less current. As mentioned the difference was only slight and not what I would consider a huge concern. A solution to this would be to power the external fan off one of the USB ports on the front of the PS3. Using these ports has no effect on the speed of the internal fan as they are meant to be used to charge controllers while the console is in use. I also powered the Arduino from one of these USB ports in the finished product as it had the benefit of both powering the Arduino on and off when the Playstation was turned on and off, so the Arduino was being switched on and off automatically. And it was self sufficent in the fact that I did not need a seperate power supply or battery to run the Arduino.

Once I had tested everything to ensure it functioned as intended I took the time to neatly wire everything properly. The image below is how the project finished, working as I had intended it to from the beginning (note the PS3 power cable, Arduino Ethernet cable and HDMI cable are removed).

Lastly here is a screenshot of the webpage. Again simply clicking the "Auto Fan Speed" button once lets the fan automatically adjust itself to be the same speed as the internal fan. The "Increase Fan Speed" and "Decrease Fan speed" buttons respectively increase and decrease the speed of the fan by 10% with each click.

Conclusion

In conclusion this project turned out better than expected. With no major setbacks and the end result being exactly what I wanted (overheating issues completely eliminated) I call it a success. Looking back on it I would have liked to start out with a more concrete plan from the beginning. For example an issue that arose was powering the Arduino. As mentioned previously that matter was solved when it happened and an elegant solution just happened to present itself, that is powering the Arduino from the console's USB port. I thoroughly enjoyed this project and additionally I gained valuable diagnostic experience over the entirety of the project. My familiarity with an oscilloscopes functions and its use greatly increased and I also found it interesting to wire my own circuit and then inevitably back track through my work to find my mistake.

Citations

[1] @oldturkey03 (2011, Jun. 20). PS3 Fan wires explained [Online fourm]. Available: https://www.ifixit.com/Answers/View/55562/PS3+Fan+wires+explained#answer55577 [Accessed: Nov. 7, 2020]

[2] "4-Wire Pulse Width Modulation (PWM) Controlled Fans" Sep. 2005. Accessed on: Nov. 7, 2020. [Online]. Available: https://wiki.kobol.io/helios4/files/fan/4_Wire_PWM_Spec.pdf

[3] B. Ripley, Three Ways To Read A PWM Signal With Arduino, Jun. 2014. Accessed on: Nov. 7, 2020. [Online]. Available: https://www.benripley.com/diy/arduino/three-ways-to-read-a-pwm-signal-with-arduino/

[4] Unknown Author (Oct 30, 2016) Arduino Ethernet Shield-LED ON/OFF from webpage (Version 1.0) [Source code]. https://alselectro.wordpress.com/2016/10/30/arduino-ethernet-shield-led-onoff-from-webpage/

[5] Federico Dossena (Uknown date) HOW TO PROPERLY CONTROL PWM FANS WITH ARDUINO (Version 1.0) [Source code]. https://fdossena.com/?p=ArduinoFanControl/i.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages