0% found this document useful (0 votes)
12 views46 pages

Final Year Internship Report Kaif

This document is an internship report submitted by Mohammed Kaif Jahagirdar for the completion of a Bachelor Degree in Electrical & Electronics Engineering at Visvesvaraya Technological University. It focuses on Embedded C Programming, detailing the fundamentals, architecture, and applications of embedded systems, particularly the PIC microcontroller and Arduino UNO. The report includes a comparative study of these technologies, their practical use cases, and the tasks performed during the internship at Triox Technologies Pvt. Ltd.

Uploaded by

adilkhan87623
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views46 pages

Final Year Internship Report Kaif

This document is an internship report submitted by Mohammed Kaif Jahagirdar for the completion of a Bachelor Degree in Electrical & Electronics Engineering at Visvesvaraya Technological University. It focuses on Embedded C Programming, detailing the fundamentals, architecture, and applications of embedded systems, particularly the PIC microcontroller and Arduino UNO. The report includes a comparative study of these technologies, their practical use cases, and the tasks performed during the internship at Triox Technologies Pvt. Ltd.

Uploaded by

adilkhan87623
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 46

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“Jnana Sangama”, Belagavi, Karnataka – 590018

An Internship Report on

“EMBEDDED C PROGRAMMING”

Submitted in the partial fulfilment of the requirements for the award of degree of
BACHELOR DEGREE
IN
ELECTRICAL & ELECTRONICS ENGINEERING
Submitted by
Mr. MOHAMMED KAIF JAHAGIRDAR

2BL21EE032

Internal Guide External Guide


Mr. V. L.Jiddi Mr. Prashant Venkataraman
Technical Engineer
Assistant Professor, Dept. of EEE Triox Engineering Solutions
Chennai

B.L.D.E.A’s
V. P. Dr. P. G. Halakatti College of Engineering & Technology,
Vijayapur, Karnataka – 586103
Academic Year 2024-25
B.L.D.E.A’s
V. P. Dr. P. G. Halakatti College of Engineering & Technology,
Vijayapur, Karnataka – 586103

DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

CERTIFICATE
This is to Certify that MOHAMMED KAIF JAHAGIRDAR is a Bonafide

student of V. P. Dr. P. G. Halakatti College of Engineering & Technology has

completed the Internship on “EMBEDDED C PROGRAMMING” in the fulfilment

of course “Internship” of Bachelor Degree in Electrical & Electronics

Engineering of the Visvesvaraya Technological University, Belagavi during


the Academic year 2024 – 2025. The Internship report has been approved as it satisfies the
academic requirements in respect of Internship Work prescribed for the said degree.

INTERNAL GUIDE HOD PRINCIPAL


Mr. V. L. JIDDI Dr. A. S. JADHAV Dr. V. G. SANGAM
Asst. Prof. Dept. of EEE Dept. of EEE BLDEACET

External Viva

Name of the examiners Signature with date

1.

2.
B.L.D.E.A’s
V. P. Dr. P. G. Halakatti College of Engineering & Technology,
Vijayapur, Karnataka – 586103

DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

DECLARATION
I, MOHAMMED KAIF JAHAGIRDAR student of final year B.E.

Electrical and Electronics Engineering at V. P. Dr. P. G. Halakatti College of


Engineering & Technology, Vijayapur hereby declare that the Internship titled
“EMBEDDED C PROGRAMMING” has been carried out and submitted in the
fulfilment of course “Internship” of Bachelor of Engineering in Electrical &

Electronics of Visvesvaraya Technological University, Belagavi during the


academic year 2024 - 2025. I also declare that I have not submitted this Internship report to
any other university for the award of the degree.

NAME USN SIGN

Mr. MOHAMMED KAIF JAHAGIRDAR 2BL21EE032

i
INTERNSHIP CERTIFICATE

ii
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of
any task would be incomplete without the mention of the people who made it possible
and whose constant encouragement and guidance crowned my efforts with success.
I express our sincere thanks to our beloved Principal, Dr. V. G. SANGAM for
extending his continuous support and providing academic environment. We wish to thank
our Head of the Department Dr. A. S. JADHAV for encouragement and support.
I wish to thank our guide Prof. V. L. JIDDI for their encouragement and support
without which we could not have moved a single step ahead in the path of our work.
Hence, we convey my deepest thanks for guiding and correcting various documents of us
with attention and care.
I am proud to be part of B.L.D.E.A’s CET family, the institution which stood
behind this successful completion of Internship. We owe many thanks to a great many
people who helped and supported me for the completion of this report.
I extend special thanks to Beloved Parents and Dear Friends for their
continuous encouragement, motivation, and blessings without which we would not have
reached this stage. Lastly, I would like to thank all those people who have directly or
indirectly supported us in carrying out this Internship work.

iii
ABSTRACT
This report explores the fundamentals, architecture, and applications of EMBEDDED
C, with a particular focus on the PIC microcontroller and the Arduino UNO development
board. EMBEDDED C are specialized computing units designed to perform specific tasks
with high reliability and efficiency. They form the backbone of modern automation and
control systems, playing a critical role in sectors like industrial automation, home automation,
healthcare, and consumer electronics.

The PIC microcontroller, developed by Microchip Technology, is widely used for


real-time control applications due to its robustness, low power consumption, and wide range
of built-in peripherals. On the other hand, the Arduino UNO, based on the ATmega328P
microcontroller, is known for its open-source nature, ease of programming, and extensive
community support, making it ideal for prototyping and educational purposes.

This report presents a comparative study of these technologies, examining their


architecture, features, advantages, and practical use cases. The combination of theoretical
analysis and application-driven discussion provides a comprehensive understanding of how
these tools contribute to the growing field of embedded system design and development.

iv
TABLE OF CONTENTS

CONTENTS PAGE NO.

Declaration …………………………………………………………………………....i

Internship Certificate………………………………………………………………...ii

Acknowledgement……………………………………………………………………iii

Abstract……………………………………………………………………………….iv

CHAPTER 1: ABOUT THE COMPANY ……………….………………………... 1

CHAPTER 2: ABOUT THE COURSE….……………………………………….... 2

2.1 Microcontroller and its types…………………………………………… 3

2.2 8051 Microcontrollers…………………………………………………… 4

