Thinking of a new light ..

stardustsailor

Well-Known Member
And ....
A new shield for Arduino ....
P4271144.JPG


Some notes and new features :

-A buzzer is installed .It buzzes shortly when the CXAs will switch on and will buzz on/off if protection is enabled ...

- Instead of an optocoupler ( 4N33 ) in 'inverter' mode ,this time a 2N3904 transistor is used for the SSR switching .
In 'buffer' mode .So Arduino has to signal 'high' continuously ,for the led drivers to operate .

-Instead of 12 VDC regulator ,a 9VDC is used ( LM 7809CT ) .I've noticed that Arduino's built-in 5 VDC regulator ,warms up pretty much with 12 VDC supply .

-An external 3.3 reference voltage is used (LD 33 ) ,for the thermistors ,instead of 5 V line of Arduino .
Noise is way less and thermistors self-heat less with 3.3 V .Thus readings are even more accurate .

-Shield is much smaller in size than before.

-No pwm fan control.

ard shield new.JPG



And the code :

//BASED ON the Extended STEINHART-HART EQUATION
// 1/T= A1+B1* ln (R/Rref) +C1 *ln^2 (R/Rref)+D1 *ln^3 (R/Rref)
//START CODE
//LIBRARIES
#include <LCD5110_3pin.h>
#include <math.h>
//LCD FONTS
extern uint8_t Normal[];
//PIN ASSIGNMENT
LCD5110 LCD(5,6,7);//LCD Pins: SCLK - MOSI- DC
#define SSR_PIN 10 // SOLID STATE RELAY OUTPUT SIGNAL PIN
#define BUZZ_PIN 2 //BUZZER PIN
#define SENSOR_A_PIN A5 // THERMISTOR INPUT D
#define SENSOR_B_PIN A4 // THERMISTOR INPUT C
#define SENSOR_C_PIN A3 // THERMISTOR INPUT B
#define SENSOR_D_PIN A2 // THERMISTOR INPUT A
//CONSTANTS
#define THR_NOM_RES 10000 // THERMISTOR NOM.RESISTANCE IN OHMS
#define TEMP_NOM 25 // THERMISTOR NOM. TEMPERATURE IN °C
#define kA1 0.003353832 // THERMISTOR A1 PARAMETER
#define kB1 0.0002569355 // THERMISTOR B1 PARAMETER
#define kC1 0.000002626311 // THERMISTOR C1 PARAMETER
#define kD1 0.000000675278 // THERMISTOR D1 PARAMETER
#define SAMPLE 10 // SAMPLES FOR AVERAGING SENSOR VALUES (DIGITAL LOW PASS NOISE FILTERING .DEFAULT=5)
#define SER_RES_A 9990 // SERIES RESISTOR IN OHMS FOR V.DIV. OF THERMISTOR A
#define SER_RES_B 9940 // SERIES RESISTOR IN OHMS FOR V.DIV. OF THERMISTOR B
#define SER_RES_C 9930 // SERIES RESISTOR IN OHMS FOR V.DIV. OF THERMISTOR C
#define SER_RES_D 9890 // SERIES RESISTOR IN OHMS FOR V.DIV. OF THERMISTOR D
//INTEGERS
int samples_A[SAMPLE];
int samples_B[SAMPLE];
int samples_C[SAMPLE];
int samples_D[SAMPLE];
long TX1;
long TX2;
long TX3;
long TX4;
//
//SET UP
//
void setup()
{
analogReference(EXTERNAL);
pinMode( SSR_PIN,OUTPUT );
digitalWrite(SSR_PIN,LOW);
pinMode( BUZZ_PIN,OUTPUT );
pinMode (SENSOR_A_PIN,INPUT);
pinMode (SENSOR_B_PIN,INPUT);
pinMode (SENSOR_C_PIN,INPUT);
pinMode (SENSOR_D_PIN,INPUT);
//
//LCD INITIALISING*SPLASH SCREEN
//
LCD.InitLCD();
LCD.setFont(Normal);
LCD.clrScr();
LCD.drawRoundRect (2,2,81,45);
LCD.print("Tc Monitoring",CENTER,4);
LCD.print("&",CENTER,12);
LCD.print("Active",CENTER,20);
LCD.print("Protection",CENTER,28 ) ;
LCD.print("Limit:75~C",CENTER,36);
LCD.update();
delay(5000);
digitalWrite(BUZZ_PIN,HIGH);
LCD.invert(true);
LCD.clrScr();
for (int i=0; i<17; i++)
{
LCD.drawCircle(41, 23, i*3);
LCD.update();
}
delay (1000);
digitalWrite(SSR_PIN,HIGH);
digitalWrite(BUZZ_PIN,LOW);
}
//
//LOOP
//
void loop()
{
//
//THERMISTOR SENSOR SAMPLES AVERAGING
//
uint8_t i;
float average_A;
float average_B;
float average_C;
float average_D;
for (i=0; i< SAMPLE; i++)
{
samples_A[i ] = analogRead(SENSOR_A_PIN);
delay(10);
samples_B[i ] = analogRead(SENSOR_B_PIN);
delay(10);
samples_C[i ] = analogRead(SENSOR_C_PIN);
delay(10);
samples_D[i ] = analogRead(SENSOR_D_PIN);
delay(10);
}
average_A=0;
average_B=0;
average_C=0;
average_D=0;
for (i=0; i< SAMPLE; i++)
{
average_A += samples_A[i ];
average_B += samples_B[i ];
average_C += samples_C[i ];
average_D += samples_D[i ];
}
average_A /= SAMPLE;
average_B /= SAMPLE;
average_C /= SAMPLE;
average_D /= SAMPLE;
//
average_A = 1023 / average_A - 1;
average_A = SER_RES_A / average_A;
//
average_B = 1023 / average_B - 1;
average_B = SER_RES_B / average_B;
//
average_C = 1023 / average_C - 1;
average_C = SER_RES_C / average_C;
//
average_D = 1023 / average_D - 1;
average_D = SER_RES_D / average_D;
//
//STEINHART-HART EXTENDED CALC
//
float TC_A;
TC_A = average_A / THR_NOM_RES;
TC_A = log(TC_A);
TC_A =1/(kA1+(kB1*TC_A)+(kC1*TC_A*TC_A)+(kD1*TC_A*TC_A*TC_A));
TC_A =TC_A- 273.15;
float TC_B;
TC_B = average_B / THR_NOM_RES;
TC_B = log(TC_B);
TC_B =1/(kA1+(kB1*TC_B)+(kC1*TC_B*TC_B)+(kD1*TC_B*TC_B*TC_B));
TC_B =TC_B- 273.15;
float TC_C;
TC_C = average_C / THR_NOM_RES;
TC_C = log(TC_C);
TC_C =1/(kA1+(kB1*TC_C)+(kC1*TC_C*TC_C)+(kD1*TC_C*TC_C*TC_C));
TC_C =TC_C- 273.15;
float TC_D;
TC_D = average_D / THR_NOM_RES;
TC_D = log(TC_D);
TC_D =1/(kA1+(kB1*TC_D)+(kC1*TC_D*TC_D)+(kD1*TC_D*TC_D*TC_D));
TC_D =TC_D- 273.15;
//
//AVERAGING CASE TEMPERATURES
//
float TC_AV;
TC_AV = ( ( TC_A + TC_B + TC_C + TC_D ) / 4 );

//LCD INTERFACE
//
LCD.clrScr();
LCD.setFont(Normal);
LCD.invert(false);
//
LCD.print("AVRG:",LEFT,0);
LCD.printNumF(TC_AV,2,36,0);
LCD.print("~C",72,0);
//
// TC bar graph
//
LCD.drawRoundRect (1,8,82,14);
LCD.drawLine(2,11,82,11);
LCD.invPixel(42,9);
LCD.invPixel(42,10);
LCD.invPixel (42,11);
LCD.invPixel (42,12);
LCD.invPixel (42,13);
//
TX1=TC_A;
TX1=constrain (TX1,25,75);
TX1=map(TX1,25,75,2,81);
//
TX2=TC_B;
TX2=constrain (TX2,25,75);
TX2=map(TX2,25,75,2,82);
//
TX3=TC_C;
TX3=constrain (TX3,25,75);
TX3=map(TX3,25,75,2,82);
//
TX4=TC_D;
TX4=constrain (TX4,25,75);
TX4=map(TX4,25,75,2,81);
//
//Animation.
LCD.drawLine(2,9,TX1,9);
LCD.drawLine(2,10,TX2,10);
LCD.drawLine(2,12,TX3,12);
LCD.drawLine(2,13,TX4,13);
//
LCD.print("Tc 1:",LEFT,16);
LCD.printNumF(TC_A,2,36,16);
LCD.print("~C",72,16);
//
LCD.print("Tc 2:",LEFT,24);
LCD.printNumF(TC_B,2,36,24);
LCD.print("~C",72,24);
//
LCD.print("Tc 3:",LEFT,32);
LCD.printNumF(TC_C,2,36,32);
LCD.print("~C",72,32);
//
LCD.print("Tc 4:",LEFT,40);
LCD.printNumF(TC_D,2,36,40);
LCD.print("~C",72,40);
//
LCD.update();
//
//THERMAL PROTECTION DIRECTIVES
//
if ( TC_A >= 75 || TC_B >= 75 || TC_C >= 75 || TC_D >= 75 )
{
digitalWrite(SSR_PIN,LOW);
LCD.invert(true);
digitalWrite(BUZZ_PIN,HIGH);
delay(500);
LCD.invert(false);
digitalWrite(BUZZ_PIN,LOW);
LCD.update();
}
else
if ( TC_A < 75 && TC_B < 75 && TC_C < 75 && TC_D < 75 )
{
digitalWrite(SSR_PIN,HIGH);
}
delay(500); // OPERATIONAL LOOP REFRESH RATE. DEFAULT= 1 Hz ( 1000 millsec )
}
//
//END CODE
//
 
