//kote by marderchen use it usefull :3 //(paste this textfilecontent in STM32F103C8T6 ready seted Arduino IDE and flash it :3(with ST-LINK/V2dongle)) //driver for 3x IRF4095 pulsing for powercondroling 12V (HSTNS-PR02 (12V56A 3.3V3.5A DC) //6tasters 4 chosing a led bar 2 changing led bar (3contact microswitches used caused handling.. also 3V3->taster->(470Rgroundet GPIO) can used //PSU active cooled by 2x 40x40mm serverturbine rear rotor (mosfet 2 6600yF parralel) //main cooling fans 60x60mm serverfans each 12V 1.5A (mosfet 1 >lowcoilresistor> 6600yF all fans parralel)(+6600yF final = 8capacitors (4*(2*10V3300yF inline)parralel) //STMF103C8T6 powered by 3V3 from psu //3 x (3Watt RGB) leds in line each color parralel with 40yF tanta1l circuit GPIO->220R->D882(3A NPN)->(N4007resistor for red)->leds->12V cute colorfull caselight //mosfetcircuit GPIO->220R->J3Y (NPN s8030)->IRF4095 with (4x 470R inline)positiv settet gate->fans->GND //also 3300yF parralel to fan /* pics * joy new stuff received: https://marderchen.lima-city.de/NEU+/roomcoolingstuff_hihihi.jpg * \/i alrealy known but if want to juse the pretty cheap HSTNS-PR02 caused strong 12V56A DC found here picture * https://static.rcgroups.net/forums/attachments/5/8/4/2/2/8/a7597681-52-IMG_0508.jpg * /\green wires are PSon (poweron) wires (required for 12V output), 3V3 (sB) alsways aviable (contact left from yellow 12V output) :3 * this server supply must be active cooled if using much power.. serversupplyes are fine save, output stabilised, overcurrentprotection,overheatingprotection * but with 56Ampere..- your stuff blown up before overcurrentprotection^^ so be carefull :3 * https://marderchen.lima-city.de/NEU+/room_fan_supplytestetfanstested.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unitbeforecontrolelectronic_1.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unitbeforecontrolelectronic_2.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unit_interface1.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unit_interface2.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unit_wiered.jpg //cooper is moste effective heatsink i know(2W RGBleds, IRF4095 mosfets,...) .. used 1.5mm˛ NYM core..(maybe laque if done against oxidation) * https://marderchen.lima-city.de/NEU+/roon_cooling_unit_pr0grammcreation.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unit_electronic.jpg //addet 6600yF on main fans parralel caused high drain if they start working * https://marderchen.lima-city.de/NEU+/room_cooling_unit_1rst_PSONsol.jpg * https://marderchen.lima-city.de/NEU+/room_cooling_unit_awesomecute_casedone.jpg !purrrr such a awesome workingsound if not much power :3 * have fun use it if usefull :3 * leds not required GPIOs from tasters 1-4 can be groundet only taster 5+6 for set power (watching switching values powers1 array) and PA0 main fan output needet * red with 150R on 3V3 for 3V3sB power STM on if 230V connected, switch in front for PSon (fans/leds 12V poweron) */ #define rot1 PC13 //caselight 3x 3Watt RGB inline on 12V #define blau1 PC14 // #define grun1 PC15 // #define led1 PB5 //interface leds + on GPIO leds ground on J3Y on bar GPIO 32*blue 3mm leds used #define led2 PA10 #define led3 PA9 #define led4 PA8 #define led5 PB15 #define led6 PB14 #define led7 PB13 #define led8 PB12 #define bar1 PB6 //right one main fans #define bar2 PB7 //supply fans #define bar3 PB8 //buildet in additionalmuch ampere 0-12VDC output #define bar4 PB9 //case light colormode 4modes not used maybe write them later :3 #define t1 PB11 #define t2 PB10 #define t3 PB1 #define t4 PB0 #define t5 PA7 #define t6 PA6 #define MOS1 PA0//GPIO->220R->J3Y (1.5A NPN)->over 4x(470R)inline 14.4V charged gate #define MOS2 PA1 #define MOS3 PA2//output from mosfet not used but connected maybe external 12V fans.. caused much power left #define chans 4 #define values 8 //fanstuff uint8_t onpress[15],zeit1; uint16_t bar[chans+2][values+1],posis[chans+2],upper[chans+2],light[10]; uint16_t fanP1,fanP2,fanP3,wahl; uint8_t positor,counter,hellist=700,rander,merkers; //beatcolorcalculator #define channelz 3 #define sqsteps 21 uint8_t beatsplit,strop[channelz+1],helligkeiten[channelz+1],newtrigger,blinkdata[sqsteps+1][channelz+1],isoncount,modi=1,doubleup=4,zufall; uint8_t moden[5]={1,2,4}; uint8_t xmoden[7]={0,41,82,0,81};//long thing matching vauels to psy fullon {0,81,72,0,59} //most time spendet for adjusting.. // void setup() { delay(200); pinMode(rot1,OUTPUT); pinMode(blau1,OUTPUT); pinMode(grun1,OUTPUT); pinMode(led1,OUTPUT); pinMode(led2,OUTPUT); pinMode(led3,OUTPUT); pinMode(led4,OUTPUT); pinMode(led5,OUTPUT); pinMode(led6,OUTPUT); pinMode(led7,OUTPUT); pinMode(led8,OUTPUT); pinMode(bar1,OUTPUT);pinMode(bar2,OUTPUT);pinMode(bar3,OUTPUT);pinMode(bar4,OUTPUT); pinMode(t1,INPUT); pinMode(t2,INPUT); pinMode(t3,INPUT); pinMode(t4,INPUT); pinMode(t5,INPUT); pinMode(t6,INPUT); pinMode(MOS1,OUTPUT);pinMode(MOS2,OUTPUT);pinMode(MOS3,OUTPUT); ratemal(); posis[1]=3;posis[0]=1;//boot value set } void loop() { zeitreise();} uint8_t setzer=3; void fadedown(void){ for (uint8_t waz=0; waz 0){setzer=4;fadedown(waz);} if(posis[3]==0){setzer=1; if(upper[waz]==0){fadeup(waz);} if(light[waz]>=hellist){upper[waz]=1;} if(upper[waz]==1){fadedown(waz);} if(light[waz]<=(hellist/8)){upper[waz]=0;}light[0]=0;light[2]=hellist-(160+(light[1]/5));} for (uint8_t wuz=0; wuz <(values+1); wuz++) { if(bar[waz][wuz]>=4){bar[waz][wuz]-=4;}if(bar[waz][waz]>0){bar[waz][wuz]--;}}}} void fadedown(uint8_t hierz){if(light[hierz]>=setzer){light[hierz]-=setzer;}if(light[hierz]>0){light[hierz]--;}} void fadeup(uint8_t hiers){if(light[hiers]<(hellist-setzer)){light[hiers]+=setzer;}if(light[hiers]=3) { if (digitalRead(t1) == HIGH && onpress[0] ==0) { onpress[0] =1;wahl=0;} if (onpress[0] == 1) { onpress[1]++;} if (onpress[1] >=2) { onpress[1] =0; onpress[0]=0; } if (digitalRead(t2) == HIGH && onpress[2] ==0) { onpress[2] =1;wahl=1; } if (onpress[2] == 1) { onpress[3]++;} if (onpress[3] >=2) { onpress[3] =0; onpress[2]=0; } if (digitalRead(t3) == HIGH && onpress[4] ==0) { onpress[4] =1;wahl=2;} if (onpress[4] == 1) { onpress[5]++;} if (onpress[5] >=2) { onpress[5] =0; onpress[4]=0; } if (digitalRead(t4) == HIGH && onpress[6] ==0) { onpress[6] =1;wahl=3;} if (onpress[6] == 1) { onpress[7]++;} if (onpress[7] >=2) { onpress[7] =0; onpress[6]=0; } if (digitalRead(t5) == HIGH && onpress[7] ==0) { onpress[7] =1;if(posis[wahl]<(values)){posis[wahl]++;}} if (onpress[7] == 1) { onpress[8]++;} if (onpress[8] >=4) { onpress[8] =0; onpress[7]=0; } if (digitalRead(t6) == HIGH && onpress[10] ==0) { onpress[10] =1;if(posis[wahl]>0){posis[wahl]--;}} if (onpress[10] == 1) { onpress[9]++;} if (onpress[9] >=4) { onpress[9] =0; onpress[10]=0; } if((digitalRead(t1)||digitalRead(t2)||digitalRead(t3)||digitalRead(t4)||digitalRead(t5)||digitalRead(t6))==HIGH){bar[2][8]=150;}//taster input controll led zeit1=0;}} long maintime=micros();long maintime3=millis();long flash=micros();long slowtime=micros();long dimmer=micros(); void zeitreise(void){ while ((millis()- maintime) >= 2){istinput();blinkekram(); maintime = millis();} while ((micros()- maintime3) >= 20) {fadedown(); maintime3 = micros();}// while ((micros()-flash) >= 4) { if(posis[3]==8){light[0]=strop[0];light[1]=strop[1];light[2]=strop[2];}//beatflashapply pulspowder();flash = micros();} //beatcolorstuff while ((micros()- slowtime)>(20100/doubleup)){//something between 19500-20500 raw- beatsplit++;if (beatsplit >=xmoden[doubleup]){beatsplit=1;newtrigger++;if(newtrigger>24){newtrigger=random(1,4)*3;ratemal();}}// for(uint8_t fiz=0;fiz= (2400/(doubleup*4))){for(uint8_t fu=0;fu=1){strop[fu]-=1;}}dimmer = micros();} // } uint16_t powers1[values+2]={0,22,34,50,80,100,200,400,999};//fans //chosable duty valuea for mosfets, not linear caused capacitors parralel to mosfets uint16_t powers2[values+2]={0,1,2,3,5,10,70,200,999};//PSU fans uint16_t powers3[values+2]={0,10,2,3,5,10,70,200,999}; void blinkekram(void){ counter++;if(counter>100){counter=0;}//halbsec rander=random(10,3)*30+100; merkers=(wahl+1)*100+100; if(posis[3]==1){// green+blue if(counter==0){light[2]=hellist;} if(counter==50){light[1]=merkers;} if(counter==25){light[2]=hellist;} if(counter==75){light[1]=rander;}} if(posis[3]==2){//green+red if(counter==0){light[0]=hellist;} if(counter==50){light[1]=merkers;} if(counter==25){light[0]=hellist;} if(counter==75){light[1]=rander;}} if(posis[3]==3){//blue+red if(counter==0){light[0]=hellist;} if(counter==50){light[2]=merkers;} if(counter==25){light[0]=hellist;} if(counter==75){light[2]=rander;}} if((counter%10)==0){ for(uint8_t da=0;da=nicht){bar[da][nicht]=8*counter+100;}}}} } uint16_t maxx=1000; void pulspowder(void) { for (uint16_t andere=0; andere <(chans); andere++) { if(andere==0){digitalWrite(bar1,HIGH);} if(andere==1){digitalWrite(bar2,HIGH);} if(andere==2){digitalWrite(bar3,HIGH);} if(andere==3){digitalWrite(bar4,HIGH);} for (uint16_t fcount=0; fcount <=maxx; fcount++) { if (fcount <= (maxx-1) && fcount >=1) { if (fcount==(maxx-light[2])) {digitalWrite(rot1,HIGH);} if (fcount==(maxx-light[1])) {digitalWrite(grun1,HIGH);} if (fcount==(maxx-light[0])) {digitalWrite(blau1,HIGH);} if (fcount==(maxx-bar[andere][1])) {digitalWrite(led1,HIGH);} if (fcount==(maxx-bar[andere][2])) {digitalWrite(led2,HIGH);} if (fcount==(maxx-bar[andere][3])) {digitalWrite(led3,HIGH);} if (fcount==(maxx-bar[andere][4])) {digitalWrite(led4,HIGH);} if (fcount==(maxx-bar[andere][5])) {digitalWrite(led5,HIGH);} if (fcount==(maxx-bar[andere][6])) {digitalWrite(led6,HIGH);} if (fcount==(maxx-bar[andere][7])) {digitalWrite(led7,HIGH);} if (fcount==(maxx-bar[andere][8])) {digitalWrite(led8,HIGH);} if (fcount==(maxx-powers1[posis[0]])) {digitalWrite(MOS1,HIGH);} if (fcount==(maxx-powers2[posis[1]])) {digitalWrite(MOS2,HIGH);} if (fcount==(maxx-powers3[posis[2]])) {digitalWrite(MOS3,HIGH);} } if (fcount>=maxx){allof();}}}} void allof(void){ digitalWrite(rot1,LOW);digitalWrite(grun1,LOW);digitalWrite(blau1,LOW); digitalWrite(led1,LOW);digitalWrite(led2,LOW);digitalWrite(led3,LOW);digitalWrite(led4,LOW);digitalWrite(led5,LOW);digitalWrite(led6,LOW);digitalWrite(led7,LOW);digitalWrite(led8,LOW); digitalWrite(bar1,LOW);digitalWrite(bar2,LOW);digitalWrite(bar3,LOW);digitalWrite(bar4,LOW); digitalWrite(MOS1,LOW);digitalWrite(MOS2,LOW);digitalWrite(MOS3,LOW);} //beatcolors void ratemal(void){ zufall=random(0,60); if(modi==3 && zufall <10){doubleup=moden[0];} if(modi==3 && zufall >=10 && zufall <30){doubleup=moden[1];} if(modi==3 && zufall >=30){doubleup=moden[2];} for(uint8_t tik=0;tik<=sqsteps;tik++){for(uint8_t tok=0;tok=1){isoncount++;}}}if(isoncount<=3){ratemal();}}//try solong until minimum 3flashes/sequenz