Proyecto Luxómetro/ Luxmeter Project

by Andrés Morelli in Circuits > Arduino

1067 Views, 1 Favorites, 0 Comments

Proyecto Luxómetro/ Luxmeter Project

luxómetro - imágen 23.png
luxómetro - imágen 21.png

Somos el grupo 1 de 6º año de la Escuela Técnica Henry Ford, conformado por: Tomás Gonzales; Andrés Morelli; Alex Petersen; y Martin Vaamonde.

Planeamos hacer un luxómetro, con el que mediremos la intensidad de lux.

Para llevar a cabo este proyecto utilizaremos un Arduino UNO, el cual detectara los cambios en la luz a la cual estará sometida una fotorresistencia. A partir de esto, realizaremos una escala para medir la intensidad de luz en un área determinada.


We are group number one from sixth year of la ford, which is conformed by Tomás Gonzalez, Andrés Morelli, Alex Petersen, and Martín Vaamonde.

The idea of this project is to build a luxmeter, which we will use to measure luminous intensity.

In order to do this, we will use an Arduino UNO, which detects variations in an LDR to determine the light levels. Then, we will set an scale to measure light intensity in an specific surface.

Simulación / Simulation

luxómetro - imágen 4.png

El primer paso a realizar es llevar a cabo una simulación del proyecto. Utilizaremos el simulador de Tinkercad para tener una idea precisa de como será el circuito.

The first step is to simulate the project. For this, we will use Tinkercad´s simulator to know how the circuit will be.

Programa De Calibración / Calibration Program

Realizamos el programa en Arduino UNO, el cual utilizaremos para realizar las mediciones necesarias para la calibración del dispositivo.

First we have to program the code for Arduino UNO, which we will use to make the right measurements to calibrate the device.


// C++ code


//


#include <LiquidCrystal.h>






LiquidCrystal lcd(12, 11, 5, 4, 3, 2);




void setup()


{


 pinMode(A1, INPUT);


 Serial.begin(9600);


 lcd.begin(16, 2);




 pinMode(6, OUTPUT);


 pinMode(7, OUTPUT);


 pinMode(8, OUTPUT);


 lcd.setCursor(0,0);


 lcd.print("Luxometro!");


}




void loop()


{




 int medicion = (analogRead(A1));


 Serial.println(medicion);




 if (medicion <= 300) {


  digitalWrite(6, LOW);


  digitalWrite(7, LOW);


  digitalWrite(8, HIGH);


 } else {


  if (medicion > 300 && medicion < 500) {


   digitalWrite(6, LOW);


   digitalWrite(7, HIGH);


   digitalWrite(8, LOW);


  } else {


   digitalWrite(6, HIGH);


   digitalWrite(7, LOW);


   digitalWrite(8, LOW);


  }


 }


 lcd.setCursor(0, 1);


 lcd.print(medicion);


 lcd.print("    ");


}

Ensamblaje / Assembly

lux&oacute;metro - im&aacute;gen 5.png

El tercer paso es llevar el circuito a la práctica, ensamblando el mismo. En esta etapa nos topamos con la dificultad de qué los materiales no eran los que precisábamos para el proyecto, por lo que tuvimos que cambiarlos, además de el hecho de encontrar una disposición favorable en el protoboard.

The third step consists of making the circuit and connections. During this stage we had to deal with not having the optimal materials

Probador

lux&oacute;metro - im&aacute;gen 8.jpg
lux&oacute;metro - im&aacute;gen 9.jpg

El cuarto paso es el de armar un dispositivo capaz de emitir una nivel de iluminación homologado por el fabricante, el cual se pueda tomar como referencia para calibrar el luxómetro. En este paso, cabe aclarar que tuvimos que utilizar un cobertor (una caja) que nos permite evitar cualquier perturbación externa, proveniente de otra fuente de luz.

The fourth step is assemble a device capable of emitting an aproved level of illumination by the manufacturer, which it could be taken as a reference to calibrate the luxmeter. In this step, it has to be noted that we had to use a coverlet (a box) to allow us to avoid any external disturbance coming from another source of light.

Zona De Interferencia 0

lux&oacute;metro - im&aacute;gen 10.jpg

Mediante una caja, en la que introducimos el LDR logramos un ambiente propicio para la futura medición y calibración del dispositivo.

Through a box in which we introduce the LDR we achieve a propitious environment for the future measurement and calibration of the device.

Calibración

lux&oacute;metro - im&aacute;gen 12.jpg
lux&oacute;metro - im&aacute;gen 14.png

Debido a la ausencia de una tabla proveniente del fabricante, realizamos una calibración en base a una comparación con los datos obtenidos en un luxómetro y nuestros propios cálculos de equivalencia.

Because of the absence of a table from the manufacturer, we did a calibration based on a comparision with the data obtained in a luxmeter and our own calculations.

Función Obtenida

lux&oacute;metro - im&aacute;gen 16.png
lux&oacute;metro - im&aacute;gen 17.png