2.3 PIC Microcontroller…………………………………………………….. 6

2.4 Basic Components of Embedded C…………………………………….. 7

2.4.1 Resistors…………………………………………………………………7

2.4.2 Capacitor………………………………………………………………..8

CHAPTER 3: TASK PERFORMED……………………...……..……………….....11

3.1 Embedded System…………………..………………….………………...11

3.1.1. PIC Microcontroller…………………………………………………...11

3.1.2. Arduino UNO ……………………………………………………….…11

3.2 Analog Circuits……………………………...…………………….……...12

3.2.1 Power Regulator Supply…………..……………………………………12

v
3.2.2 Using LDR Glow The LED…………….……..………………….….…13

3.2.3 Using Thermister LDR Glow…………….………………………….…15

3.2.4 Using Op-Amp (Lm358) And LDR Tune


Voltage From 0 To 5v Using Not Gate (7404)…………………………....….16

3.3 Digital Circuits………………………………………………………….…19

3.3.1 Basic Circuit Diagram Of IR Sensor…………………………………..19

3.3.2 Relay Switching…………………………………………………………21

3.3.3 Switching Using Drivers…………………………………………….…..22

3.3.4 Smart Medicine Remainder System………..………………………….….23

3.4 Work Carried Out…………………………………………………….…..24

CHAPTER 4: REFLECTION NOTES………..……………………………….…....28

4.1 Analog Circuits…………………………………………………….……...28

4.1.1 Power Regulator Supply………………………………………..………29

4.1.2 Using LDR Glow The LED…………………………………….…….…29

4.1.3using Thermister LDR Glow……………………………………………29

4.1.4 Using Op-Amp(Lm358) And LDR Tune


Voltage From 0 To 5v Using Not Gate (7404)…….………………………….29

4.2 Digital Circuits……………………………….……………………………30

4.2.1 Basic Circuit Diagram Of IR Sensor…….…………………………….30

4.2.2 Relay Switching…………………………………………………………30

4.2.3 Switching Using Drivers………………………………………………..31

4.2.4 Smart Medicine Remainder System………...…………………………32

vi
4.3 Work Carried Out………………………………………………………...32

CHAPTER 5: CONCLUSION……….…………...…………………………….…...34

References…………………………………………………………………………….35

vii
TABLE OF FIGURES
FIGURE PAGE NO

Fig 1: Triox Technology…………………………………………...................... 1

Fig 2.1: Block diagram of EMBEDDED C………………………................... 2

Fig 2.2: 8051 microcontroller peripherals......................................................... 4

Fig 2.3: PIC microcontroller peripherals.......................................................... 6

Fig 2.4: Resistor Colour Code............................................................................ 8

Fig 2.5: Ceramic Capacitor................................................................................ 9

Fig 2.6: Electrolytic Capacitor........................................................................... 9

Fig 2.7: Transistor............................................................................................... 9

Fig 2.8: Voltage Regulator.................................................................................. 10

Fig 2.9: Diode...................................................................................................... 10

Fig 3.4: Block Diagram………………………………………………………...25

Fig 4.1: Power Regulator Supply...................................................................... 29

Fig 4.1a: Bridge Rectifier Circuits.................................................................... 29

Fig 4.2: LDR Circuit.......................................................................................... 30

Fig 4.3: Thermistor Circuit............................................................................... 30

Fig 4.4: Voltage Tuning Using Op-Amp and NOT Gate................................. 30

Fig 3.3.1: IR Sensor Circuit............................................................................... 31

Fig 4.2.2: 12V Relay Switching Circuit............................................................ 31

Fig 4.2.3a: Turning on LED using Drivers Circuit......................................... 32

Fig 4.2.3b: Driving Motor and LED................................................................ 32

Fig 4.2.4: Traffic Light Switching Using Arduino UNO................................ 33

Fig 4.3: Work Carried Out Simulation........................................................... 33

viii
Embedded C Programming 2024 – 2025

CHAPTER 1

ABOUT THE COMPANY

Triox Technologies Pvt. Ltd., founded in 2015 and based in Chennai, is a growing
technology company driven by a vision to bridge real-world problems with practical,
embedded solutions. Triox believes that innovation should emerge not only from high-tech
metros but also serve the deep and diverse layers of India’s population.

Specializing in embedded systems, electronics product development, and software


solutions. Triox is committed to enabling industry ready innovation that meets the
grassroots needs of sectors such as automation, smart devices, and manufacturing.

Fig. 1 Triox Technology

The company aims to provide end-to-end tech development support from circuit design
and firmware development to prototyping and product deployment, making cutting-edge
technology accessible and affordable.

Triox embodies the ethos that entrepreneurship should not be limited by geography,
financial status, or academic pedigree. Their journey represents the broader movement in
India toward building sustainable, scalable, and socially meaningful startups. Triox is
proud to be part of the new wave of Indian startups that are engineering solutions
grounded in local realities but built to scale globally.

Dept. of EEE, BLDEACET, Vijayapur 1


Embedded C Programming 2024 – 2025

CHAPTER 2

ABOUT THE COURSE

It is a control system, combination of hardware and software with additional mechanical


or other parts are designed to perform specific task.

Fig 2.1-Block diagram of EMBEDDED C

Special Characteristics:

 Real time processing.


 Dedicated functionality.
 Lower power consumption.
 Small size.
 Low cost.
 High reliability.

Applications:

Consumer electronics: Smartphones, digital cameras, and other consumer electronics.

 Household appliances: Dishwashers, TVs, microwaves, washing machines, and


fridges.
 Home automation and security: Air conditioning, intruder detection alarms, CCTV
cameras, and fire alarms.

Dept. of EEE, BLDEACET, Vijayapur 2


Embedded C Programming 2024 – 2025

 Automotive: Engine management systems, climate control, brakes, anti-lock braking


systems (ABS),
 cruise control systems, airbags, and more.
 Telecommunications: Telephone switches and cell phones.
 Medical: Image processing systems in medical imaging equipment.
 Aerospace: Fly-by-wire control systems in aircraft.
 Military: Embedded in military technology.
 Electric vehicle charging stations: Provide processing for graphics displays, report
