Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Open Source Laser Power Meter

  1. #21
    Join Date
    Aug 2013
    Posts
    23

    Default

    I took the liberty of restoring the indentation of the arduino code and adding in English translations for some of the text (Mostly for my own benefit--in the immortal words of Korben Dallas, "I only speak two languages...").

    The calorimetric approach is quite nice in its simplicity. Of course the mass of the heatsink has to be taken into the calibration, and using a heatsink means that measurement accuracy will be dependent on the surrounding air flow conditions. Measuring the equilibrium temperature and examining the slope during the measurement and cooldown periods would probably allow you to largely remove the heatsink and ambient characteristics from the measurements, but that would get complicated and mathy.

    But with a known mass of known material with a known absorption you can get pretty close quite easily. Neat!

    Code:
    // Digital Laser Power Meter// v 2.1
    
    
    
    
    #include <max6675.h>
    #include <LiquidCrystal.h>
    #include <Wire.h>
    
    
    
    
    //Max6675 CK,CS,SO
    MAX6675 thermocouple(4, 3, 2);
    int sense = 0;
    float cal = 0.0000;
    int t = 10;
    int tiempo = t;
    float p = 0.717;
    int m = 87;
    int maxt = 45;
    float temperatura = 0.000;
    float temperaturai = 0.000;
    float temperaturaf = 0.000;
    float temperaturaa = 0.000;
    float w = 0.000;
    //establecer conexiones LCD 16x2
    // RS, E, D4, D5, D6, D7
    LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
    
    
    
    
    void setup() {
    	Serial.begin(9600);
    	// use Arduino pins FORMAX6675 VCC AND GND 
    	pinMode(5, OUTPUT); digitalWrite(5, HIGH);
    	pinMode(6, OUTPUT); digitalWrite(6, LOW);
    	pinMode(7, OUTPUT); digitalWrite(7, HIGH);
    	lcd.begin(16, 2);
    	sense = analogRead(A7);
    	cal = sense * (2.0 / 1023.0);
    	p = cal;
    	// wait for MAX chip to stabilize
    	delay(1000);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print ("Medidor Potencia");
    	lcd.setCursor(0, 1);
    	lcd.print (" Laser Co2");
    	delay(2500);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print (" V 2.0 ");
    	lcd.setCursor(0, 1);
    	lcd.print ("521 229-419-3262");
    	delay(5000);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print ("Cal P = ");
    	lcd.print (p);
    	delay (2500);
    }
    
    
    
    
    void loop() 
    {
    
    
    
    
    	//esperar temperqatura menor a tmax
    	temperatura = thermocouple.readCelsius();
    
    
    	while (thermocouple.readCelsius() > maxt)
    	{
    		lcd.clear();
    		lcd.setCursor(0, 0);
    		lcd.print (" Temperatura de "); // "High sensor temperature"
    		lcd.setCursor(0, 1);
    		lcd.print (" sensor alta");
    		delay(2000);
    		lcd.clear();
    		lcd.setCursor(0, 0);
    		lcd.print ("Porfavor Espere"); //"Please wait"
    		lcd.setCursor(0, 1);
    		lcd.print (" T = ");
    		lcd.print (thermocouple.readCelsius());
    		lcd.print (" C");
    		delay(2000);
    	}
    
    
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print(" Medir Potencia "); // "Measure power"
    	lcd.setCursor(0, 2);
    	lcd.print(" Encender Laser "); // "Turn on the laser"
    	// guardar temperatura inicial
    	temperaturai = thermocouple.readCelsius();
    	digitalWrite(7, LOW);
    	//Serial.print ("Temperatura Inicial ");
    	//Serial.println (temperaturai);
    	//Serial.println ("Espera de laser");
    	delay (180);
    
    
    	do
    	{
    		temperatura = thermocouple.readCelsius();
    		//Serial.println(temperatura);
    		delay (180);
    		//esperar a una diferencia de un grado de temperatura
    		//wait for a difference of one degree of temperature
    
    
    		if (temperatura < temperaturai)
    		{
    			temperaturai = temperatura;
    		}
    	} while (temperatura-temperaturai < 1);
    
    
    	//Serial.println("Lecturas");
    	//esperar T segundos para absorber energia
    	//wait T seconds to absorb energy
    	do
    	{
    		lcd.clear();
    		lcd.setCursor(0, 0);
    		lcd.print("ESPERE "); // "WAIT"
    		lcd.print(tiempo);
    		lcd.print("Seg"); // "Sec[onds]"
    		tiempo=tiempo - 1;
    		//Serial.println(thermocouple.readCelsius());
    		delay (1000);
    	} while (tiempo > 0);
    	//Serial.println("Esperando Maximo");
    	digitalWrite(7, HIGH);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print("PROCESANDO"); // "PROCESSING"
    	temperaturaf = thermocouple.readCelsius();
    	delay(180); 
    
    
    	do
    	{
    		temperatura = thermocouple.readCelsius();
    
    
    		//Serial.print (temperaturaf);
    		//Serial.print (" - ");
    		//Serial.println (temperatura);
    		delay(200);
    		if (temperaturaf < temperatura)
    		{
    			temperaturaf = temperatura;
    		}
    	} while ((temperaturaf - temperatura) < 0.75);
    
    
    
    
    
    
    
    
    	w =((((m*(temperaturaf - temperaturai))*(4.18)*(p))/30));
    	//w = (((m*(deltat))/1000)*4180)/(t);
    	//Serial.println("calculo");
    	//Serial.println(temperaturai);
    	//Serial.println(temperaturaf);
    	//Serial.print("Watts: ");
    	//Serial.println(w);
    
    
    
    
    
    
    
    
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print ("POTENCIA LASER"); // "LASER POWER"
    	lcd.setCursor (0, 2);
    	lcd.print(w);
    	lcd.print(" Watts");
    
    
    
    
    	delay(10000);
    	tiempo = t;
    	digitalWrite(7, HIGH);
    }

  2. #22
    Join Date
    Jul 2018
    Posts
    21

    Default About the heatsink mass and specific heat

    Forgot to tell you,
    To make for differences in mass, absorption and specific heat, a trimmer multiturn pot is being read and used to calibrate the meter basically compensating for the heatsink used

    Ed.


    Quote Originally Posted by aberry View Post
    I took the liberty of restoring the indentation of the arduino code and adding in English translations for some of the text (Mostly for my own benefit--in the immortal words of Korben Dallas, "I only speak two languages...").

    The calorimetric approach is quite nice in its simplicity. Of course the mass of the heatsink has to be taken into the calibration, and using a heatsink means that measurement accuracy will be dependent on the surrounding air flow conditions. Measuring the equilibrium temperature and examining the slope during the measurement and cooldown periods would probably allow you to largely remove the heatsink and ambient characteristics from the measurements, but that would get complicated and mathy.

    But with a known mass of known material with a known absorption you can get pretty close quite easily. Neat!

    Code:
    // Digital Laser Power Meter// v 2.1
    
    
    
    
    #include <max6675.h>
    #include <LiquidCrystal.h>
    #include <Wire.h>
    
    
    
    
    //Max6675 CK,CS,SO
    MAX6675 thermocouple(4, 3, 2);
    int sense = 0;
    float cal = 0.0000;
    int t = 10;
    int tiempo = t;
    float p = 0.717;
    int m = 87;
    int maxt = 45;
    float temperatura = 0.000;
    float temperaturai = 0.000;
    float temperaturaf = 0.000;
    float temperaturaa = 0.000;
    float w = 0.000;
    //establecer conexiones LCD 16x2
    // RS, E, D4, D5, D6, D7
    LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
    
    
    
    
    void setup() {
    	Serial.begin(9600);
    	// use Arduino pins FORMAX6675 VCC AND GND 
    	pinMode(5, OUTPUT); digitalWrite(5, HIGH);
    	pinMode(6, OUTPUT); digitalWrite(6, LOW);
    	pinMode(7, OUTPUT); digitalWrite(7, HIGH);
    	lcd.begin(16, 2);
    	sense = analogRead(A7);
    	cal = sense * (2.0 / 1023.0);
    	p = cal;
    	// wait for MAX chip to stabilize
    	delay(1000);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print ("Medidor Potencia");
    	lcd.setCursor(0, 1);
    	lcd.print (" Laser Co2");
    	delay(2500);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print (" V 2.0 ");
    	lcd.setCursor(0, 1);
    	lcd.print ("521 229-419-3262");
    	delay(5000);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print ("Cal P = ");
    	lcd.print (p);
    	delay (2500);
    }
    
    
    
    
    void loop() 
    {
    
    
    
    
    	//esperar temperqatura menor a tmax
    	temperatura = thermocouple.readCelsius();
    
    
    	while (thermocouple.readCelsius() > maxt)
    	{
    		lcd.clear();
    		lcd.setCursor(0, 0);
    		lcd.print (" Temperatura de "); // "High sensor temperature"
    		lcd.setCursor(0, 1);
    		lcd.print (" sensor alta");
    		delay(2000);
    		lcd.clear();
    		lcd.setCursor(0, 0);
    		lcd.print ("Porfavor Espere"); //"Please wait"
    		lcd.setCursor(0, 1);
    		lcd.print (" T = ");
    		lcd.print (thermocouple.readCelsius());
    		lcd.print (" C");
    		delay(2000);
    	}
    
    
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print(" Medir Potencia "); // "Measure power"
    	lcd.setCursor(0, 2);
    	lcd.print(" Encender Laser "); // "Turn on the laser"
    	// guardar temperatura inicial
    	temperaturai = thermocouple.readCelsius();
    	digitalWrite(7, LOW);
    	//Serial.print ("Temperatura Inicial ");
    	//Serial.println (temperaturai);
    	//Serial.println ("Espera de laser");
    	delay (180);
    
    
    	do
    	{
    		temperatura = thermocouple.readCelsius();
    		//Serial.println(temperatura);
    		delay (180);
    		//esperar a una diferencia de un grado de temperatura
    		//wait for a difference of one degree of temperature
    
    
    		if (temperatura < temperaturai)
    		{
    			temperaturai = temperatura;
    		}
    	} while (temperatura-temperaturai < 1);
    
    
    	//Serial.println("Lecturas");
    	//esperar T segundos para absorber energia
    	//wait T seconds to absorb energy
    	do
    	{
    		lcd.clear();
    		lcd.setCursor(0, 0);
    		lcd.print("ESPERE "); // "WAIT"
    		lcd.print(tiempo);
    		lcd.print("Seg"); // "Sec[onds]"
    		tiempo=tiempo - 1;
    		//Serial.println(thermocouple.readCelsius());
    		delay (1000);
    	} while (tiempo > 0);
    	//Serial.println("Esperando Maximo");
    	digitalWrite(7, HIGH);
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print("PROCESANDO"); // "PROCESSING"
    	temperaturaf = thermocouple.readCelsius();
    	delay(180); 
    
    
    	do
    	{
    		temperatura = thermocouple.readCelsius();
    
    
    		//Serial.print (temperaturaf);
    		//Serial.print (" - ");
    		//Serial.println (temperatura);
    		delay(200);
    		if (temperaturaf < temperatura)
    		{
    			temperaturaf = temperatura;
    		}
    	} while ((temperaturaf - temperatura) < 0.75);
    
    
    
    
    
    
    
    
    	w =((((m*(temperaturaf - temperaturai))*(4.18)*(p))/30));
    	//w = (((m*(deltat))/1000)*4180)/(t);
    	//Serial.println("calculo");
    	//Serial.println(temperaturai);
    	//Serial.println(temperaturaf);
    	//Serial.print("Watts: ");
    	//Serial.println(w);
    
    
    
    
    
    
    
    
    	lcd.clear();
    	lcd.setCursor(0, 0);
    	lcd.print ("POTENCIA LASER"); // "LASER POWER"
    	lcd.setCursor (0, 2);
    	lcd.print(w);
    	lcd.print(" Watts");
    
    
    
    
    	delay(10000);
    	tiempo = t;
    	digitalWrite(7, HIGH);
    }

  3. #23
    Join Date
    Dec 2008
    Location
    Canada
    Posts
    972

    Default

    I would still like to know...
    What is the 100% response time at 1 Watt ??

    Jerry
    See the LaserBee II and all other LaserBee LPM products here....
    All LaserBee Laser Power Meter Products

    New 3.2Watt RS232/USB LaserBee II LPM REVIEW


    Always in stock and ready to ship....
    Subsidary:-Pharma Electronic Solutions

  4. #24
    Join Date
    Aug 2013
    Posts
    23

    Default

    Quote Originally Posted by lasersbee View Post
    I would still like to know...
    What is the 100% response time at 1 Watt ??
    The code sinfocomp shared shows that it waits for the the temperature of the heatsink (or really, integrating mass) to increase by one degree, and then after that has a fixed integration time of ten seconds. So the 1W response time will depend on the mass of the heatsink. Aluminum has a specific heat of 0.9 J/gK, so the addition 1 degree time is going to be about a second per gram. So clearly low power applications want a smaller integrating mass.

  5. #25
    Join Date
    Jul 2018
    Posts
    21

    Default dont have a 1 watt laser

    Sorry, cant test, i dont have a 1 watt laser

    Quote Originally Posted by lasersbee View Post
    I would still like to know...
    What is the 100% response time at 1 Watt ??

    Jerry

  6. #26
    Join Date
    Dec 2008
    Location
    Canada
    Posts
    972

    Default

    Quote Originally Posted by aberry View Post
    The code sinfocomp shared shows that it waits for the the temperature of the heatsink (or really, integrating mass) to increase by one degree, and then after that has a fixed integration time of ten seconds. So the 1W response time will depend on the mass of the heatsink. Aluminum has a specific heat of 0.9 J/gK, so the addition 1 degree time is going to be about a second per gram. So clearly low power applications want a smaller integrating mass.
    Thanks for the additional Code timing info.

    Quote Originally Posted by sinfocomp View Post
    Sorry, cant test, i dont have a 1 watt laser
    No problem... Was just curious.

    Jerry
    See the LaserBee II and all other LaserBee LPM products here....
    All LaserBee Laser Power Meter Products

    New 3.2Watt RS232/USB LaserBee II LPM REVIEW


    Always in stock and ready to ship....
    Subsidary:-Pharma Electronic Solutions

  7. #27
    Join Date
    Jul 2018
    Posts
    21

    Default Faster response power meter

    Currently working on a similar proyect but using a TEC which will allow a much faster response time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •