Joined
·
3,739 Posts
Hey all,
Lately I've been working on some fun project: Controlling my water cooling pump, fans and all RGB LEDs in one place. I am aware that there are programs that can do this on PC. But since I'm into DIY & hobby electronics stuff, I like to play and tinker with things so decided to entertain this idea of controlling my PC components via my smartphone over bluetooth. Besides I had a lot of fun and learnt many things while developing this. I hope you like it too!

I like open hardware and open source so I'm going to share everything with you guys. The schematics, codes, parts lists etc... nothing is proprietary here so that you can build it or even better, improve upon it.

So the hardware is based on an Arduino board. For those who are not familiar with it, Arduino is a development board based on Atmega AT328P microcontroller. You can plug it in your PC via USB and start programming it right away. There are truckloads of electronic components you can use with it such as sensors, motors, wireless transreceivers etc... You might wanna check on YouTube video tutorials if you want to learn more about Arduino, hobby electronics.
So I used an Arduino UNO R3 model with Prototyping shield on it. The shield is not necessary, you can use a breadboard instead but it saves space. The system uses HC-06 bluetooth transreceiver unit to communicate via Android smartphone. It also has LM35 temp sensor for measurement and IRLB8721 MOSFETs to drive 12v RGB LED strips. That's all. To control the fans I'm using a fan hub from Silverstone (SST-CPF04). Arduino sends to PWM signals to fan hub, and fan hub distributes power and PWM signal to all my fans. You can either use a fan hub like me, or make your own fan hub via appropriate transistors and caps. There are tutorials online.
As I said the unit has an onboard placeholder temp sensor. Arduino reads it and sends the temp data to your smartphone over bluetooth. You can attach the sensor on female jumper cables and stick it to your GPU if you want. Further experiments can be done with different temp sensors.
The parts used in the project are easily obtainable on places like ebay and cost very little.
Parts list:
-Arduino UNO R3
-HC-06 bluetooth transreceiver
-3x IRLB8721 MOSFET
-LM35 temp sensor
-Couple of M to M, M to F jumper cables.
-Isolation tape.
-Molex to power jack connector to power Arduino and RGB LED strips.
Optional:
-Silverstone SST-CPF04 or any other fan hub with PWM support.
-Arduino Protoshield (or a regular breadboard)
So how do I connect the parts together?
And how can I easily connect multiple RGB LED strips to this unit?
How do I connect my fan hub and pump to Arduino?
How to power Arduino while it's in case?
The Android app was built by me using MIT App Inventor 2. It does what it is intended to, no fancy interface.If you believe you have the skills, by all means go ahead and improve it. You can add color cycle animations, temp based lighting etc...You have all my permission, just make sure you name the original author, me.
Here's the .apk and .aia files of the Android app:
Android_app.zip 1821k .zip file
You can install it on your smartphone using the .apk and develop&edit&improve using .aia file. All you have to do is visit the App Inventor page and upload the .aia file there. It is very easy to use with a friendly interface, you won't believe it!
You also need to upload this sketch to your Arduino after you hooked up all the parts correctly:
Lastly, I know it needs a proper cable management!
Perhaps some of you print a case or shroud for it.
P.S. Arduino uses 490Hz PWM signals, whereas official Intel spec says the PWM signal should be 25Khz. So PC hardware is obviously designed with Intel's specs in mind. So what does that mean? Will things explode? No. You can still adjust the speed, It's just some fans will probably make humming noise at certain speeds that's it.
Lately I've been working on some fun project: Controlling my water cooling pump, fans and all RGB LEDs in one place. I am aware that there are programs that can do this on PC. But since I'm into DIY & hobby electronics stuff, I like to play and tinker with things so decided to entertain this idea of controlling my PC components via my smartphone over bluetooth. Besides I had a lot of fun and learnt many things while developing this. I hope you like it too!
I like open hardware and open source so I'm going to share everything with you guys. The schematics, codes, parts lists etc... nothing is proprietary here so that you can build it or even better, improve upon it.
So the hardware is based on an Arduino board. For those who are not familiar with it, Arduino is a development board based on Atmega AT328P microcontroller. You can plug it in your PC via USB and start programming it right away. There are truckloads of electronic components you can use with it such as sensors, motors, wireless transreceivers etc... You might wanna check on YouTube video tutorials if you want to learn more about Arduino, hobby electronics.
So I used an Arduino UNO R3 model with Prototyping shield on it. The shield is not necessary, you can use a breadboard instead but it saves space. The system uses HC-06 bluetooth transreceiver unit to communicate via Android smartphone. It also has LM35 temp sensor for measurement and IRLB8721 MOSFETs to drive 12v RGB LED strips. That's all. To control the fans I'm using a fan hub from Silverstone (SST-CPF04). Arduino sends to PWM signals to fan hub, and fan hub distributes power and PWM signal to all my fans. You can either use a fan hub like me, or make your own fan hub via appropriate transistors and caps. There are tutorials online.
As I said the unit has an onboard placeholder temp sensor. Arduino reads it and sends the temp data to your smartphone over bluetooth. You can attach the sensor on female jumper cables and stick it to your GPU if you want. Further experiments can be done with different temp sensors.
The parts used in the project are easily obtainable on places like ebay and cost very little.
Parts list:
-Arduino UNO R3
-HC-06 bluetooth transreceiver
-3x IRLB8721 MOSFET
-LM35 temp sensor
-Couple of M to M, M to F jumper cables.
-Isolation tape.
-Molex to power jack connector to power Arduino and RGB LED strips.
Optional:
-Silverstone SST-CPF04 or any other fan hub with PWM support.
-Arduino Protoshield (or a regular breadboard)
So how do I connect the parts together?
And how can I easily connect multiple RGB LED strips to this unit?
How do I connect my fan hub and pump to Arduino?
How to power Arduino while it's in case?
The Android app was built by me using MIT App Inventor 2. It does what it is intended to, no fancy interface.If you believe you have the skills, by all means go ahead and improve it. You can add color cycle animations, temp based lighting etc...You have all my permission, just make sure you name the original author, me.
Here's the .apk and .aia files of the Android app:
Android_app.zip 1821k .zip file
You can install it on your smartphone using the .apk and develop&edit&improve using .aia file. All you have to do is visit the App Inventor page and upload the .aia file there. It is very easy to use with a friendly interface, you won't believe it!
You also need to upload this sketch to your Arduino after you hooked up all the parts correctly:
//DEVELOPED BY ÇAĞAN ÇELİK 2017
//OVERCLOCK.NET
#include
#define tempCycle 1000U //Multi threading...
unsigned long tempLastMillis = 0;
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];
int red;
int green;
int blue;
int fan;
int pump;
int temp;
boolean newData = false;
// Please note below you can find some codes turned to comments.
// These codes are playing with Arduino's PWM registers and pin #9 and #10
// to give true 25Khz PWM signal output (Intel's official PWM specs)
// This is useful if you are experiencing buzzing, humming noises with
// Arduino's default 490Hz PWM signal. But it makes other PWM outputs obsolete.
// So no RGB lighting control for you.
//word pwmA = 160; // 50% duty (0-320 = 0-100% duty cycle)
//word pwmB = 288; // 90% duty (0-320 = 0-100% duty cycle)
boolean cycleCheck(unsigned long *lastMillis, unsigned int cycle)
{
unsigned long currentMillis = millis();
if(currentMillis - *lastMillis >= cycle)
{
*lastMillis = currentMillis;
return true;
}
else
return false;
}
void setup() {
Serial.begin(9600);
pinMode(9, OUTPUT); //pwmA
pinMode(10, OUTPUT); //pwmB
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
// 25Khz conversion code continues...
/*
TCCR1A = 0; //clear timer registers
TCCR1B = 0;
TCNT1 = 0;
TCCR1B |= _BV(CS10); //no prescaler
ICR1 = 320; //PWM mode counts up 320 then down 320 counts (25kHz)
OCR1A = pwmA; //0-320 = 0-100% duty cycle
TCCR1A |= _BV(COM1A1); //output A clear rising/set falling
OCR1B = pwmB; //0-320 = 0-100% duty cycle
TCCR1A |= _BV(COM1B1); //output B clear rising/set falling
TCCR1B |= _BV(WGM13); //PWM mode with ICR1 Mode 10
TCCR1A |= _BV(WGM11); //WGM13:WGM10 set 1010
*/
// 25Khz conversion code finishes here.
red = EEPROM.read(0);
green = EEPROM.read(1);
blue = EEPROM.read(2);
fan = EEPROM.read(3);
pump = EEPROM.read(4);
analogWrite(9,fan);
analogWrite(10,pump);
analogWrite(6,blue); //mavi
analogWrite(3,red); //kırmızı
analogWrite(5,green); //yeşil
}
void loop() {
recvWithStartEndMarkers();
if (newData == true) {
strcpy(tempChars, receivedChars);
parseData();
showParsedData();
newData = false;
analogWrite(9,fan);
analogWrite(10,pump);
analogWrite(6,blue);
analogWrite(3,red);
analogWrite(5,green);
EEPROM.update(0,red);
EEPROM.update(1,green);
EEPROM.update(2,blue);
EEPROM.update(3,fan);
EEPROM.update(4,pump);
}
if(cycleCheck(&tempLastMillis, tempCycle))
{
temp= analogRead(A0);
int mv = ( temp/1024.0)*5000;
int cel = mv/10;
Serial.print(" " );
Serial.println(cel);
}
}
void recvWithStartEndMarkers() {
static boolean recvInProgress = false;
static byte ndx = 0;
char startMarker = '<';
char endMarker = '>';
char rc;
while (Serial.available() > 0 && newData == false) {
rc = Serial.read();
if (recvInProgress == true) {
if (rc != endMarker) {
receivedChars[ndx] = rc;
ndx++;
if (ndx >= numChars) {
ndx = numChars - 1;
}
}
else {
receivedChars[ndx] = '\0'; // terminate the string
recvInProgress = false;
ndx = 0;
newData = true;
}
}
else if (rc == startMarker) {
recvInProgress = true;
}
}
}
void parseData() { // split the data into its parts
char * strtokIndx; // this is used by strtok() as an index
strtokIndx = strtok(tempChars,","); // get the first part - the string
red = atoi(strtokIndx);
strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
green = atoi(strtokIndx); // convert this part to an integer
strtokIndx = strtok(NULL, ",");
blue = atoi(strtokIndx);
strtokIndx = strtok(NULL, ",");
fan = atoi(strtokIndx);
strtokIndx = strtok(NULL, ",");
pump = atoi(strtokIndx);
}
void showParsedData() {
/*
Serial.print("R ");
Serial.println(red);
Serial.print("G ");
Serial.println(green);
Serial.print("B ");
Serial.println(blue);
Serial.print("Fan ");
Serial.println(fan);
Serial.print("Pump ");
Serial.println(pump);
Serial.print("EEPROM 1: ");
Serial.println(EEPROM.read(0));
Serial.print("EEPROM 2: ");
Serial.println(EEPROM.read(1));
Serial.print("EEPROM 3: ");
Serial.println(EEPROM.read(2));
Serial.print("EEPROM 4: ");
Serial.println(EEPROM.read(3));
Serial.print("EEPROM 5: ");
Serial.println(EEPROM.read(4));
*/
}
//OVERCLOCK.NET
#include
#define tempCycle 1000U //Multi threading...
unsigned long tempLastMillis = 0;
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];
int red;
int green;
int blue;
int fan;
int pump;
int temp;
boolean newData = false;
// Please note below you can find some codes turned to comments.
// These codes are playing with Arduino's PWM registers and pin #9 and #10
// to give true 25Khz PWM signal output (Intel's official PWM specs)
// This is useful if you are experiencing buzzing, humming noises with
// Arduino's default 490Hz PWM signal. But it makes other PWM outputs obsolete.
// So no RGB lighting control for you.
//word pwmA = 160; // 50% duty (0-320 = 0-100% duty cycle)
//word pwmB = 288; // 90% duty (0-320 = 0-100% duty cycle)
boolean cycleCheck(unsigned long *lastMillis, unsigned int cycle)
{
unsigned long currentMillis = millis();
if(currentMillis - *lastMillis >= cycle)
{
*lastMillis = currentMillis;
return true;
}
else
return false;
}
void setup() {
Serial.begin(9600);
pinMode(9, OUTPUT); //pwmA
pinMode(10, OUTPUT); //pwmB
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
// 25Khz conversion code continues...
/*
TCCR1A = 0; //clear timer registers
TCCR1B = 0;
TCNT1 = 0;
TCCR1B |= _BV(CS10); //no prescaler
ICR1 = 320; //PWM mode counts up 320 then down 320 counts (25kHz)
OCR1A = pwmA; //0-320 = 0-100% duty cycle
TCCR1A |= _BV(COM1A1); //output A clear rising/set falling
OCR1B = pwmB; //0-320 = 0-100% duty cycle
TCCR1A |= _BV(COM1B1); //output B clear rising/set falling
TCCR1B |= _BV(WGM13); //PWM mode with ICR1 Mode 10
TCCR1A |= _BV(WGM11); //WGM13:WGM10 set 1010
*/
// 25Khz conversion code finishes here.
red = EEPROM.read(0);
green = EEPROM.read(1);
blue = EEPROM.read(2);
fan = EEPROM.read(3);
pump = EEPROM.read(4);
analogWrite(9,fan);
analogWrite(10,pump);
analogWrite(6,blue); //mavi
analogWrite(3,red); //kırmızı
analogWrite(5,green); //yeşil
}
void loop() {
recvWithStartEndMarkers();
if (newData == true) {
strcpy(tempChars, receivedChars);
parseData();
showParsedData();
newData = false;
analogWrite(9,fan);
analogWrite(10,pump);
analogWrite(6,blue);
analogWrite(3,red);
analogWrite(5,green);
EEPROM.update(0,red);
EEPROM.update(1,green);
EEPROM.update(2,blue);
EEPROM.update(3,fan);
EEPROM.update(4,pump);
}
if(cycleCheck(&tempLastMillis, tempCycle))
{
temp= analogRead(A0);
int mv = ( temp/1024.0)*5000;
int cel = mv/10;
Serial.print(" " );
Serial.println(cel);
}
}
void recvWithStartEndMarkers() {
static boolean recvInProgress = false;
static byte ndx = 0;
char startMarker = '<';
char endMarker = '>';
char rc;
while (Serial.available() > 0 && newData == false) {
rc = Serial.read();
if (recvInProgress == true) {
if (rc != endMarker) {
receivedChars[ndx] = rc;
ndx++;
if (ndx >= numChars) {
ndx = numChars - 1;
}
}
else {
receivedChars[ndx] = '\0'; // terminate the string
recvInProgress = false;
ndx = 0;
newData = true;
}
}
else if (rc == startMarker) {
recvInProgress = true;
}
}
}
void parseData() { // split the data into its parts
char * strtokIndx; // this is used by strtok() as an index
strtokIndx = strtok(tempChars,","); // get the first part - the string
red = atoi(strtokIndx);
strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
green = atoi(strtokIndx); // convert this part to an integer
strtokIndx = strtok(NULL, ",");
blue = atoi(strtokIndx);
strtokIndx = strtok(NULL, ",");
fan = atoi(strtokIndx);
strtokIndx = strtok(NULL, ",");
pump = atoi(strtokIndx);
}
void showParsedData() {
/*
Serial.print("R ");
Serial.println(red);
Serial.print("G ");
Serial.println(green);
Serial.print("B ");
Serial.println(blue);
Serial.print("Fan ");
Serial.println(fan);
Serial.print("Pump ");
Serial.println(pump);
Serial.print("EEPROM 1: ");
Serial.println(EEPROM.read(0));
Serial.print("EEPROM 2: ");
Serial.println(EEPROM.read(1));
Serial.print("EEPROM 3: ");
Serial.println(EEPROM.read(2));
Serial.print("EEPROM 4: ");
Serial.println(EEPROM.read(3));
Serial.print("EEPROM 5: ");
Serial.println(EEPROM.read(4));
*/
}
Lastly, I know it needs a proper cable management!


P.S. Arduino uses 490Hz PWM signals, whereas official Intel spec says the PWM signal should be 25Khz. So PC hardware is obviously designed with Intel's specs in mind. So what does that mean? Will things explode? No. You can still adjust the speed, It's just some fans will probably make humming noise at certain speeds that's it.
Attachments
-
1.8 MB Views: 198