issues, and alert
 GPS navigation: Embedded in the receiver or device that receives the data.
 Embedded banking: Integrates banking capabilities into non-banking digital
environments.

Needs for Embedded Development Hardware and Software:

Hardware:

 Microcontroller or microprocessor

Software:

 Programming language.
 IDE (Integrated Development Environment).
 Programmer.

2.1 Microcontroller and its types:

A microcontroller (MCU) is a small computer on a single integrated circuit that is


designed to control specific tasks within electronic systems. It combines the functions of a
central processing unit (CPU), memory, and input/output interfaces, all on a single chip.

Types of Microcontrollers:

 8-bit Microcontrollers: These are the most basic type of microcontrollers, typically
used in simple applications such as toys, small appliances, and remote controls. They
have a limited processing power and memory capacity, but they are easy to use and
cost-effective.

Dept. of EEE, BLDEACET, Vijayapur 3


Embedded C Programming 2024 – 2025

 16-bit Microcontrollers: These are more advanced than 8-bit microcontrollers and are
capable of performing more complex tasks. They are commonly used in applications
such as medical devices, automotive systems, and industrial control systems.
 32-bit Microcontrollers: These are the most powerful and feature-rich
microcontrollers, capable of handling large amounts of data and performing high-
speed processing. They are used in applications such as gaming systems, multimedia
devices, and high-end industrial automation.
 ARM Microcontrollers: These microcontrollers are based on the ARM architecture and
are widely used in a variety of applications, including mobile devices, automotive
systems, and industrial control systems.
 PIC Microcontrollers: These microcontrollers are manufactured by Microchip
Technology and are commonly used in a wide range of applications, including home
appliances, automotive systems, and medical devices.

2.2 8051 Microcontrollers:

Features of 8051 Microcontroller:

8051 μc family member – 8051 μc have some family members 8052 microcontroller &
8031 microcontroller. 8052μc has 8K bytes of on-chip program ROM instead of 4K bytes,
and 128 bytes of RAM. And 8031μc has 0K bytes of on-chip program ROM, and 128 bytes
of RAM.
Block Diagram of 8051 μc:

Dept. of EEE, BLDEACET, Vijayapur 4


Embedded C Programming 2024 – 2025

Fig 2.2-8051 mic peripherals

 Oscillator and Timing

Oscillator: This circuit provides the microcontroller with a clock signal. All of the
microcontroller’s actions are synchronized by means of the clock signal.

Timing: In order to control the timing of activities within the microcontroller and
guarantee that each instruction is performed at the appropriate moment, the timing
circuit collaborates with the oscillator.

 4096 Byte Program Memory

Program Memory (ROM): The program code is kept in this type of non-volatile
memory. Typically, the onchip ROM of an 8051 microcontroller is 4KB (4096 bytes).

 128 Byte RAM

While the microcontroller is in operation, temporary data is stored in Random Access


Memory (RAM), a form of volatile memory. The 8051 has 128 bytes of inbuilt RAM.

 Two 16-bit Timers

Timers: Timer 0 and Timer 1 are the two 16-bit timers on the 8051. These clocks may
be used for counting events, monitoring time intervals, and creating time delays,
among other things.

 64 Byte Bus Expansion Control

The microcontroller may interact with external memory or peripherals thanks to bus
expansion control. It facilitates the extension of control signals for external devices
and the accessible memory area.

 Programmable I/O

Dept. of EEE, BLDEACET, Vijayapur 5


Embedded C Programming 2024 – 2025

Programmable Input/Output Ports: The four I/O ports (Ports 0 through 3) of the 8051
microcontrollers may be configured to carry out a range of input and output
operations.
 Programmable Serial Port

Serial Port (UART): Serial communication is made possible via the Universal
Asynchronous Receiver/Transmitter (UART). It can send and receive data
concurrently while operating in full duplex mode.

 Synchronous Shifter

Data is shifted in and out of the microcontroller in synchrony using a synchronous


shifter. It is frequently employed in communication protocols when exact time is
necessary.

 8051 CPU

Central Processing Unit (CPU): The microcontroller’s central processing unit (CPU)
is responsible for carrying out instructions read from program memory. It controls
the other parts, handles data flow inside the microcontroller, and executes arithmetic
and logic operations.

2.3 PIC Microcontroller:

PIC is an abbreviation of Peripheral Interface Controller. It is the smallest microcontroller


and are programmed to execute large number of operations.

Dept. of EEE, BLDEACET, Vijayapur 6


Embedded C Programming 2024 – 2025

Fig 2.3-PIC mic peripherals

Salient features of PIC 18:

 It has RISC Architecture.


 It contains ROM of size 2 Megabytes.
 It has on chip program(Code) ROM in the form of flash memory.
 It contains RAM between 256 bytes to 4096 bytes.
 It has data EEPROM.
 It includes timers.
 It has ADC.
 It includes USART Protocol for PC communication.
 It contains I/O port between 16 to 72 pins.

PIC microcontroller peripherals:


The peripherals of the PICI8 microcontrollers are
 ADC (analog-to-digital converter),
 Timers, and
 USART (Universal Synchronous Asynchronous Receiver Transmitter).

The ADC is 10- bit and the number of ADC channels in each PIC chip varies from 5 to
16, depending on the number of pins in the package. The PIC 18 can have up to 4
timers besides the watchdog timer. The USART peripheral allows us to connect the PIC
18-based system to serial ports such as the COM port of the IBM PC.

2.4 BASIC COMPONENTS OF EMBEDDED C

2.4.1 Resistors:

Resistor is defined as. A passive electrical component with two terminals that are used for
either limiting or regulating the flow of electric current in electrical circuits. The main
purpose of resistor is to reduce the current flow and to lower the voltage in any particular
portion of the circuit.

Dept. of EEE, BLDEACET, Vijayapur 7


Embedded C Programming 2024 – 2025

Fig 2.4 Colour code

2.4.2 Capacitors:

A capacitor is a two-terminal electrical device that can store energy in the form of an
electric charge. It consists of two electrical conductors that are separated by a distance. The
space between the conductors may be filled by vacuum or with an insulating material
known as a dielectric.

Types of Capacitors:

 Ceramic capacitor

