Professional Documents
Culture Documents
(Signature of student)
(Name of Student)
(University Roll No.)
Date:
____________________
2
Certified that the above
statement made by the
student is correct to the
best of our
knowledge and belief
Examined by:
(Signature)
Name of Faculty Facilitator
(Signature)
Head of Departme
CANDIDATE'S DECLARATION
I, Sagar Garg hereby declare that I have undertaken 6 weeks of Industrial Training at
Hexnbit Edtech Private Limited during a period from August to September in partial
fulfilment of requirements for the award of degree of B. Tech (Electronics and
Communication Engineering) at Bharati Vidyapeeth's College of Engineering, Delhi.
3
The work which is being presented in the training report submitted to Department of
Electronics and Communication Engineering at Bharati Vidyapeeth's College of
Engineering, Delhi is an authentic record of training work.
________________ ____________________
______________________
Signature of HOD Signature of the Trainer Signature of the Student
ACKNOWLEDGEMENT
First, I would like to thank the Director of Hexnbit Edtech Private Limited for giving
me the opportunity to do my industrial training within the organization.
I also would like all the people that worked along with me in Hexnbit Edtech Private
Limited with their patience and openness they created an enjoyable working
environment.
4
It is indeed with a great sense of pleasure and immense sense of gratitude that I
acknowledge the help of these individuals.
I am highly indebted to founder Mr. Abhishek Gupta who guided me and my mentor
Mr. Satish for the facilities provided to accomplish this training.
I would like to thank my college and Head of the Department Prof. Kirti Gupta for
giving me this wonderful opportunity to do a training program in the first place.
5
CONTENTS
1 ABSTRACT 4
2 LEARNING OBJECTIVES 5
6 TECHNICAL DETAILS 15
8 PROJECT IMPLEMENTATION 19
9 SOURCE CODE 20
10 DATA SHEETS 28
11 CONCLUSION 30
12 REFERENCES 30
ABSTRACT
6
Embedded Software industry is the system of controlling numerous gadgets and
machines which might be specific from conventional computers, the usage of
software program engineering. Integrating software program engineering with non-
laptop gadgets results in the formation of embedded structures. Embedded structures
are normally famous in clinical science, client electronics, production science,
aviation, automobile technology. A traditional embedded gadget calls for a huge
variety of programming tools, microprocessors and working structures. Embedded
software program engineering, accomplished through embedded software program
engineers, desires to be tailor-made to the desires of the hardware that it has to
manipulate and run on.
Organization Information
Hexnbit is an Ed-tech company founded in year 2020 which provides one-stop
solutions for the students & working professionals in Industry-connect Skill
development courses. The platform not only provides subject expertise to the
candidates but also, give them industry exposure to apply their learnings analytically
in a practical real-world.
Hex N Bit creates a bridge between Industry & Academia with its unique delivery
model involving Academicians, Faculty, Mentors, Industry & Students together on a
single platform. One of HexnBit’s biggest strengths is strong R&D and the process
which guide students in firming up their plans. Each student/professional can interact
with other peers, seniors/mentors and even universities/companies in order to make
the best decision for their career.
7
LEARNING OBJECTIVES IN TRAINING
8
WEEKLY OVERVIEW OF INTERNSHIP ACTIVITIES
WEEK 1: -
* Basics Of C language
* Functions in C
* Pre-processors in C
WEEK 2: -
* Overview of ST Microelectronics
9
Getting familiar with Target Hardware & Software Tools
WEEK 3: -
General Purpose Input / Output (GPIO)
10
WEEK 4: -
11
Inter-Integrated Circuits (I2C or I Square C)
* Working with I2C to integrate slave device and read and write data
WEEK 5: -
Timers in STM32F4
12
* Generating Alarm event for time management activities
WEEK 6: -
Internet of Things (IoT)
* Integrating IoT platform to host the sensors data over the web
13
INTRODUCTION TO EMBEDDED SYSTEMS
It sets the rules during application program execution. A small embedded system may
not have an RTOS. Therefore, we can define an embedded system as a real-time,
reliable, software-driven control system based on a microcontroller.
14
perform fast enough to process data in real time and consume minimum power
to extend battery life.
Reactive and Real time − Many embedded systems must continually react to
changes in the system's environment and must compute certain results in real
time without any delay. Consider an example of a car cruise controller; it
continually monitors and reacts to speed and brake sensors. It must compute
acceleration or de-accelerations repeatedly within a limited time; a delayed
computation can result in failure to control of the car.
Advantages
Easily Customizable
Low power consumption
Low cost
Enhanced performance
Disadvantages
High development effort
Larger time to market
15
Basic Structure of an Embedded System
Processor & ASICs − Processors process the data to measure the output and
store it to the memory.
The Internet of Things (IoT) describes the network of physical objects— “things”—
that are embedded with sensors, software, and other technologies for the purpose of
connecting and exchanging data with other devices and systems over the internet.
Over the past few years, IoT has become one of the most important technologies of
the 21st century. Now that we can connect everyday objects—kitchen appliances,
cars, thermostats, baby monitors—to the internet via embedded devices, seamless
communication is possible between people, processes, and things.
By means of low-cost computing, the cloud, big data, analytics, and mobile
technologies, physical things can share and collect data with minimal human
intervention. In this hyperconnected world, digital systems can record, monitor, and
16
adjust each interaction between connected things. The physical world meets the
digital world—and they cooperate.
APPLICATIONS
Embedded systems in IoT are used in home automation, health and wellness, and
security, among others. Likewise, an embedded system in IoT is used in remote
sensing and control for water, gas, utility meters, shipping/transportation
management, robotics integration, and so on. Any IoT device will have an embedded
system. IoT is nothing but connecting and controlling smart devices (read as
embedded systems coupled with network connectivity) through Internet protocols.
There are many things with embedded systems incorporated in the Internet of Things
(IoT), as well as in machine to machine (M2M) devices. Exceptionally versatile and
17
adaptable, embedded systems can be found in all smart devices today. It is difficult to
find a single portion of modern life that doesn’t involve this technology.
TECHNICAL DETAILS
UART/USART
ADVANTAGES
Only uses two wires
No clock signal is necessary
Has a parity bit to allow for error checking
The structure of the data packet can be changed as long as both sides are set up
for it
Well documented and widely used method
DISADVANTAGES
The size of the data frame is limited to a maximum of 9 bits
Doesn’t support multiple slave or multiple master systems
The baud rates of each UART must be within 10% of each other
18
I2C Protocol
Inter-Integrated Circuits protocol (I2C) protocol allows embedded engineers to
connect multiple slave devices with one or more master. It is intended primarily for
short-distance communication within two ICs (Integrated Circuits) on the same
printed circuit board (PCB). It requires only two bi-directional wires for transmitting
and receiving data bits. In terms of data rates, the I2C protocol supports speed up to
3.4 Mbps - which is pretty fast.
Here are some of the important advantages of using the I2C protocol:
Direct memory access (DMA) is used in order to provide high-speed data transfer
between peripherals and memory as well as memory to memory. Data can be quickly
moved by DMA without any CPU actions. This keeps CPU resources free for other
operations.
19
INTERRUPTS
Interrupts are the events that temporarily suspend the main program, pass the control
to the external sources and execute their task. It then passes the control to the main
program where it had left off.
In STM32 there are a lot of different types of interrupts. Interrupts on STM32 MCUs
come in two variants: internal and external. Both types of interrupts use the same core
peripheral in the Cortex-M core: the Nested Vectored Interrupt Controller, or NVIC.
Depending on the exact Cortex-M core, this peripheral can support hundreds of
interrupts, with multiple priority levels. Lower the pre-emption priority the higher the
priority of the task will be.
20
The STM32 Nucleo-64 board provides an affordable and flexible way for users to try
out new concepts and build prototypes by choosing from the various combinations of
performance and power consumption features, provided by the STM32
microcontroller.
The ARDUINO Uno connectivity support and the ST morpho headers allowed easy
expansion of the functionality of the STM32 NUCLEO open development platform
with a wide choice of specialized shields.
The STM32 Nucleo-64 board does not require any separate probe as it integrates the
ST-LINK debugger/programmer.
The STM32 Nucleo-64 board comes with the STM32 comprehensive free software
libraries and examples available with the STM32Cube MCU Package.
NUCLEO-F401RE
Other Components:
Apart from the NUCLEO board we also utilized other components such as WIFI-
module to connect to the server, breadboard for making connections and jumpers
wires.
We also used many other sensors such as temperature sensor, Bluetooth module etc
while learning the basic features such as ADC, DMA, interrupts on the board.
21
REQUIREMENTS
Software Requirements:
Hardware Requirements:
1. NUCLEO-F401RE
2. ESP-01 WIFI Module
3. DS1621 Temperature Sensor IC
4. Breadboard
5. Jumper Cables
PROJECT IMPLEMENTATION
1. A code was written in STM32 Cube IDE in which DS1621 was integrated
with F401RE using I2C protocol.
3. After that we can monitor the temperature of a point being anywhere in the
world as it is uploaded onto the server.
22
Pin Configuration
SOURCE CODE
***********************************************************************
*******
* @file : main.c
* @brief : Main program body
***********************************************************************
*******
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause
license,
* the "License"; You may not use this file except in compliance with
the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
***********************************************************************
*******
*/
/* USER CODE END Header */
/* Includes
------------------------------------------------------------------*/
#include "main.h"
23
/* Private includes
----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "string.h"
/* USER CODE END Includes */
/* Private typedef
-----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
/* Private define
------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro
-------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* Private variables
---------------------------------------------------------*/
ADC_HandleTypeDef hadc1;
UART_HandleTypeDef huart1;
char Response[50];
float nosteps,stepsize=3.3/4096,voltage,temp;
24
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* MCU
Configuration--------------------------------------------------------*/
HAL_ADC_Start(&hadc1);
// command to connect the nearest access point using SSID & Password
HAL_UART_Transmit(&huart1, (uint8_t
*)"AT+CWJAP=\"Mystery\",\"qwerty@123\"\r\n",
sizeof("AT+CWJAP=\"Mystery\",\"qwerty@123\"\r\n"), 200);
25
HAL_UART_Receive(&huart1, (uint8_t *)Response,sizeof(Response),
1000);
//clr_array();
HAL_Delay(1000);
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
HAL_ADC_PollForConversion(&hadc1,300);
nosteps = HAL_ADC_GetValue(&hadc1);
temp=(((nosteps*stepsize)-0.76)/0.025)+25;
for (int i=0; i<49; i++)
Response[i] = temp;
strlen("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",80\r\n"), 1000);
HAL_UART_Receive(&huart1, (uint8_t
*)Response,sizeof(Response), 1000);
clr_array();
HAL_Delay(1500);
26
HAL_UART_Receive(&huart1, (uint8_t
*)Response,sizeof(Response), 1000);
HAL_Delay(1500);
clr_array();
/**
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) !=
HAL_OK)
{
27
Error_Handler();
}
}
/**
* @brief ADC1 Initialization Function
* @param None
* @retval None
*/
static void MX_ADC1_Init(void)
{
/** Configure the global features of the ADC (Clock, Resolution, Data
Alignment and number of conversion)
*/
hadc1.Instance = ADC1;
hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
hadc1.Init.ScanConvMode = ENABLE;
hadc1.Init.ContinuousConvMode = ENABLE;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.NbrOfConversion = 1;
hadc1.Init.DMAContinuousRequests = DISABLE;
hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV;
if (HAL_ADC_Init(&hadc1) != HAL_OK)
{
Error_Handler();
}
/** Configure for the selected ADC regular channel its corresponding
rank in the sequencer and its sample time.
*/
sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN ADC1_Init 2 */
28
}
/**
* @brief USART1 Initialization Function
* @param None
* @retval None
*/
static void MX_USART1_UART_Init(void)
{
/**
* @brief GPIO Initialization Function
* @param None
* @retval None
*/
static void MX_GPIO_Init(void)
{
/**
* @brief This function is executed in case of error occurrence.
* @retval None
29
*/
void Error_Handler(void)
{
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return
state */
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line
number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and
line number,
tex: printf("Wrong parameters value: file %s on line %d\r\n",
file, line) */
/* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */
OUTPUT
30
DATASHEET FOR F401RE
31
DATASHEET FOR DS1621 IC
32
CONCLUSION
Embedded systems are emerging as a technology with high potential. In the past
decades microprocessor based embedded system ruled the market. The last decade
witnessed the revolution of Microcontroller based embedded systems. With regards to
the requirements gathered the manual work and the complexity in counting can be
achieved with the help of electronic devices.
The project that I did made me learn a lot about 32-bit microcontrollers. The project
has been successfully designed and tested. Integrating features of all the hardware
components used have developed it. Presence of every module has been reasoned out
and placed carefully thus contributing to the best working of the unit. Secondly, using
highly advanced IC’s and with the help of growing technology the project has been
successfully implemented.
Overall, the industrial training was really informative. The content that we got to learn
was of industry standard. The STM32 NUCLEO board that we worked on was really
powerful too. It is widely used in the industry and even has military applications.
REFERENCES
Hexnbit LMS Portal
"STM32 Arm Cortex MCUs - 32-bit Microcontrollers - STMicroelectronics" . www.st.com.
"Cortex-M4". developer.arm.com
"STMicroelectronics Delivers New 32-bit ARM® Cortex™ Microcontrollers for Projects
Needing Digital Signal Control at Competitive Cost". web.archive.org
"STM32F4 - ARM Cortex-M4 High-Performance MCUs -
STMicroelectronics". www.st.com.
33
"ARM and STMicroelectronics Join With Mathworks to Enable Code Generation, Debug
and Modelling For STM32 Microcontrollers"
Gillis, Alexander (2021). "What is internet of things (IoT)?". IOT Agenda.
Brown, Eric (20 September 2016). "21 Open Source Projects for IoT". Linux.com.
34