Report Major Project R
Report Major Project R
Report Of Internship
(8th Semester)
Submitted By:-
Name:- Rishabh Kumar Singh
Regd No:- 20010733
ABSTRACT
This project presents the design and implementation of an embedded system for
real-time temperature monitoring using an STM32 microcontroller. The system
interfaces a temperature sensor with the microcontroller via the I2C bus,
enabling precise and efficient temperature data acquisition. The microcontroller
processes the raw sensor data, converts it into a human-readable format, and
transmits this data over UART for external logging or monitoring. Additionally,
the real-time temperature readings are displayed on an LCD screen, providing
an immediate visual representation. This integration highlights the capability of
the STM32 microcontroller to manage multiple communication protocols and
output interfaces concurrently, making it a robust solution for temperature
monitoring applications.
This is to certify that the Internship Project report entitled Digital thermometer
using STM32 submitted in partial fulfilment of the requirement for the award of
Bachelor of Technology in EEE of the C. V. Raman Global University, Odisha
during the year 2020-2024, is a faithful record of the bonafide work carried out
by Rishabh Kumar Singh (20010733) under my guidance and supervision.
BICARD
Embedded System Design Training Institue,Pune
ACKNOWLEDGEMENT
Thanking you
Rishabh Kumar Singh(20010733)
INDEX
INTRODUCTION TO STM32
The STM32 family of micro-controllers, based upon the ARM CortexM3 core,
provides a foundation for building a vast range of embedded systems from
simple battery-powered dongles to complex real-time systems such as
helicopter autopilots. This component family includes 0es dozens of distinct
configurations providing wide-ranging choices in memory sizes, available
peripherals, performance, and power. The components are sufficiently
inexpensive in small quantities – a few dollars for the least complex devices – to
justify their use for most low-volume applications. Indeed, the low-end “Value
Line” components are comparable in cost to the ATmega parts which are used
for the popular Arduino development boards yet offer significantly greater
performance and more powerful peripherals. Furthermore, the peripherals used
are shared across many family members (for example, the USART modules are
common to all STM32 F1 components) and are supported by a single firmware
library. Thus, learning how to program one member of the STM32 F1 family
enables programming them all.
Unfortunately, power and flexibility are achieved at a cost – software
development for the STM32 family can be extremely challenging for the
uninitiated with a vast array of documentation and software libraries to wade
through. For example, RM0041, the reference manual for large value-line
STM32 F1 devices, is 675 pages and does not even cover the Cortex-M3
processor core! Fortunately, it is not necessary to read this book to get started
with developing software for the STM32, although it is an important reference.
In addition, a beginner is faced with many tool-chain choices.
In contrast, the Arduino platform offers a simple application library and a
single tool chain which is accessible to relatively inexperienced programmers.
For many simple systems, this offers a quick path to prototype. However,
simplicity has its own costs – the Arduino software platform isn’t well suited to
managing concurrent activities in a complex real-time system and, for software
interacting with external devices, is dependent upon libraries developed outside
the Arduino programming model using tools and techniques similar to those
required for the STM32.
Furthermore, the Arduino platform doesn’t provide debugging capability which
severely limits the development of more complex systems. Again, debugging
requires breaking outside the confines of the Arduino platform. Finally, the
Arduino environment does not support a real-time operating system (RTOS),
which is essential when building more complex embedded systems. For readers
with prior ’C’ programming experience, the STM32 family is a far better
The development software used in this book is all open-source. Our primary
resource is the GNU software development toolchain including gcc, gas,
objcopy, objdump, and the debugger gdb. I do not use an IDE such as Eclipse. I
find that most IDEs have a high startup cost although they can ultimately
streamline the development process for large systems. IDEs also obscure the
compilation process in a manner that makes it difficult to determine what is
really happening, when my objective here is to lay bare the development
process. While the reader is welcome to use an IDE, I offer no guidance on
setting one up. One should not assume that open-source means lower quality –
many commercial tool chains for embedded systems utilize GNU software and
a significant fraction of commercial software development is accomplished with
GNU software.
STM32 ARCHITECTURE
Department of Electrical Engineering
8|Page
TIMERS
STM32 microcontrollers feature a rich set of timers, each designed to support
different functions required in embedded applications. These timers can handle
time-related tasks like generating precise time delays, measuring time intervals,
PWM signal generation, and more. Here is a detailed explanation of the timers
in STM32 microcontrollers.
1. Types of Timers
Input Capture-This mode captures the value of the counter when an external
event occurs on a timer input pin. It is useful for measuring the frequency or
pulse width of an external signal.
Output Compare:-In this mode, the timer compares the counter value to a
predefined value and can generate an output signal when they match. It is used
for generating precise time delays.
PWM (Pulse Width Modulation):-PWM mode generates a periodic signal with a
variable duty cycle. This is widely used for controlling motors, LEDs, and other
actuators.
4 . Advanced Features
Dead-Time Insertion: Used in motor control applications to prevent short
circuits by inserting a delay between complementary outputs.
I2C
METHODOLOGY OF PROJECT
LM35
SENSOR
I2C
STM MICROCONTROLLER
UART
LCD
This project interfaces a temperature sensor with an STM32 microcontroller via
the I2C bus, transmits real-time temperature data over UART, and displays the
temperature readings on an LCD screen. The block diagram outlines the
essential components and their interactions.
Temperature Sensor (I2C Interface): Measures the ambient temperature.
Interface: I2C bus.
Operation: The sensor periodically sends temperature data to the STM32
microcontroller through the I2C bus. The sensor operates as a slave device on
the I2C bus, and the microcontroller operates as the master, requesting data as
needed.
STM32 Microcontroller
Core Functions:
I2C Communication: Receives temperature data from the sensor.
Data Processing: Interprets the raw data from the sensor.
UART Communication: Transmits the processed temperature data.
LCD Control: Sends the temperature data to the LCD for display.
Modules Used:
I2C Peripheral: To communicate with the temperature sensor.
UART Peripheral: To send data to a computer or other devices.
GPIO/Display Driver: To interface with the LCD screen.
Operation: The microcontroller acts as the central unit, managing data flow
from the sensor to the display and the UART interface.
UART Communication
Function: Transmits temperature data from the STM32 microcontroller to an
external device such as a PC or another microcontroller.
Operation: The STM32 sends the temperature data over UART. This could be
used for logging, debugging, or further processing on a PC.
Components:
UART Peripheral on STM32: Configured for data transmission.
PC/Receiver: Displays or logs the received data.
LCD Display:-Function: Displays the real-time temperature data.
Interface: Connected to the STM32 via GPIO or a specific display interface
(e.g., SPI, I2C, or parallel).
Operation: The microcontroller sends temperature data to the LCD, which
updates its display to show the current temperature.
PROJECT OVERFLOW
1. Initialization
STM32 Initialization: Set up the I2C, UART, and LCD peripherals.
Sensor Initialization: Configure the temperature sensor, if needed, via I2C
commands.
2. Data Acquisition
I2C Communication: The STM32 microcontroller periodically requests
temperature data from the sensor using the I2C protocol.
Data Reception: The sensor sends the temperature data back to the
STM32.
3. Data Processing
Raw Data Handling: The STM32 processes the raw data received from
the sensor, converting it into a readable temperature format (e.g., Celsius
or Fahrenheit).
4. Data Transmission
UART Communication: The STM32 sends the processed temperature
data to an external device via UART for logging or monitoring.
Data Packet: The data is typically sent in a formatted packet, which might
include a header, the temperature data, and a checksum.
PROJECT SIMULATION
PROJECT CODE
CONCLUSION
Engaging in this project provided me with hands-on experience with STM32
microcontrollers, as well as practical knowledge of I2C and UART
communication protocols and LCD interfacing. This immersive experience
allowed me to work directly with these technologies, enhancing my technical
proficiency and understanding of how they operate in real-world applications.
REFERNCES