A ceramic capacitor is a fixed-value capacitor where the ceramic material acts as the
dielectric. It is constructed of two or more alternating layers of ceramic and a metal layer
acting as the electrodes. The composition of the ceramic material defines the electrical
behavior and therefore applications.

Dept. of EEE, BLDEACET, Vijayapur 8


Embedded C Programming 2024 – 2025

Fig 2.5 Ceramic Capacitor

 Electrolytic capacitor

An electrolytic capacitor is a capacitor that uses an oxide film made of aluminum, tantalum
or other oxidizable metal as a dielectric. Because of its potential for large capacitance, this
type of capacitor is used extensively in power supply circuits and similar applications.

Fig 2.6 Electrolytic Capacitor

 Transistor

A transistor is a miniature semiconductor that regulates or controls current or voltage flow in


addition to amplifying and generating these electrical signals and acting as a switch or gate
for them.

Fig 2.7 Transistor

Dept. of EEE, BLDEACET, Vijayapur 9


Embedded C Programming 2024 – 2025

 Regulator
A voltage regulator is a circuit that creates and maintains a fixed output voltage, irrespective
of changes to the input voltage or load conditions.

Fig 2.8 Regulator

 Op-amp

An operational amplifier (op-amp) is an integrated circuit (IC) that amplifies the difference
in voltage between two inputs. It is so named because it was developed for perform
arithmetic operations. Amplifiers, buffers, comparators, filters, etc.

 Diode
A diode is a semiconductor device that allows current to flow in one direction, while restricting it in
the other

Fig 2.9 Diode

Dept. of EEE, BLDEACET, Vijayapur 10


Embedded C Programming 2024 – 2025

CHAPTER 3

TASK PERFORMED

3.1 EMBEDDED SYSTEM


EMBEDDED C are specialized computing systems designed to perform dedicated functions
within a larger system. Over the years, their applications have grown rapidly across domains
like industrial automation, consumer electronics, automotive systems, and healthcare devices.
 Raj Kamal (2003) in EMBEDDED C: Architecture, Programming and Design defines
EMBEDDED C as hardware-software co-designed systems, emphasizing their
importance in real-time applications.
 David E. Simon (1999) in An Embedded Software Primer highlighted the need for
efficient design techniques and introduced key concepts such as real-time constraints,
memory management, and I/O interfacing.
 Recent research has shown EMBEDDED C evolving into smart and networked systems,
driven by IoT and AI integration.

3.1.1. PIC Microcontroller


PIC (Peripheral Interface Controller) microcontrollers by Microchip Technology have been
widely used in industrial and academic projects due to their simplicity, efficiency, and wide
range of features.
 Muhammad Ali Mazidi et al. in PIC Microcontroller and EMBEDDED C provide a
detailed understanding of PIC architecture and assembly/C programming techniques.
 Studies show that PIC microcontrollers are particularly useful in real-time control
applications, due to built-in peripherals such as ADCs, timers, and UARTs.
 According to various IEEE papers, PIC16F877A has been a favorite for educational
automation projects because of its balance between features and ease of use.[2]

3.1.2. Arduino UNO


Arduino UNO is a popular open-source microcontroller board based on the ATmega328P. It
is widely adopted in education, prototyping, and hobbyist electronics due to its user-friendly
nature and vast community support.
 Banzi & Shiloh (2014) in Getting Started with Arduino describe Arduino as a tool for
creativity, allowing users without a technical background to build interactive projects.

Dept. of EEE, BLDEACET, Vijayapur 11


Embedded C Programming 2024 – 2025

 Research shows Arduino UNO’s use in rapid prototyping, IoT systems, and DIY
automation. Its plugand-play approach, combined with accessible programming (via
Arduino IDE), makes it ideal for beginners.
 Various case studies demonstrate its role in low-cost automation, including home
automation,

3.2 ANALOG CIRCUITS


3.2.1 POWER REGULATOR SUPPLY

Components:

 Bridge Rectifier (4 diodes or an integrated bridge rectifier IC)

 Transformer (optional, depends on input AC voltage)/vsine

 Capacitor (for smoothing out the DC after rectification)

 Voltage Regulator (e.g., 7805 for 5V output)

 Resistors and Diodes (as needed for protection)

Bridge Rectifier Stage:

 If your input is AC, pass it through a bridge rectifier to convert the AC voltage to
pulsating DC.
 The bridge rectifier consists of four diodes arranged in such a way that they allow both
halves of the AC wave to pass through but in the same direction (i.e., as DC).

3.2.2 USING LDR GLOW THE LED


Components:

 LDR (Light Dependent Resistor)

 NPN Transistor (e.g., BC547 or 2N2222)

 LED (any color)

Dept. of EEE, BLDEACET, Vijayapur 12


Embedded C Programming 2024 – 2025

 Resistors (various values)

 Power Supply (e.g., 9V battery or 5V supply)

Working Principle:

 The resistance of the LDR changes with the amount of light falling on it. In bright
light, the resistance of the LDR decreases, and in darkness, the resistance increases.

 By using an LDR in a voltage divider circuit, we can control the base of a transistor,
which in turn will switch the LED ON or OFF.

Circuit Design:

 Connect the LDR in series with a fixed resistor to form a voltage divider. This will
convert the varying resistance of the LDR into a varying voltage.
 The voltage at the junction of the LDR and the fixed resistor will control the
transistor.
 The transistor is used as a switch. When the base of the transistor receives enough
voltage (from the voltage divider), it allows current to flow from the collector to the
emitter, turning the LED ON.
 If the base voltage is low (in bright light conditions), the transistor remains OFF, and
the LED stays OFF.
 A current-limiting resistor should be placed in series with the LED to prevent it from
drawing too much current.

Circuit Connections:

 LDR is connected in series with a fixed resistor (e.g., 10kΩ).


 One end of the LDR connects to VCC (positive supply), and one end of the resistor is
connected to ground (GND).
 The junction between the LDR and the resistor is connected to the base of the NPN
transistor through a current-limiting resistor (e.g., 1kΩ).
 The collector of the NPN transistor is connected to the negative terminal of the LED.
 The positive terminal of the LED is connected to VCC through a current-limiting
resistor (typically 220Ω to 470Ω).
 The emitter of the transistor is connected to ground (GND).

Dept. of EEE, BLDEACET, Vijayapur 13