Mediante los datos obtenidos durante la calibración, dimos con una función que se asemeja en gran medida con la grafica. Esta función obtenida es una función compuesta de funciones cuadráticas. Esta se expone a continuación:

Though the data obtained during the calibration, we came up with a function that closely resembles with the graph. This function is compound of quadratic functions. This is shown below:


0<100; f(x)= 0.0027x^2 + 0.7605x - 3.2333 (99.76%)

100<200; f(x)= 0.0018x^2 + 1.923x - 108.27 (99.75%)

200<300; f(x)= 0.0133x^2 - 2.7103x + 292.89 (99.72%

300<400; f(x)= 0.0247x^2 - 12.001x + 2049.5 (99.69%)

400<500; f(x)= - 0.0025x^2 + 37.4x - 9886 (99.53%)

Programa Final

// C++ code

//

int Lux;

float potencia;

float potencia1;

#include <LiquidCrystal.h>



LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


void setup()

{

 pinMode(A1, INPUT);

 Serial.begin(9600);

 lcd.begin(16, 2);


 pinMode(6, OUTPUT);

 pinMode(7, OUTPUT);

 pinMode(8, OUTPUT);

 lcd.setCursor(6, 0);

 lcd.print("SEGA");

 delay(1500);

 lcd.setCursor(0, 0);

 lcd.print("Luxometro!   ");

}


void loop()

{


 int medicion = (analogRead(A1));

 Serial.println(medicion);


 if (medicion <= 300) {

  digitalWrite(6, LOW);

  digitalWrite(7, LOW);

  digitalWrite(8, HIGH);

 } else {

  if (medicion > 300 && medicion < 500) {

   digitalWrite(6, LOW);

   digitalWrite(7, HIGH);

   digitalWrite(8, LOW);

  } else {

   digitalWrite(6, HIGH);

   digitalWrite(7, LOW);

   digitalWrite(8, LOW);

  }

 }

 if ((medicion) < 100) { //función de 0 a 100: 0,0027x^2 + 0,7605x - 3,2333

  potencia1 = pow((medicion), 2);

  Lux = 0.0027 * (potencia1) + 0.7605 * (medicion) - 3.2333;

  lcd.setCursor(0, 1);

  lcd.print(Lux);

  lcd.print("      ");

 } else {

  if (medicion < 200) { //función de 100 a 200: 0,0018x^2 + 1,923x - 108,27

   potencia = pow((medicion), 2);

   Lux = (0.0018 * (potencia) + 1.923 * (medicion) - 108.27);

   lcd.setCursor(0, 1);

   lcd.print(Lux);

   lcd.print("      ");

  } else {

   if (medicion < 300) { //funcion de 200 a 300: 0,0133x^2 - 2,7103x + 292,89

    potencia = pow((medicion), 2);

    Lux = (0.0133 * (potencia) - 2.7103 * (medicion) + 292.89);

    lcd.setCursor(0, 1);

    lcd.print(Lux);

    lcd.print("      ");

   } else {

    if (medicion < 400) { //funcion de 300 a 400: y = 0,0247x^2 - 12,001x + 2049,5

     potencia = pow((medicion), 2);

     Lux = (0.0247 * (potencia) - 12.001 * (medicion) + 2049.5);

     lcd.setCursor(0, 1);

     lcd.print(Lux);

     lcd.print("      ");

    } else {

     if (medicion < 500) {

      potencia = pow((medicion), 2);//función de 400 en adelante: -0,025x^2 + 37,4x - 9886

      Lux = (-0.025 * (potencia) + 37.4 * (medicion) - 9866);

      lcd.setCursor(0, 1);

      lcd.print(Lux);

      lcd.print("      ");

     } else {

      lcd.setCursor(0, 1);

      lcd.print("fuera de rango");

     }

    }

   }

  }

 }

}

Prototipo Digital

Prototipo.png

Realizamos un prototipo del dispositivo final que contendrá el circuito junto con el Arduino.

We made a prototype with the final device that will contain the circuit together with the Arduino.

Construcción

lux&oacute;metro - im&aacute;gen 19.jpg

Comenzamos con la construcción del dispositivo final para lo cual utilizamos una plaqueta perforada tal como se ve en la imagen.

We start with the contruction of the final device for which we use a perforated plate as seen in the image.

Prueba Piloto

lux&oacute;metro - im&aacute;gen 20.jpg

Finalizamos el ensamblaje del dispositivo final. Como se puede observar en la fotografía, el dispositivo nos muestra en el display el valor de la intensidad lumínica, tal como era esperado, por lo cual, decimos que el dispositivo es funcional.

We finish the assembly of the final device. As seen in the phoograph, the device show us the light intensity on the display, as expected, therefore we say that the device is functional.


Fin Del Proyecto/end of the Project

jkhcewfjk.jpg
kwelal.jpg

Finalizamos el ensamblaje

we finished the assembly