Last edited:

stardustsailor

Well-Known Member
And a bit of 'show-off' ...
Still needs a bit of calibratin' ...But other than that ,it works great ...
( blue led is supposed to be the CXAs ... )


Video quiz for clever stoners :
-Can anyone answer me ,why the "out" sensor of the thermometer ,
while being close to the thermistors (being also a thermistor itself ) ,after heating ,
shows different values than the four thermistors ...
It is way more 'unresponsive', more 'slower' when temperature is decreasing from high to ambient .
It seems like ...somwhere is 'stored' heat ..(there ....I've just answered the question ..)..
Thermal capacitance & conductance of something ...
What is happening ,exactly ?

( And that would be a perfect example ,of wrong use of TIM .)
 
Last edited:

salmone

Well-Known Member
pardon... sds.. my bad english... TIM?..

upsss ... Guod thanks fot the links... nice drivers... i like your mini way

Saludos
 
Last edited:

salmone

Well-Known Member
thankss.......

I understand only pieces...(my bad english)...but I seemed good video on basic thermal design...


saludos
 
Last edited:

PSUAGRO.

Well-Known Member
You would think someone like SDS couldn't possibly smoke analog cigarettes:).........get with the times, it's all about digital/vaping your nicotine now!!lol

be safe friend
 

stardustsailor

Well-Known Member
Well ,down goes with the river ...

It's the epoxy ,the thermistor of the thermometer ,is encapsulated in ...
It really affects the overall response of the sensor .
But more dramatically ,it shows when temperature is decreasing ...

And that is for two reasons ...

-Epoxy stores heat ( thermal capacitance )

-Epoxy does not conduct heat very good .

( that's why when a metalic and a 'epoxy polymer' thing/part ,is touched in the forehead ,
the metalic feels cold ,while the polymer does not ...
Metals conduct heat ( transfer or absorb ) better and faster ..
While actually having the same temperature ,metalic things/parts feel colder ,cause they absorb heat from skin faster
and in bigger quantities than things made out of polymer/epoxy ...
 

stardustsailor

Well-Known Member
FAN CONTROL:

Well after some thought and plenty of carelessness to read the fuckin' manual ..
Thus 'mishappens' ...
I've ended up with this solution:
Voltage control of the fans .
Those Sunons have an operating range of 6-13.8 VDC .
sun v.JPG
(Big "Thank you" goes to Guod ,for supplying with the datasheet.Something I neglected to find & read.. )

So ,I'm going to use this circuit :

adj swi reg.JPG



The formula to set the output voltage is this :

set out v.JPGR1 is going to be 1K ( 1000 ohms )

R2 is not going to be a pot ....I have handy a spare and brand new ,
1x12 rotary switch ,with a nice "clic-clic-clic-clic-".. 'movement/action' ...

It is going to be placed the other side of the round monitor ...
One knob for cooling control ,one knob for light output control ..

I do not want a pot ,as it will go from 0 to 10 K ,for example ...
This means an output voltage of ~1.2 to ~13.5 ...

I want the lowest setting to be around 7 VDC ..Not 1.2 VDC ...
I want to ensure that fans will start to roll ,once the timer switches on the fixture ...
Even with plenty of dust and debris ,sitted on their 'wings/rotors' ...
Making them heavier,needy of more power (=>voltage) to start rolling ..

So a rotary switch ...
With min setting R2= 4700 K
and advancing for 11x settings,each setting + 470 Ohms
total = 4700+ {470*11}=9870

V out max = 1.23* ( 1+ { 9870/1000} ) =>
V out max=13.37 =~ 13.4 VDC

Vout min= 1.23* ( 1+ { 4700/1000} )=>
V out min=7.011 =~ 7 VDC

Settings " 9" & "10 " are ~11.6 & ~12.2 VDC respectively ..
The " Nominal Operation " ...

Settings '11' & '12 ' are the 'Soft Overdrive Operation' ..
( ~12.8 & ~13.4 respectively )

Settings '1' to '4' are the ' Silent Operation'
( ~7 to ~8.75 VDC )

Settings '5' to '8' are the ' Eco Operation'
( ~9.3 to ~11 VDC )

In few hours time ,an update on that ...
 
Last edited:

stardustsailor

Well-Known Member
P4281152.JPG

Left knob ,cooling adjust .(12x fan speed settings )
Right knob ,output light power adjust .(350-1950mA driving current )
In the middle,the results of the set combo of the above.
No worries about "wrong choices"...
CXA arrays will be switched off,if their case temperature hits the 75°C mark ...

It surely looks (..and will weight), very ' hi-endish ' ...
But hey...
Lots-lots of work ....Already done and more to be done, still ahead ...

P4281151.JPG
 

stardustsailor

Well-Known Member
It starts to take it's 'form'..
Day by day ....

First pair of fans installed.
One pair more ,to go .
Later on the top lid part of work..

Next task is either drilling/tapping the holes for the ideal array holders ...
And move on to the bottom steel panel ...
I'm still waiting for the drivers to arrive ...

P4281154.JPG


P4281155.JPG

Thank God,I'm through with the electronics part (I hope... ) ...
Mainly the metal-work and lot's of wiring is the "big,time/patience -consuming work" ....
The heatsinks sanding /finishing ,the thermocouples & the TIM/COBs installing are some of the 'most delicate' work to be done ...More 'artistic-scientific ' ...


If anyone interested to see some tests :

 
Top