Embedded C Programming 2024 – 2025

How It Works:
 In bright light, the LDR's resistance is low, which causes the voltage at the base of
the transistor to be insufficient to turn it ON. As a result, the transistor remains OFF,
and the LED stays OFF.

 In low light or darkness, the LDR's resistance increases, causing a higher voltage at
the base of the transistor. This turns the transistor ON, allowing current to flow
through the LED, turning it ON.

Example Circuit Values:

 LDR: Typical 5mm or 3mm LDR.

 Resistor: 10kΩ for the voltage divider, 1kΩ for the base of the transistor, and 220Ω
for the LED.

 Transistor: NPN (BC547, 2N2222, etc.).

 Power Supply: 9V or 5V.

Circuit Diagram:

 LDR + 10kΩ Resistor → Voltage Divider.

 Voltage Divider Output → Transistor Base (through 1kΩ resistor).

 LED → Transistor Collector (through 220Ω resistor). Transistor Emitter → Ground.


This simple circuit will turn the LED ON when the LDR detects low light (or
darkness) and turn it OFF when the light level is high.

3.2.3 USING THERMISTER LDR GLOW


Components:

 NTC Thermistor (e.g., 10kΩ at room temperature)

Dept. of EEE, BLDEACET, Vijayapur 14


Embedded C Programming 2024 – 2025

 NPN Transistor (e.g., BC547 or 2N2222)

 LED (any color)


 Resistors (various values, e.g., 10kΩ and 220Ω)

 Power Supply (e.g., 9V or 5V)

 Capacitor (optional for stabilization)

Working Principle:

 The resistance of an NTC thermistor decreases as the temperature increases.

 By connecting the thermistor in a voltage divider configuration, we can convert the


change in resistance to a change in voltage.

 This varying voltage can be used to control the base of a transistor, which in turn
switches the LED ON or OFF based on the temperature.

How It Works:
 At low temperatures, the NTC thermistor has high resistance, so the voltage at the
transistor's base is too low to turn it on. As a result, the transistor remains OFF, and
the LED stays OFF.
 At high temperatures, the NTC thermistor’s resistance decreases, causing the voltage
at the base of the transistor to increase. When the voltage is high enough, it turns the
transistor ON, allowing current to flow through the LED, turning it ON.

3.2.4 USING OP-AMP(LM358) AND LDR TUNE VOLTAGE FROM 0 TO


5V USING NOT GATE (7404)

To design a temperature-controlled circuit that outputs a voltage between 0V and 5V using a


comparator (LM358), a thermistor, and a NOT gate (7404), we can follow this process:

Dept. of EEE, BLDEACET, Vijayapur 15


Embedded C Programming 2024 – 2025

 LM358 will act as a comparator, comparing the voltage from the thermistor with a
reference voltage.
 The 7404 NOT gate will invert the output of the comparator, allowing us to control
the output behaviour.
 The thermistor will change resistance with temperature, allowing us to tune the
temperature threshold where the output changes between 0V and 5V.

Components:

 LM358 Op-Amp (used as a comparator)

 NTC Thermistor (e.g., 10kΩ at room temperature)

 Resistors (various values, typically 10kΩ, 1kΩ)

 7404 IC (Hex Inverter/NOT gate)

 Power Supply (5V)

 LED (optional for testing)

 Potentiometer (optional for adjustable threshold)

Working Principle:

 The thermistor's resistance changes with temperature. We'll create a voltage divider
using the thermistor and a fixed resistor to convert the changing resistance into a
voltage that depends on the temperature.

 The LM358 comparator compares the thermistor voltage with a fixed reference
voltage. When the thermistor voltage crosses the reference threshold, the comparator
output will change.

 The NOT gate (7404) inverts the output of the comparator, giving us a 0V or 5V
output based on the temperature.

Circuit Design:

Voltage Divider for Thermistor:

Dept. of EEE, BLDEACET, Vijayapur 16


Embedded C Programming 2024 – 2025

 Connect the thermistor in series with a fixed resistor (e.g., 10kΩ) to create a voltage
divider.

 One end of the thermistor is connected to Vcc (5V), and the other end is connected to
a resistor, which is grounded. The voltage at the junction between the thermistor and
the resistor is fed into the noninverting input (+) of the LM358 comparator.

Reference Voltage:

 Set a reference voltage using a simple voltage divider (two resistors or a


potentiometer) connected to the inverting input (-) of the LM358 comparator.
 This reference voltage sets the threshold for the temperature. For instance, when the
thermistor voltage is higher than the reference voltage, the comparator output will
change.

Comparator (LM358) Connections:

 The LM358 compares the voltage at its non-inverting input (+) (from the thermistor)
with the reference voltage at its inverting input (-).

 When the thermistor voltage exceeds the reference voltage (indicating a certain
temperature threshold), the comparator output will go high (5V).

 When the thermistor voltage is lower than the reference voltage, the comparator
output will go low (0V).

NOT Gate (7404) Inversion:

 The output of the comparator is connected to the input of a 7404 NOT gate.
 The NOT gate inverts the output from the LM358. This means that:
 When the LM358 comparator output is high (5V), the NOT gate output will be low
(0V).
 When the comparator output is low (0V), the NOT gate output will be high (5V).
 This allows us to invert the control logic of the circuit. For example, you might want
the LED or output device to turn ON when the temperature falls below a threshold,
rather than above it.

LED (Optional):

Dept. of EEE, BLDEACET, Vijayapur 17


Embedded C Programming 2024 – 2025

 Connect an LED with a current-limiting resistor (e.g., 220Ω) to the output of the
NOT gate to visually indicate when the output is high (5V).

Circuit Connections:

 One end of the thermistor is connected to 5V, and the other end is connected to a
fixed resistor (10kΩ).
 The other end of the fixed resistor is connected to ground (GND).
 The junction of the thermistor and resistor is connected to the non-inverting input
(+) of the LM358.
 Use a voltage divider made from two resistors (e.g., two 10kΩ resistors) or a
potentiometer to create the reference voltage at the inverting input (-) of the
LM358.
 The output of the LM358 is connected to the input of a 7404 NOT gate.
 The output of the 7404 NOT gate is your final 0V/5V output.
 Connect both the LM358 and the 7404 to a 5V power supply.
 The ground of the power supply is shared between all components.

