ICOMP-UNC / Pepsicity

Advance conveyor belt system.
MIT License
0 stars 0 forks source link

Implement Systick, ADC module and Temperature sensor #2

Closed FabioGazzoni closed 1 week ago

FabioGazzoni commented 2 weeks ago

Implementation of the LM35 Temperature Sensor with LPC1769

This project involves a temperature monitoring system using the LM35 sensor, connected to the LPC1769 development board. The primary goal is to obtain periodic temperature readings and convert them into digital values for processing and analysis. This is achieved using the microcontroller's interrupt functionality and the ADC (Analog-to-Digital Converter) module.

image

How It Works

The LM35 temperature sensor provides an analog signal that varies with ambient temperature. To ensure precise and periodic measurements, the Systick module of the LPC1769 microcontroller is used to generate interrupts at regular intervals. The complete process is as follows:

  1. Time Counter with Systick:

    • The Systick register is configured to count 10 milliseconds (ms).
    • Each time the counter reaches its maximum value, an overflow occurs, generating an interrupt.
    • This interrupt initiates the temperature reading from the sensor.
  2. Reading the LM35 Sensor:

    • Upon Systick overflow, the ADC module is activated to convert the analog signal from the LM35 sensor into a digital value.
    • This digital value corresponds to the temperature on a voltage scale, ready for processing and decision-making.
  3. Conversion and Storage:

    • Once the analog-to-digital conversion begins, the ADC samples the signal.
    • After the conversion is complete, a specific ADC interrupt stores the resulting digital value in a variable for later analysis.

System Purpose

The main objective of this system is to monitor the temperature of the environment to ensure it stays within a safe range. This helps prevent risks associated with overheating, such as equipment damage or fires. If the temperature exceeds safety thresholds, the system can activate protective mechanisms, such as stopping the machine or enabling cooling systems.

Process Flow:

  1. Systick Interrupt (every 10ms):
    • Triggers the temperature reading process.
  2. LM35 Sensor Reading:
    • Measures temperature in analog format.
  3. ADC Conversion:
    • The ADC module converts the analog signal to a digital value.
  4. ADC Interrupt:
    • Upon completion, the digital temperature value is stored for analysis.

Benefits of the Implementation