Skip to content

francesvr/Temperature-Monitoring-System-Using-LabJack

Repository files navigation

Temperature Monitoring System Using LabJack

This PCB has a temperature sensor to monitor the temperature and an LED and buzzer to alert the user when the temperature is below or above the set threshold. The LED is off while the temperature is below the threshold and the buzzer will activate when it is above the threshold. The PWM is set up in the beginning of the code with setting FIO4 as the channel to send the PWM signal to, with divisor as 48MHz/DIV, with divisor of 47, 1 as number of time enabled, and 8-bit timer mode. The program starts off with LED off by DAC0 sending a high signal. Then, the user is asked for the temperature threshold in degrees Celsius. Then, they are asked to choose between two exit strategies; how long they want the program to run for (in seconds) or how many buzzer activations before the program ends. The temperature sensor, which is connected to AIN0, will read the voltage output and multiply it by a 100 to convert to degrees Celsius and continuously compare it with the threshold set by the user to decide whether to activate the LED or the buzzer. If the user chooses to run the program based on the time they provide, and if the temperature is below the threshold, the DAC0 channel which is connected to the LED will send a low signal for the LED to remain on and the program constantly prints the current temperature. If the temperature is above the threshold, the timer value is set to 50% duty cycle to turn the buzzer on and DAC0 will send a high signal to turn the LED off. The program will constantly print that the temperature is high and the current temperature. When the time is done, the program waits for user input to continue terminating the program. In addition, if the user chooses to end the program after a certain amount of buzzer activation, again, the program will constantly print the current temperature and turn the LED on if the temperature is below the threshold. If the temperature is above the threshold, the timer value will be set to 50% duty cycle to turn the buzzer on. The program will stop printing the current temperature and lets the user know how many times the buzzer has been activated, compared to the number of buzzer activations they specified. The buzzer will turn off and the program will continue printing the current temperature again and turns the LED on again. This loop will go on until the number of buzzer activations the user specified has been reached. The user also has the option to exit the program in the beginning of the program if they choose not to continue. Before the program ends, the LED and buzzer turn off and all pins will reset.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Languages