Output Logic:

 The output of the NOT gate will be 5V when the temperature is below the set
threshold.
 The output of the NOT gate will be 0V when the temperature is above the set
threshold.

3.3 DIGITAL CIRCUITS


3.3.1 BASIC CIRCUIT DIAGRAM OF IR SENSOR

Basic Overview:

 IR Transmitter: Sends out infrared (IR) light (invisible to the human eye).

Dept. of EEE, BLDEACET, Vijayapur 18


Embedded C Programming 2024 – 2025

 IR Receiver: Detects the IR light sent by the transmitter and outputs a signal.

 LED: Lights up when the receiver detects the IR signal.

 Transmitting and Receiving Logic: The transmitter sends a pulse or signal, and when
the receiver detects this, it triggers the LED.
Components:

 IR LED (Infrared LED for transmission)

 IR Receiver Module (such as TSOP1738, or any general IR receiver)

 NPN Transistor (optional for driving the LED)

 LED (for visual indication when the signal is received)

 Resistors (appropriate values for current limiting, typically 220Ω to 1kΩ)

 Capacitors (optional for noise reduction)

 Power Supply (5V or 3.3V, depending on your components)

Working Principle:

 IR Transmitter: The IR LED will emit an infrared light signal when powered. This
signal can be modulated (pulsed) to ensure that only the correct IR frequency is detected
by the receiver, avoiding interference from ambient light.
 IR Receiver: The receiver module (like TSOP1738) will detect the modulated IR
signal and output a low signal (0V) when IR is detected.
 LED Control: The output of the receiver is used to drive an NPN transistor or directly
control an LED.

 When the receiver detects the signal, the output pin will go low, turning on the LED.

Circuit Design:

IR Transmitter Circuit:
 IR LED: One side of the IR LED is connected to a current-limiting resistor (typically
220Ω or 330Ω).

 The other side of the resistor is connected to VCC (5V).

Dept. of EEE, BLDEACET, Vijayapur 19


Embedded C Programming 2024 – 2025

 The cathode of the IR LED is connected to ground.

 To modulate the signal, you can pulse the IR LED using a 555 timer in astable mode
or a microcontroller (such as Arduino) that generates a modulated 38kHz signal,
which matches the frequency of most IR receivers like the TSOP1738.

IR Receiver Circuit:

 The IR receiver has 3 pins: VCC, GND, and OUT.


 Connect the VCC pin of the receiver to 5V and the GND pin to ground.
 The OUT pin goes low (0V) when the receiver detects the IR signal and high (5V)
when no signal is detected.

LED Indicator:

 The OUT pin of the receiver module is connected to the base of the transistor through
a current- limiting resistor (1kΩ).
 The emitter of the transistor is connected to ground, and the collector is connected to
one side of the LED.
 The other side of the LED is connected to VCC (5V) through a current-limiting
resistor (typically 220Ω).

Circuit Connections:

IR Transmitter:

 IR LED Anode → Resistor (220Ω) → VCC (5V)


 IR LED Cathode → GND

IR Receiver:
 VCC pin of the receiver → 5V
 GND pin of the receiver → Ground
 OUT pin of the receiver → Resistor (1kΩ) → Base of NPN transistor LED
Indicator:
 Collector of NPN transistor → Cathode of the LED
 Anode of the LED → Resistor (220Ω) → VCC (5V)

Dept. of EEE, BLDEACET, Vijayapur 20


Embedded C Programming 2024 – 2025

 Emitter of NPN transistor → Ground Operation:


 When the IR LED (transmitter) is powered, it sends an infrared signal.
 The IR receiver detects the IR signal if it's within range and outputs a low signal
 This low signal turns ON the NPN transistor, which completes the circuit for the LED,
causing it to light up.
 When the transmitter stops sending the IR signal or the receiver doesn’t detect it, the
output goes high (5V), and the LED turns OFF.

3.3.2 RELAY SWITCHING

Step-by-Step Instructions Connect the Battery:

 Connect the positive terminal of the battery to one terminal of the relay coil.

 Connect the other terminal of the relay coil to the collector (C) of the BC547 transistor.

 Transistor Connections: Connect the emitter (E) of the BC547 transistor to the ground
(GND) of the battery. Connect the base (B) of the BC547 transistor to one terminal of
the resistor (1kΩ). Connect the other terminal of the resistor to one terminal of the
switch.
 Connect the Lamp: Connect one terminal of the lamp to the Common (COM) terminal of
the relay. Connect the Normally Open (NO) terminal of the relay to the positive terminal
of the battery. Connect the other terminal of the lamp to the ground.

Powering the Circuit:

 When you connect the battery, the circuit is powered, but the relay is not activated
because there is no current flowing to the base of the transistor.

 Activating the Relay: When the switch is closed (pressed), current flows through the
resistor into the base of the BC547 transistor. This turns the transistor on, allowing
current to flow from the collector to the emitter. This action energizes the relay coil,
which closes the relay contacts, allowing current to flow through the lamp.

 Lamp Operation: The lamp turns on when the relay is activated. When the switch is
released, the current to the base of the transistor stops, turning it off, which de-energizes
the relay and turns off the lamp.

Dept. of EEE, BLDEACET, Vijayapur 21


Embedded C Programming 2024 – 2025

3.3.3 SWITCHING USING DRIVERS

Circuit using relays of 12V

To create a relay driver circuit using the ULN2003A, you can utilize its capability to drive
relays based on logic states (from microcontrollers or logic circuits) while also allowing
you to control LEDs. The ULN2003A is a Darlington transistor array commonly used for
driving high-current loads, including relays.

Components Required:

 ULN2003A: Darlington transistor array. Relay: Suitable for the lamp or device you
want to control.

 Resistor: Typically, a 1kΩ resistor for the LED.

 Power Supply: According to the relay and LED specifications (e.g., 5V, 12V).

 Microcontroller or Logic Circuit: To control the relay (like Arduino).

 Connecting Wires: For connections.

Step-by-Step Instructions:

 Connect the Microcontroller: Connect the control pin (logic HIGH or LOW) from
