Materials needed:
-1 Computer with LabVIEW
-1 NI DAQ 6008
-1 Relay
-1 Capacitor (100µF)
-1 Transistor
-1 Diode
-3 Resistors (1 of 10k and 2 of 2700 ohms)
The first thing that we have to do is to do the theoretical calculations. We will calculate theorically how much time does the capacitor takes to be charged and discharged.
First of all, we have this formula, which represents the change of the voltage of the capacitor in function of the time:
Where:
Clearing the first formula, we can get these formula of the loat of the capacitor, and the time that lasts to get a value:
And we also can get this other formulas of discharge of the capacitor:
Then we have to make a circuit like this:
Here, we use the diode to protect the relay, due to the coil of the relay resists to the change of the current inside of it. the transistor is to control the relay. The relay is disconnected on the beginning and the capacitor is being discharged through R2 and when it's activated, it's being charged at 5V. We control it's activation with the DAQ, introducing a signal of 5V through R3 and we measure the voltage of the capacitor with an analogic pin of the DAQ.
Then the program would be something like this. On the left we can see two waveform graphs. the first one has represented on it the theoretical change of voltage of the capacitor and the second one, the measured value. Moreover, you can change the voltage introduced, the resistor and the capacitor. We also have a LED which says if the relay is activated and the time elapsed since the beginning of the program.
On the right side of the program, we have a part where we introduce a value of voltage or time elapsed and we got the time where it reaches that voltage or the voltage that it has at any time. We also have the explanation of the program.
On the block diagram we have this. On the left part, we initialize the pins of the DAQ, if it will be input or output. Then, we go into the while, where we read the value of the capacitor during 8 seconds (4 of charge and 4 of discharge).
In this other part of the block diagram, we draw the theoretical values in the theoretical waveform chart.
In this last part of the program, we calculate the value of the time or voltage in function of the voltage or time, using a formula node, and we print the result on the screen.
You can download the program from this page:
https://drive.google.com/folderview?id=0B20kHfrc3NnpOWxidEFja09MRXc&usp=sharing
No hay comentarios:
Publicar un comentario