your microcontroller to one of the input pins of the ULN2003A (let’s say IN1).

 Connect the ULN2003A: Connect the corresponding output pin (OUT1) of the
ULN2003A to one end of the relay coil.

 Connect the other end of the relay coil to the positive voltage supply (Vcc) according
to the relay's specifications.

 Connect the LED (optional): Connect the LED in series with a resistor (e.g., 1kΩ)
from the control signal to the ground. This will turn on the LED when the control
signal is HIGH, indicating the relay is activated.

 Power Connections: Connect the GND of the microcontroller, ULN2003A, and the
relay to a common ground. Make sure the ULN2003A is powered according to its
specifications (usually 5V).

Dept. of EEE, BLDEACET, Vijayapur 22


Embedded C Programming 2024 – 2025

 Enable the Relay: When the microcontroller outputs a HIGH signal, the
corresponding input on the ULN2003A activates, allowing current to flow through
the relay coil and energizing it. The relay will then close its contacts and allow
current to flow to the connected lamp or device.

Operation:

When the microcontroller sends a HIGH signal to the ULN2003A input pin, the
corresponding output pin goes LOW, allowing current to flow through the relay coil,
activating the relay. If an LED is connected, it will light up, indicating the relay is active.
When the signal is LOW, the relay deactivates, and the connected device or lamp turns off.

3.3.4 SMART MEDICINE REMAINDER SYSTEM

Introduction

This project simulates a basic smart medical reminder system using an Arduino UNO. It
demonstrates how EMBEDDED C can be used to assist patients by managing their
medication schedules effectively..

Components Used

 Arduino UNO
 Real-Time Clock (RTC) Module
 LCD Display (16x2)
 Breadboard and jumper wires

Working Principle

The Arduino controls the medical reminder by checking the current time from the RTC
module and triggering alerts:
• Buzzer sound to notify medication time
• LCD display shows the medicine name and time
• Button to acknowledge the intake

The system checks for scheduled times and activates the alert mechanism accordingly.

Dept. of EEE, BLDEACET, Vijayapur 23


Embedded C Programming 2024 – 2025

3.4 WORK CARRIED OUT

Introduction

In recent years, the demand for personalized healthcare and assistive technology has grown
significantly. One important area of focus is medication adherence, which plays a critical role
in patient health management. A Smart Medical Reminder System offers an innovative
solution by automatically reminding patients to take their medications at the correct time.
This project uses Arduino, an open-source microcontroller platform, to develop a system that
ensures timely medication. The system employs components such as RTC (Real-Time Clock)
modules to track time and buzzers/LCDs to notify users.

Objective

• To design and implement a smart medical reminder system using Arduino microcontrollers.
• To automatically alert patients for medication based on scheduled timings.
• To improve medication adherence and reduce chances of missed doses.
• To enhance elderly care and chronic disease management through timely reminders.
• To demonstrate the use of time modules (RTC) and output devices (buzzer, LCD) for
healthcare applications.
• To create a cost-effective and easily scalable model suitable for home or clinical use.
• To promote better health outcomes and reduce healthcare dependency through simple
automation.

Methodology

Dept. of EEE, BLDEACET, Vijayapur 24


Embedded C Programming 2024 – 2025

Fig 3.4 Block Diagram

Circuit Description:

1. Arduino UNO is the central microcontroller that controls the entire reminder system
based on real-time clock inputs and user interaction.
2. A Real-Time Clock (RTC) Module (e.g., DS3231) is connected to the Arduino via
I2C (SDA and SCL pins) to provide accurate date and time tracking for scheduling
medication alerts.
3. A 16x2 LCD Display is connected in 4-bit mode to digital pins of Arduino to display
the current time and medicine reminders.
4. A Buzzer is connected to one of the Arduino’s digital pins to provide an audible alert
when it's time to take medication.
5. Push buttons are connected to input pins with pull-down resistors to allow the user to
acknowledge the alert or reset the reminder.
6. Power supply to the Arduino is provided through a USB cable or 9V adapter,
ensuring continuous operation.
7. Jumper wires and a breadboard are used for interconnecting all components,
maintaining a modular and clean setup.
8. Optional LEDs can be connected to indicate alert status (e.g., red for missed dose,
green for taken), enhancing visual feedback alongside audio and display.

Working Principle:

Dept. of EEE, BLDEACET, Vijayapur 25


Embedded C Programming 2024 – 2025

The Smart Medical Reminder System using Arduino operates by continuously checking the
current time using a Real-Time Clock (RTC) module. The user predefines medication times
in the system. As the clock matches a scheduled time, the Arduino triggers an alert system to
notify the user. This includes sounding a buzzer and displaying the medicine details on an
LCD screen. A push button is provided to acknowledge the reminder and stop the buzzer. If
the user doesn’t respond within a set time, the system assumes the medicine is missed and can
log the event or keep the buzzer active for another reminder cycle. The system ensures timely
alerts without requiring human supervision, assisting especially elderly or chronically ill
patients in maintaining consistent medication adherence.
Code:
#include <Wire.h>

#include <RTClib.h>

#include <LiquidCrystal.h>

RTC_DS3231 rtc;

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

#define BUZZER 8

#define BUTTON 9

void setup() {

pinMode(BUZZER, OUTPUT);

pinMode(BUTTON, INPUT_PULLUP);

lcd.begin(16, 2);

Serial.begin(9600);

if (!rtc.begin()) {

lcd.print("RTC Error!");

while (1);

Dept. of EEE, BLDEACET, Vijayapur 26


Embedded C Programming 2024 – 2025

lcd.print("Medical Reminder");

delay(2000);

lcd.clear();

void loop() {

DateTime now = rtc.now();

int hour = now.hour();

int minute = now.minute();

// Set medication time here (e.g., 10:30 AM)

if (hour == 10 && minute == 30) {

lcd.clear();

lcd.print("Take Medicine");

digitalWrite(BUZZER, HIGH);

delay(5000); // Wait 5 seconds for user to acknowledge

if (digitalRead(BUTTON) == LOW) {

digitalWrite(BUZZER, LOW);

lcd.clear();

lcd.print("Dose Taken");

delay(2000);

} else {

digitalWrite(BUZZER, LOW);

lcd.clear();

Dept. of EEE, BLDEACET, Vijayapur 27


Embedded C Programming 2024 – 2025

lcd.setCursor(0, 0);

lcd.print("Time: ");

lcd.print(now.hour());

lcd.print(":");

lcd.print(now.minute());

delay(1000); // Check every second

Advantages:

Dept. of EEE, BLDEACET, Vijayapur 28


Embedded C Programming 2024 – 2025

• Timely Alerts: Automatically notifies patients of medicine times, ensuring


consistency in medication schedules.
• Automation: No manual tracking is needed, making it ideal for elderly or forgetful
individuals.
• Cost-Effective: Built using affordable components like Arduino, LCD, and RTC
module, reducing setup cost.
• User-Friendly: Simple interface using an LCD and buzzer makes the system easy to
operate.
• Health Management: Helps prevent missed doses, improving treatment
effectiveness and patient outcomes.
• Customizable: Medication times can be adjusted as per prescription requirements.
• Caregiver Support: Assists caretakers by reducing the need for constant
supervision.

Applications:

• Elderly Care Homes: Ensures older adults take medications on time without relying on
memory.
• Hospitals and Clinics: Supports nurses and staff in patient medication management.
• Chronic Disease Patients: Ideal for those needing regular doses for conditions like
diabetes, hypertension, etc.
• Home Healthcare: Personal use system for patients recovering at home or under self-care.
• Disabled Individuals: Assists users with cognitive or physical impairments in taking
medications.
• Rehabilitation Centers: Ensures patients adhere to strict medication routines.
• Remote Areas: Helpful where access to frequent medical supervision is limited.

Dept. of EEE, BLDEACET, Vijayapur 29


Embedded C Programming 2024 – 2025

CHAPTER 4

REFLECTION NOTES

4.1 Analog Circuits

4.1.1 POWER REGULATOR SUPPLY

Fig 4.1 Power regulator supply

Fi
g 4.1 a-Bridge Rectifier circuits

4.1.2 USING LDR GLOW THE LED

Dept. of EEE, BLDEACET, Vijayapur 30


Embedded C Programming 2024 – 2025

Fig 4.2 -LDR circuit

4.1.3 USING THERMISTER LDR GLOW

Fig 4.3-Thermister circuit

4.1.4 USING OP-AMP(LM358) AND LDR TUNE VOLTAGE FROM 0 TO


5V USING NOT GATE (7404)

Fig 4.4-Tuning voltage from 0 to 5v Using Op amp and NOT gate in proteus

Dept. of EEE, BLDEACET, Vijayapur 31


Embedded C Programming 2024 – 2025

4.2 Digital Circuits

4.2.1 BASIC CIRCUIT DIAGRAM OF IR SENSOR

Fig 3.3.1 IR sensor circuit

4.2.2 RELAY SWITCHING

Fig 4.2.2 12V Relay switching circuit

Dept. of EEE, BLDEACET, Vijayapur 32


Embedded C Programming 2024 – 2025

4.2.3 SWITCHING USING DRIVERS

Fig 4.2.3 a-Turning on led using drivers circuit

Fig 4.2.3 b -Driving motor and LED

Dept. of EEE, BLDEACET, Vijayapur 33


Embedded C Programming 2024 – 2025

4.2.4 SMART MEDICINE REMAINDER SYSTEM

Fig 4.2.4 Smart Medical Remainder System

4.3 Work Carried Out

Fig 4.3 Mini Project Simulation

Dept. of EEE, BLDEACET, Vijayapur 34


Embedded C Programming 2024 – 2025

CHAPTER 5

CONCLUSION

The internship experience in Embedded C programming has been both enriching and
transformative. It provided us with a practical understanding of how EMBEDDED C
operate, far beyond what I had learned in the classroom. By working on real-world
applications, we developed a solid foundation in writing optimized and modular C code
for microcontrollers, which significantly strengthened my technical skillset.

Throughout the internship, We had the opportunity to work on tasks such as device
interfacing, sensor data processing, and real-time debugging. These activities improved
our ability to interpret datasheets, use development tools, and troubleshoot hardware-
software integration challenges. The exposure to industry-standard practices and tools like
IDEs, simulators, and in-circuit debuggers helped us to gain a deeper appreciation of
embedded development workflows.

Overall, the internship not only enhanced our programming and analytical skills but also
improved our teamwork, communication, and project management abilities. This
experience has reaffirmed our interest in EMBEDDED C and has motivated us to continue
learning and contributing to this dynamic field. We are confident that the knowledge and
skills we acquired will be valuable in our future academic and professional pursuits.

Dept. of EEE, BLDEACET, Vijayapur 35


Embedded C Programming 2024 – 2025

REFERENCES

[1] D. C. Pheanis, "CEINT internship program," 33rd Annual Frontiers in Education, 2003.
FIE 2003., Westminster, CO, USA, 2003, pp. F4B-1, doi: 10.1109/FIE.2003.1264751.

[2] C. Talarico, Aseem Gupta, E. Peter and J. W. Rozenblit, "Embedded system engineering
using C/C++ based design methodologies," 12th IEEE International Conference and
Workshops on the Engineering of Computer-Based Systems (ECBS'05), Greenbelt, MD,
USA, 2005, pp. 81-88, doi: 10.1109/ECBS.2005.35.

[3] F. Gao, F. Deng, Y. Yan and C. Li, "Full Digital Simulation Testing of Networked
Embedded Software," 2018 IEEE International Conference on Software Quality, Reliability
and Security Companion (QRS-C), Lisbon, Portugal, 2018, pp. 45-50, doi: 10.1109/QRS-
C.2018.00022.

[4] Xiaofeng Li, Xuedong Li, Hongling Gou and Xiaobing Tang, "Innovation for the course
of C language to embedded platform," 2010 2nd International Conference on Education
Technology and Computer, Shanghai, 2010, pp. V2-529-V2-532, doi:
10.1109/ICETC.2010.5529328.

[5] H. J. Zainzinger, "Testing EMBEDDED C by using a C++ script interpreter," Proceedings


of the 11th Asian Test Symposium, 2002. (ATS '02)., Guam, USA, 2002, pp. 380-385, doi:
10.1109/ATS.2002.1181741.

Dept. of EEE, BLDEACET, Vijayapur 36

You might also like