Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 77

Project Stage-II Report On

PROJECT TITLE
MONITORING AND WARNING OF
FLOODING
CONDITIONS USING IOT BASED SYSTEM
Project Stage-II report submitted to
GURU NANAK INSTITUTIONS TECHNICAL CAMPUS
(Autonomous)
In partial fulfillment of the requirement for the award of the degree of

BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING

Submitted by

P. NITHIN SAI (21WJ5A0423)


N. PRAVALIKA (21WJ5A0424)
V. SANJAY (21WJ5A0428)

Under the guidance of

(Mr. R. SANDEEP REDDY)


Designation

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS
SCHOOL OF ENGINEERING & TECHNOLOGY
(Approved by AICTE, New Delhi, permanently affiliated to JNTUH,
An Autonomous, NBA, NAAC A+ Accredited Institution)
Ibrahimpatnam, Hyderabad – 501506, Telangana
2023 – 2024
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
CERTIFICATE

This is to certify that the Project Stage-II entitled “MONITORING AND WARNING OF
FLOODING CONDITIONS USING IOT BASED SYSTEM” is being presented with
report by PENUMARTHI NITHIN SAI bearing Rol No. 21WJ5A0423,
NELLUTLA
PRAVALIKA bearing Roll No. 21WJ5A0424, VEERAGONI SANJAY bearing
Roll.No.21WJ5A0428 in partial fulfillment for the award of Degree of Bachelor of
Technology in Electronics and Communication Engineering to Guru Nanak Institutions
Technical Campus (Autonomous) affiliated to Jawaharlal Nehru Technological University,
Hyderabad during the academic Year 2023-2024.

Internal Guide Project Co-ordinator


Mr. R. Sandeep Reddy Mr. O. Ravinder
Assistant professor. Associate professor

HEAD OF DEPARTMENT EXTERNAL EXAMINER


Dr. Maheshwara Reddy Sura
Professor and HOD-ECE
PROJECT COMPLETION CERTIFICATE

This is to certify that the following students of final year B.Tech, Department of
Electronics and Communication Engineering – Guru Nanak Institutions Technical
Campus(GNITC) have completed their training and project atGNITC successfully.

STUDENT NAME: ROLL NO:

1. PENUMARTHI NITHIN SAI 21WJ5A0423


2. NELLUTLA PRAVALIKA 21WJ5A0424
3. VEERAGONI SANJAY 21WJ5A0428

The training was conducted on Internet of things (IoT) Technology for the
Completion of the project titled MONITORING AND WARNING OF
FLOODING CONDITIONS USING IOT BASED SYSTEM in 2023 - 2024. The
project has been completed in all aspects.

Mini & Major IEEE Live Project For


M.E/MTech, BE/B. Tech, MCA, MS.

I
II
Acknowledgement
We want to express our sincere gratitude to our guide Mr. R. SANDEEP REDDY,
Assistant professor, Department of Electronics and Communication Engineering, for his
excellent guidance and invaluable support, which helped us to accomplish our Bachelor's
degree and prepared us to achieve more life goals in the future. His total support of our
dissertation and countless technical and professional development contributions made for a
delightful and fruitful experience.

We are thankful to our beloved mentors, Mr. K. Anil Kumar, Assistant Professor, ECE,
GNITC, Hyderabad.

We are very much grateful to our Project Coordinators, Mr. O.RAVINDER, Associate
Professor & Mr. K. KRISHNA KUMAR, Assistant Professor of ECE, GNITC,
Hyderabad, who are not only shown utmost patience but were fertile in suggestions, vigilant
in directions of error, and have been infinitely helpful.

We are also thankful to our academic Coordinator, IV Year, Mr. D. Surendra Rao,
Associate Professor of ECE, GNITC, Hyderabad, for his support.

We were also thankful to Dr. Maheswara Reddy Sura, Professor & HOD of ECE &
Academic Coordinator, GNITC, Hyderabad, for being so helpful with valuable insights and
guidance during our project.

We are thankful to Dr. P. Parthasaradhy, Joint Director,GNITC for his good support and
given valuable inputs in our project work.

We express our deepest gratitude to Dr. Koduganti Venkata Rao, Director, GNITC, for his
constant support and encouragement and for providing us with all the facilities in the college
during our project work.

Our sincere thanks to all our faculties, administrative staff, and management of GNITC
without whose support, our work would always remain incomplete.

On a more personal note, we thank our beloved parents and friends for their moral support
during our project.
v

LIST OF FIGURES
Figure number Name of the figure Page no
Fig-2.1a Overview of Embedded System Architecture 11
Fig-2.1b Block diagram of CPU 12
Fig-2.2 Block diagram of flood monitoring and warning system 14

Fig-2.3 Block diagram of power supply 15


Fig-2.4 Bridge rectifier 16
Fig-2.5 Output waveform of DC 17
Fig-2.6 Regulator 18
Fig-2.7 Circuit diagram of power supply 18
Fig-2.8 Raspberry pi Pico 19
Fig-2.9 Raspberry pi Pico w pinout 21
Fig-2.10 Rpi Pico and wpwm pinout 24
Fig-2.11 OLED and LCD display 26
Fig-2.12 OLED white lighting 30
Fig-2.13 Wire circuit 31
Fig-2.14 Example of an IOT system 35
Fig-2.15 Block diagram of ultrasonic sensor 42
Fig-2.16 Description and view of ultrasonic sensor 44
Fig-2.17 Water level sensor 48
Fig-2.18 Buzzer 50
Fig-3.0 Python IDE 51
Fig-3.1 Features of python 52
Fig-3.2 Variables 52
Fig-3.3 Simple debug 52
Fig-3.4 Step through expression
Fig-3.5 Representation of function call 53
Fig-3.6 Highlight syntax errors 53
Fig-3.7 Explain scopes 53

Fig-3.8 Mode of explanation 60


Fig-3.9 Code completion 61
Fig-3.9 Insert LED 64
Fig-3.10 Testing LED 64
Fig-4.1 Schematic Diagram 72
Fig-5.1 Output Screenshots 73

v
vii

LIST OF TABLES

Table number Table name Page no

Table-2.1 GPIOs and ADC channels 24

Table-2.2 PWM channels relates to the GPIOs 25

Table-2.3 Internal board functions in RPi Pico 26

Table-2.4 Special function pins in RPi Pico W 27

Table-2.5 GPIOs of Infineon CYW4343 27

Table-2.6 Name and functions of pin OLED 18

vii
viii

List of abbreviations

1. IOT: Internet of Things


2. LED: Light Emitting Diode
3. SMS: Short Message Service
4. IR: Infrared
5. LCD: Liquid Crystal Display
6. Wi-Fi: Wireless Fidelity
7. CPU: Central Processing Unit
8. RAM: Random Access Memory
9. ROM: Read-Only Memory
10. DSP: Digital Signal Processor
11. USB: Universal Serial Bus
12. IC: Integrated Circuit
13.AC: Alternating Current
14.DC: Direct Current
15.Vi: Input Voltage
16.Vo: Output Voltage
17.ATM: Automatic Teller Machine
18.PAD: Packet Assemblers Dissemblers
19.GPIO: General Purpose Input-Output
20.SPI: Serial Peripheral Interface
21.UART: Universal Asynchronous Receiver-Transmitter
22.I2C: Inter-Integrated Circuit
23.OLED: Organic Light Emitting Diode
24. CFL: Compact Fluorescent Lamp
25. IEEE: Institute of Electrical and Electronics Engineers
26.WSN: Wireless Sensor Network
27.IDE: Integrated Development Environment
28.AWS: Amazon Web Services

viii
ix

ABSTRACT

To be sure, flooding is one of the most devastating natural calamities that needs to be
addressed. It has widespread repercussions for the economy and has caused many
deaths. Lack of warning causes a great deal of annual mortality. This study employed
the CONTROLLER, ultrasonic sensors, and other sensors to detect and measure the
depths of flood waters. Here, we measure changes in the river's level with the help of
an ultrasonic HC-SR04 sensor and Raspberry Pico Microcontroller. The information
after processing will be sent to the Thing Speak IoT Cloud Platform. With this
method, river levels may be tracked graphically from any location. The circuit's
software was programmed using the IDE and uploaded to the microcontroller's
memory. The study concluded that the proposed sensor could precisely determine the
location of an incoming object and present that information as a distance on the Thing
Speak Cloud Platform. Concurrently, the sensor shows off LED indicators for your
eyes to feast over. Based on data from a controller, this system uses the Internet of
Things to issue warnings to the proper authorities ahead of time of any impending
floods.

ix
MONITORING AND WARNING OF FLOODING
CONDITIONS USING IOT BASED SYSTEM

Dept.of.ECE 1
LIST OF CONTENTS
Title page I

Certificate II

Acknowledgement III

List of figures IV

List of tables V

List of abbreviations VI

Abstract VII

Chapter1: Introduction 1

1.1 General 1

1.2 Existing System 2

1.3 Proposed System 2

Chapter2: Project Description 3


2.1 General Introduction to Embedded System 3
2.2 Block Diagram 10
2.3 Modules 11
2.3.1 Power Supply 11
2.3.2 Transformer 11
2.3.3 Rectifier 12
2.3.4 Bridge Rectifier 12
2.3.5 Voltage Regulators 13
2.4 MICROCONTROLERS 15
2.4.1 Raspberry Pi Pico-W 15
2.4.2 Raspberry Pi Pico Specifications 16
2.4.3 Raspberry Pi Pico W Pin Out 17
2.5 OLED (Organic Light Emitting Diodes) 24
2.6 IOT (Internet of Things) 28
2.7 Body Temperature Sensor 38
2.8 MAX30100(SPO2) 41
2.9 Global Positioning System 44

Dept.of.ECE 2
2.10 Buzzer 49

Chapter3: SOFTWARE SPECIFICATIONS


3.1 MicroPython 51
3.2 How to set Up the Raspberry pi Pico/Pico W 56

Chapter4: IMPLEMENTATIONS
4.1 Schematic Design 65

Chapter5: SIMULATIONANDDESIGN
5.1 Output Screenshots 71

Chapter6: CONCLUSION 72
Chapter7: REFERENCES 73

Dept.of.ECE 3
CHAPTER 1
INTRODUCTION
1. GENERAL

Flood occurs when water overflows from the river, lake or from heavy rainfall and it can
happen at any time of the year. Flooding can be very dangerous, when floods happen in an
area that people live, the water carries along objects like houses, cars, furniture and even
people. It can wipe away property, trees and many more heavy items. For years, flooded
roads have been a problem in Metro Mumbai. It causes heavy flow of traffic. Both motorists
and commuters are getting stuck in a flooded areas and getting lost in finding possible routes
just to go to their destinations. When traffic happened, people’s money, time and effort are
wasted. Through the local government unit flood control has been extending their efforts to
inform the commuters regarding the situation in flooded areas during rainy season, still the
dissemination of information to the locals are not enough. For this reason, the “Arduino
Flood Detector System” is been develop, to help the road user to avoid this problem
happened. It was invented based on problem faced by motorists and commuters when flood
occurred. This will avoid the traffic jam because the users have a time to find a possible
routes before they are going to be stuck at the flood area. The system will function when the
admin activates the system and when water along the road detected by distance over
ultrasonic sensor. When the flood occurs, the ultrasonic sensor will sent signal to the
microprocessor circuit and the sense water level will be display in the user interface and it
will automatically send a Short Message Service (SMS) to those recognized residents and it
will continue update until the water level detected returns to normal.

Dept.of.ECE 4
1.1 EXISTING SYSTEM
In Existing system, the development of flood monitoring system using IoT to keep track of
the conditions nearby the reservoir with the help of Arduino, and the compactible sensors
such as level, temperature, humidity and flow distinctly presented. Firstly, the hardware unit
is placed in the flood prone areas, the GSM Module as the transmitting unit and the sensors
associated with the system measures the corresponding parameters. Then the accurately
measured parameters are displayed through the LCD display and passed to the IOT web
application

1.2 PROPOSED SYSTEM


This study employed the Raspberry Pico, ultrasonic sensors, and other sensors to detect and
measure the depths of flood waters. Here, we measure changes in the river's level with the
help of an ultrasonic HC-SR04 sensor and Raspberry Pico Microcontroller. The information
after processing will be sent to the Thing Speak IoT Cloud Platform. With this method, river
levels may be tracked graphically from any location. The circuit's software was programmed
using the IDE and uploaded to the microcontroller's memory.

Dept.of.ECE 5
CHAPTER 2
PROJECT DESCRIPTION
2.1 GENERAL INTRODUCTION TO EMBEDED SYSTEM
An embedded system can be defined as a computing device that does a specific focused job.
Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine,
mobile phone etc. are examples of embedded systems. Each of these appliances will have a
processor and special hardware to meet the specific requirement of the application along with
the embedded software that is executed by the processor for meeting that specific
requirement. The embedded software is also called “firm ware”. The desktop/laptop computer
is a general purpose computer. You can use it for a variety of applications such as playing
games, word processing, accounting, software development and so on. In contrast, the
software in the embedded systems is always fixed listed below:
· Embedded systems do a very specific task, they cannot be programmed to do different things.
. Embedded systems have very limited resources, particularly the memory. Generally, they do
not have secondary storage devices such as the CDROM or the floppy disk. Embedded
systems have to work against some deadlines. A specific job has to be completed within a
specific time. In some embedded systems, called real-time systems, the deadlines are
stringent. Missing a deadline may cause a catastrophe-loss of life or damage to property.
Embedded systems are constrained for power. As many embedded systems operate through a
battery, the power consumption has to be very low.
· Some embedded systems have to operate in extreme environmental conditions such as very
high temperatures and humidity.
Application Areas
Nearly 99 per cent of the processors manufactured end up in embedded systems. The
embedded system market is one of the highest growth areas as these systems are used in very
market segment- consumer electronics, office automation, industrial automation, biomedical
engineering, wireless communication, data communication, telecommunications,
transportation, military and so on.
Consumer appliances:
At home we use a number of embedded systems which include digital camera, digital diary,
DVD player, electronic toys, microwave oven, remote controls for TV and air-conditioner,
VCO player, video game consoles, video recorders etc. Today’s high-tech car has about 20

Dept.of.ECE 6
embedded systems for transmission control, engine spark control, air-conditioning,
navigation etc. Even wristwatches are now becoming embedded systems. The palmtops are
powerful embedded systems using which we can carry out many general-purpose tasks such
as playing games and word processing.
Office Automation:
The office automation products using embedded systems are copying machine, fax machine,
key telephone, modem, printer, scanner etc.

Industrial Automation:
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and
transmission. The embedded systems for industrial use are designed to carry out specific
tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and then
take appropriate action based on the monitored levels to control other devices or to send
information to a centralized monitoring station. In hazardous industrial environment, where
human presence has to be avoided, robots are used, which are programmed to do specific
jobs. The robots are now becoming very powerful and carry out many interesting and
complicated tasks such as hardware assembly.
Medical Electronics:
Almost every medical equipment in the hospital is an embedded system. These equipments
include diagnostic aids such as ECG, EEG, blood pressure measuring devices, X-ray
scanners; equipment used in blood analysis, radiation, colonoscopy, endoscopy etc.
Developments in medical electronics have paved way for more accurate diagnosis of
diseases.
Computer Networking:
Computer networking products such as bridges, routers, Integrated Services Digital Networks
(ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay switches are embedded
systems which implement the necessary data communication protocols. For example, a router
interconnects two networks. The two networks may be running different protocol stacks. The
router’s function is to obtain the data packets from incoming pores, analyze the packets and
send them towards the destination after doing necessary protocol conversion. Most
networking equipments, other than the end systems (desktop computers) we use to access the
networks, are embedded systems.
Telecommunications:
Dept.of.ECE 7
In the field of telecommunications, the embedded systems can be categorized as subscriber
terminals and network equipment. The subscriber terminals such as key telephones, ISDN
phones, terminal adapters, web cameras are embedded systems. The network equipment
includes multiplexers, multiple access systems, Packet Assemblers Dissemblers (PADs),
sate11ite modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded
systems that provide very low-cost voice communication over the Internet.
Wireless Technologies:
Advances in mobile communications are paving way for many interesting applications using
embedded systems. The mobile phone is one of the marvels of the last decade of the 20’h
century. It is a very powerful embedded system that provides voice communication while we
are on the move. The Personal Digital Assistants and the palmtops can now be used to access
multimedia service over the Internet. Mobile communication infrastructure such as base
station controllers, mobile switching centers are also powerful embedded systems.
Insemination:
Testing and measurement are the fundamental requirements in all scientific and engineering
activities. The measuring equipment we use in laboratories to measure parameters such as
weight, temperature, pressure, humidity, voltage, current etc. are all embedded systems. Test
equipment such as oscilloscope, spectrum analyzer, logic analyzer, protocol analyzer, radio
communication test set etc. are embedded systems built around powerful processors. Thank
to miniaturization, the test and measuring equipment are now becoming portable facilitating
easy testing and measurement in the field by field-personnel.
Security:
Security of persons and information has always been a major issue. We need to protect our
homes and offices; and also the information we transmit and store. Developing embedded
systems for security applications is one of the most lucrative businesses nowadays. Security
devices at homes, offices, airports etc. for authentication and verification are embedded
systems. Encryption devices are nearly 99 per cent of the processors that are manufactured
end up in~ embedded systems. Embedded systems find applications in every industrial
segment- consumer electronics, transportation, avionics, biomedical engineering,
manufacturing, process control and industrial automation, data communication,
telecommunication, defense, security etc. Used to encrypt the data/voice being transmitted on
communication links such as telephone lines. Biometric systems using fingerprint and face
recognition are now being

Dept.of.ECE 8
extensively used for user authentication in banking applications as well as for access control
in high security buildings.
Finance:
Financial dealing through cash and cheques are now slowly paving way for transactions using
smart cards and ATM (Automatic Teller Machine, also expanded as Any Time Money)
machines. Smart card, of the size of a credit card, has a small micro-controller and memory;
and it interacts with the smart card reader! ATM machine and acts as an electronic wallet.
Smart card technology has the capability of ushering in a cashless society. Well, the list goes
on. It is no exaggeration to say that eyes wherever you go, you can see, or at least feel, the
work of an embedded system.

Dept.of.ECE 9
Overview of Embedded System Architecture
Every embedded system consists of custom-built hardware built around a Central Processing
Unit (CPU). This hardware also contains memory chips onto which the software is loaded.
The software residing on the memory chip is also called the ‘firmware’. The embedded
system architecture can be represented as a layered architecture as shown in Fig. The
operating system runs above the hardware, and the application software runs above the
operating system. The same architecture is applicable to any computer including a desktop
computer. However, there are significant differences. It is not compulsory to have an
operating system in every embedded system. For small appliances such as remote control
units, air conditioners, toys etc., there is no need for an operating system and you can write
only the software specific to that application. For applications involving complex processing,
it is advisable to have an operating system. In such a case, you need to integrate the
application software with the operating system and then transfer the entire software on to the
memory chip. Once the software is transferred to the memory chip, the software will continue
to run for a long time you don’t need to reload new software.

Fig 2.1a Overview of Embedded System Architecture

Now, let us see the details of the various building blocks of the hardware of an embedded
system. As shown in Fig. the building blocks are;
· Central Processing Unit (CPU)
· Memory (Read-only Memory and Random Access Memory)
· Input Devices

Dept.of.ECE 10
· Output devices
· Communication interfaces
· Application-specific circuitry

Fig 2.1b block diagram of CPU


Central Processing Unit (CPU):
The Central Processing Unit (processor, in short) can be any of the following:
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is a
low-cost processor. Its main attraction is that on the chip itself, there will be many other
components such as memory, serial communication interface, analog-to digital converter etc.
So, for small applications, a micro-controller is the best choice as the number of external
components required will be very less. On the other hand, microprocessors are more
powerful, but you need to use many external components with them. D5P is used mainly for
applications in which signal processing is involved such as audio and video processing.
Memory:
The memory is categorized as Random Access Memory (RAM) and Read Only Memory
(ROM). The contents of the RAM will be erased if power is switched off to the chip, whereas
ROM retains the contents even if the power is switched off. So, the firmware is stored in the
ROM. When power is switched on, the processor reads the ROM; the program is program is
executed.
Input Devices:
Unlike the desktops, the input devices to an embedded system have very limited capability.
There will be no keyboard or a mouse, and hence interacting with the embedded system is no
easy task. Many embedded systems will have a small keypad-you press one key to give a
specific command. A keypad may be used to input only the digits. Many embedded systems

Dept.of.ECE 11
used in process control do not have any input device for user interaction; they take inputs from
sensors or transducers 1’fnd produce electrical signals that are in turn fed to other systems.
Output Devices:
The output devices of the embedded systems also have very limited capability. Some
embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the health status
of the system modules, or for visual indication of alarms. A small Liquid Crystal Display
(LCD) may also be used to display some important parameters.

Communication Interfaces:
The embedded systems may need to, interact with other embedded systems at they may have
to transmit data to a desktop. To facilitate this, the embedded systems are provided with one
or a few communication interfaces such as RS232, RS422, RS485, Universal Serial Bus
(USB), IEEE 1394, Ethernet etc.
Application-Specific Circuitry:
Sensors, transducers, special processing and control circuitry may be required fat an
embedded system, depending on its application. This circuitry interacts with the processor to
carry out the necessary work. The entire hardware has to be given power supply either
through the 230 volts main supply or through a battery. The hardware has to design in such a
way that the power consumption is minimized.

2.2 BLOCK DIAGRAM

Dept.of.ECE 12
Power Supply

IOT
Ultrasonic Sensor OLED

Rain Sensor Microcontroller GSM

Water Level Sensor Buzzer

Fig 2.2 block diagram of Monitering and warning of flooding conditions using IOT based
system

Dept.of.ECE 13
2.3 MODULES:
2.3.1 POWER SUPPLY
The power supply section is the section which provide +5V for the components to work.
IC LM7805 is used for providing a constant power of +5V.
The ac voltage, typically 220V, is connected to a transformer, which steps down that ac
voltage down to the level of the desired dc output. A diode rectifier then provides a full-wave
rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage.
This resulting dc voltage usually has some ripple or ac voltage variation.
A regulator circuit removes the ripples and also retains the same dc value even if the input dc
voltage varies, or the load connected to the output dc voltage changes. This voltage regulation
is usually obtained using one of the popular voltage regulator IC units.

Fig 2.3 Block Diagram Of Power Supply


2.3.2 Transformer
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains electricity
is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in
India) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. Transformers waste very little
power so the power out is (almost) equal to the power in. Note that as voltage is stepped
down current is stepped up.
The transformer will step down the power supply voltage (0-230V) to (0- 6V) level. Then the
secondary of the potential transformer will be connected to the bridge rectifier, which is
constructed with the help of PN junction diodes. The advantages of using bridge rectifier are
it will give peak voltage output as DC.

Dept.of.ECE 14
2.3.3 Rectifier
There are several ways of connecting diodes to make a rectifier to convert AC to DC.
The bridge rectifier is the most important and it produces full-wave varying DC. A full-wave
rectifier can also be made from just two diodes if a centre-tap transformer is used, but this
method is rarely used now that diodes are cheaper. A single diode can be used as a rectifier
but it only uses the positive (+) parts of the AC wave to produce half-wave varying Dc

2.3.4 Bridge Rectifier


When four diodes are connected as shown in figure, the circuit is called as bridge
rectifier. The input to the circuit is applied to the diagonally opposite corners of the network,
and the output is taken from the remaining two corners. Let us assume that the transformer is
working properly and there is a positive potential, at point A and a negative potential at point
B. the positive potential at point A will forward bias D3 and reverse bias D4.

Fig 2.4 Bridge Rectifier


The negative potential at point B will forward bias D1 and reverse D2. At this time D3 and
D1 are forward biased and will allow current flow to pass through them; D4 and D2 are
reverse biased and will block current flow.
One advantage of a bridge rectifier over a conventional full-wave rectifier is that with a given
transformer the bridge rectifier produces a voltage output that is nearly twice that of the
conventional full-wave circuit.
i. The main advantage of this bridge circuit is that it does not require a special centre tapped
transformer, thereby reducing its size and cost.
ii. The single secondary winding is connected to one side of the diode bridge network and the
load to the other side as shown below.
iii. The result is still a pulsating direct current but with double the frequency.

Dept.of.ECE 15
Fig 2.5 Output Waveform Of DC

Smoothing
Smoothing is performed by a large value electrolytic capacitor connected across the
DC supply to act as a reservoir, supplying current to the output when the varying DC voltage
from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC,
and then discharges as it supplies current to the output.
2.3.5 Voltage Regulators
Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the
circuitry for reference source, comparator amplifier, control device, and overload protection
all in a single IC. IC units provide regulation of either a fixed positive voltage, a fixed
negative voltage, or an adjustably set voltage. The regulators can be selected for operation
with load currents from hundreds of milli amperes to tens of amperes, corresponding to
power ratings from milli watts totens of watts.
A fixed three-terminal voltage regulator has an unregulated dc input voltage, Vi, applied to
one input terminal, a regulated dc output voltage, Vo, from a second terminal, with the third
terminal connected to ground.
The series 78 regulators provide fixed positive regulated voltages from 5 to 24 volts.
Similarly, the series 79 regulators provide fixed negative regulated voltages from 5 to 24
volts. Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable
output voltages. They are also rated by the maximum current they can pass. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current ('overload protection') and overheating ('thermal
protection').
Many of the fixed voltage regulator ICs has 3 leads and look like power transistors, such as
the 7805 +5V 1Amp regulator. They include a hole for attaching a heat sink if necessary.

Dept.of.ECE 16
Fig 2.6 Regulator

Fig 2.7 Circuit Diagram Of Power Supply

Dept.of.ECE 17
2.4 MICROCONTROLLER
2.4.1 RASPBERRY PI PICO W

Fig 2.8 Raspberry pi pico


Raspberry Pi Pico W is Raspberry Pi's first wireless microcontroller board, designed
especially for physical computing. It is the successor of the popular Raspberry Pi Pico
board. Similar to the Pico board, which we discussed earlier, the Pico W board is also built
around the Raspberry Foundation in-house ARM chip RP2040. The main improvement is
the addition .of Wi-Fi and Bluetooth functionality. Raspberry Pi Pico W incorporates an
Infineon CYW43439 wireless chip that supports IEEE 802.11 b/g/n wireless LAN, and
Bluetooth 5.2.

Raspberry Pi Pico Vs Raspberry Pi Pico W


The main difference between the Pico and Pico W is the inclusion of Infineon’s CYW43439
2.4-GHz Wi-Fi chip, which is responsible for WiFi and Bluetooth. Another major change is
with the power section. The new Pico W uses the RT6154A from Richtek as the power
regulator instead of the RT6150B in the original Pico design. The debug port also moved
near the SoC to make space for the Wi-Fi antenna.

Dept.of.ECE 18
How to power Pi Pico W?
To power the Pico W, you can either use the USB port or VSYS pin.
 The simplest way is to use the USB port(5V). This 5V can also be accessed from
the VBUS pin for external components.
 Another way is to use the VSYS pin (1.8 V-5.5 V) which can be connected to a battery
or other similar power source. This input voltage is then converted to a suitable 3.3 V by
an onboard voltage regulator.

How to program the Pi Pico W?


The new Pico W can be programmed using C/C++ and MicroPython. You can use Thonny
IDE for micro python programming. The Pico W board can also be programmed with
the Arduino IDE.

2.4.2 Raspberry Pi Pico W Specifications:

The key features of Raspberry Pi Pico W are the following:


 RP2040 microcontroller chip designed by Raspberry Pi in
 Dual-core ARM Cortex M0+ processor, flexible clock running up to 133 MHz
 264kB of SRAM, and 2MB of onboard Flash memory
 On-board single-band 2.4GHz wireless interfaces (802.11n)
 Castellated module allows soldering directly to carrier boards
 USB 1.1 Host and Device support
 Low-power sleep and dormant modes
 Drag & drop programming using mass storage over USB
 26 multi-function GPIO pins
 2×SPI, 2×I2C, 2×UART, 3×12-bit ADC, 16×controllable PWM channels
 Accurate clock and timer on-chip
 Temperature sensor
 Accelerated floating point libraries on-chip
 8×Programmable IO (PIO) state machines for custom peripheral support

Dept.of.ECE 19
2.4.3 RASPBERRY PI PICO W PINOUT

Fig 2.9 Raspberry pi pico w pinout


Raspberry Pi Pico W is pin-to-pin compatible with the older Pico board and has a total of 40
Pins out of which 26 are multipurpose GPIOs. These 26 digital input and output pins are
labeled as GP0, GP1, and so on up to GP28. Out of these 30 pins, GP23, GP24, GP25, and
GP29 are not exposed on the header, hence we only get a total of 26 GPIO pins. All GPIOs
are operating at a 3.3V logic level. Apart from these pins, Pico w also offers a 3-Pin header
for debug interface which is located near the RP2040 Chip.

Dept.of.ECE 20
Raspberry Pi Pico W Power Supply Pinout:
Raspberry Pi Pico and Pico W include the following power pins:
 VBUS (PIN 40): This pin is connected to the micro-USB port and allows the Pico W
to be powered through. It accepts a voltage range of 4.5V to 5.5V
 VSYS (PIN 39): Pin for main system input voltage. The input voltage can vary between
1.8V to 5.5V. This voltage is used by the onboard SMPS to generate 3.3V to power
the RP2040 microcontroller and GPIOs.
 3V3_EN (PIN 37): Used to enable the onboard SMPS for 3.3V. It is pulled high to
the VSYS pin using a 100kΩ resistor.
 3V3(OUT) (PIN 36): Outputs a regulated 3.3V voltage that can be used to power
external components such as sensors. The datasheet recommends keeping the
maximum load current from this pin to be under 300mA.
 GND: These pins provide the reference ground for the Pico W and connected devices.
There are 8 GND pins available on the edge pinouts of Pico, all serving the same
purpose.
 ADC_VREF (PIN 35): The ADC power supply & reference voltage pin that gets
filtered 3.3V from the onboard SMPS.
 AGND (PIN 33): Ground reference pin for ADC.
 RUN (PIN 30): Enable pin for the RP2040 microcontroller. It is internally pulled up to
3.3V. It can be used to reset the Raspberry Pi Pico.
The VBUS voltage is fed through a Schottky diode to generate VSYS. If the USB port is not
used, you can safely power Pico by connecting VSYS to a DC power source with a supply
voltage in the range of ~1.8V to 5.5V. For example, you can use a single Li-ion battery
(~3.7V) or 2/3 AA batteries in series to power your Pico.

Dept.of.ECE 21
Debug Pins:
The following debug pins are available in Pico: SWDIO, GND, and SWCLK. Through these
pins, we can access the Serial Wire Debug(SWD) interface in RP2040. Using SWD, we can
reset, load, and run code on our microcontroller. Debug pins can help us find faults in code
by executing the code line by line or by giving us information on the contents of internal
registers. On Raspberry Pi Pico, the debug pins are located towards the bottom of the board.
In Pico W, the debug pins are below the RP2040 microcontroller.

Raspberry Pi Pico W Digital I/O Pinout:


The Pico W board provides 26 General Purpose Input/Output (GPIO) pins that can be
accessed using the header pins. The pins are 3.3V compatible. For input/output voltages that
are more than 3.3V, one can use a logic level converter to shift the voltage to safe levels. The
digital pins in Raspberry Pi Pico W are GPIO0 to GPIO22 and GPIO26 to GPIO28.
All GPIO pins can also be configured as interrupt pins for external input. Refer to
our Raspberry Pi Pico Interrupts Guide to learn more.

Raspberry Pi Pico & Pico W Analog Input/ ADC Pinout:


Besides being digital I/O pins, GPIO26 to GPIO28 can also be used as ADC input pins to
sense analog voltages. The ADC pins can read voltages between 0 V to 3.3 V.
A total of 5 ADC (Analog-to-Digital Converter) channels are available on the RP2040
microcontroller onboard Pico. An internal temperature sensor is coupled to one of the ADC
channels. Through GPIO26, GPIO27, GPIO28, and GPIO29, respectively, you may access
ADC0, ADC1, ADC2, and ADC3. However, GPIO29 is a special function pin and is not
accessible through the GPIO pads.

Dept.of.ECE 22
The following table shows the GPIOs and the corresponding ADC channels we
can access through the pinout.

ADC Channel GPIO

ADC 0 GPIO 26

ADC 1 GPIO 27

ADC 2 GPIO 28

Table 2.1 GPIOs and ADC channels


RPi Pico & Pico W PWM Pinout:
The RP2040 in Raspberry Pi Pico has 8 identical slices of PWM block. Each slice can
monitor the frequency or duty cycle of an input signal as well as produce two PWM output
signals. So, there are 16 controllable PWM outputs. The PWM block may operate each of the
26 available GPIO pins onboard the Raspberry Pi Pico.
The pinout diagram below shows how the PWM pins are arranged.

Fig 2.10 rpi pico& pico w pwm pinout

Dept.of.ECE 23
A PWM channel may control multiple GPIOs. The table below shows how the PWM
channels relates to the GPIOs.

PWM Channel GPIO

0A GPIO 0, GPIO 16

0B GPIO 1, GPIO 17

1A GPIO 2, GPIO 18

1B GPIO 3, GPIO 19

2A GPIO 4, GPIO 20

2B GPIO 5, GPIO 21

3A GPIO 6, GPIO 22

3B GPIO 7

4A GPIO 8

4B GPIO 9

5A GPIO 10, GPIO 26

5B GPIO 11, GPIO 27

6A GPIO 12, GPIO 28

6B GPIO 13

7A GPIO 14

7B GPIO 15

Dept.of.ECE 24
Table 2.2 PWM channels relates to the GPIOs.

Raspberry Pi Pico SPI Pinout:


The Pico has 2 SPI peripherals with a programmable clock rate and programmable data size.
The two SPI peripherals are named as SPIO & SPI1.
The SPI Pin names can be interpreted as:
 SPI SCK: Pin for clock signal to synchronize serial data.
 SPI RX: SPI pin for transmitting data.
 SPI TX: SPI pin for receiving data.
 SPI CSn: Chip Select signal pin.

Special Function Pins:


Some pins are used for some special functions in Pico boards. They are not available for user
interfacing through the DIP pins on the left and right edges of the board.
The following pins are for internal board functions in RPi Pico:

Pin Function

GPIO23 Controls the on-board SMPS power save pin.

GPIO24 Senses voltage at VBUS pin – high if VBUS is present, else low.

GPIO25 Connected to onboard LED.

GPIO29 Used in ADC mode (ADC3) to measure VSYS/3.

Table 2.3 Internal board functions in RPi Pico


The special function pins in RPi Pico W are:

Pin Function

GPIO23 Output(OP) pin for wireless power-on signal.

GPIO24 OP/IP pin for wireless SPI data/IRQ.

Dept.of.ECE 25
Pin Function

OP wireless SPI CS pin – when high it also enables GPIO29 ADC pin
GPIO25
to read VSYS.

GPIO29 OP/IP wireless SPI CLK/ADC mode (ADC3) to measure VSYS/3.

Table 2.4 special function pins in RPi Pico W

The GPIOs of the Infineon CYW4343 wireless chip onboard Pico W also provide some
onboard functions:

Pin Function

WL_GPIO0 Connects to the onboard LED.

WL_GPIO1 Controls the on-board SMPS power save pin.

WL_GPIO2 Senses voltage at VBUS pin – high if VBUS is present, else low.

Table 2.5 GPIOs of the Infineon CYW4343

Dept.of.ECE 26
2.5 OLED (Organic Light Emitting Diodes)
OLED (Organic Light Emitting Diodes) is a flat light emitting technology, made by placing a
series of organic thin films between two conductors. When electrical current is applied, a
bright light is emitted. OLEDs are emissive displays that do not require a backlight and so are
thinner and more efficient than LCD displays (which do require a white backlight).
OLED displays are not just thin and efficient - they provide the best image quality ever and
they can also be made transparent, flexible, foldable and even rollable and stretchable in the
future. OLEDs represent the future of display technology!

OLED vs LCD
An OLED display have the following advantages over an LCD display:
 Improved image quality - better contrast, higher brightness, fuller viewing angle, a wider
color range and much faster refresh rates.
 Lower power consumption.
 Simpler design that enables ultra-thin, flexible, foldable and transparent displays
 Better durability - OLEDs are very durable and can operate in a broader temperature range

Fig 2.11 OLED and LCD display


The future - flexible and transparent OLED displays
As we said, OLEDs can be used to create flexible and transparent displays. This is pretty
exciting as it opens up a whole world of possibilities:
 Curved OLED displays, placed on non-flat surfaces
 Wearable OLEDs

Dept.of.ECE 27
 Foldable OLEDs and rollable OLEDs which can be used to create new mobile devices
 Transparent OLEDs embedded in windows or car windshdields
 And many more we cannot even imagine today...
Flexible OLEDs are already on the market for many years (in smartphones, wearables and
other devices) and since 2019, with the introduction of the Samsung Galaxy Fold, foldable
devices are increasing in popularity. In 2019 LG also announced the world's first rollable
OLED - its 65" OLED R TV that can roll into its base!
An OLED is made by placing a series of organic thin films between two conductors. When
electrical current is applied, a bright light is emitted. Click here for a more detailed view of
the OLED technology.
OLEDs are organic because they are made from carbon and hydrogen. There's no connection
to organic food or farming - although OLEDs are very efficient and do not contain any bad
metals - so it's a real green technology.
OLED is the best display technology - and indeed OLED panels are used today to create the
most stunning TVs ever - with the best image quality combined with the thinnest sets ever.
And this is only the beginning, as in the future OLED will enable large rollable and
transparent TVs!
Currently the only company that produces OLED TV panels is LG Display. The Korean
display maker is producing a wide range of OLED TV panels, offering these to LG
Electronics, Panasonic, Sony, Philips and others.

OLED white lighting


OLEDs can be used to create excellent light source. OLEDs offer diffuse area lighting and can be flexible,
efficient, light, thin, transparent, color-tunable and more. OLEDs enable new designs and these devices
emit healthier light compared to CFLs and LED lighting devices.

Specifications
 Use CHIP No.SH1106
 Use 3.3V-5V POWER SUPPLY
 Graphic LCD 1.3” in width with 128x64 Dot Resolution
 White Display is used for the model OLED 1.3 I2C WHITE and blue Display is used
for the model OLED 1.3 I2C BLUE
 Use I2C Interface

Dept.of.ECE 28
 Directly connect signal to Microcontroller 3.3V and 5V without connecting through
Voltage Regulator Circuit
 Total Current when running together is 8 mA - PCB Size: 33.7 mm x 35.5 mm

Table shows name and function of Pin OLED

Table 2.6 Table shows name and function of Pin OLED

Example of connecting with Board Arduino This example illustrates how to connect together
with Board Arduino, in this case, it is Board ET-BASE AVR EASY328. It is used together
with Program Arduino and Library to connect and communicate to Module OLED. - Firstly,
install Library “u8glib”; go to Menu Sketch > Include Library > Add.ZIP Library...

Fig 2.12 OLED white lighting

Dept.of.ECE 29
- Go to Folder Lib_Arduino\u8glib in CD-ROM; next, choose hown in the picture below.

Fig 2.13 Wire circuit

Dept.of.ECE 30
2.6 Internet of things (IoT)
Internet of things (IoT), is another advance technology in IT sector, provides
internetworking for numerous of devices such as sensors, actuators, PLCs and other
electronic embedded smart devices and controls, and various software’s’ and provides
systems network configuration and connectivity, which enables communication between
these numerous devices for information exchanging.
In 1995, “thing to thing” was coined by BILL GATES. In 1999, IoT (Internet of
Things) was come up by EPC global. IOT interconnects human to thing, thing to thing and
human to human. The goal of IoT is bring out a huge network by combining different types
connected devices. IoT targets three aspects Communication, automation, cost saving in a
system. IOT empowers people to carry out routine activities using internet and thus saves
time and cost making them more productive. IOT enables the objects to be sensed and/or
controlled remotely across existing network model. IOT in environmental monitoring helps to
know about the air and water quality, temperature and conditions of the soil, and also monitor
the intrusion of animals in to the field. IOT can also play a significant role in precision
farming to enhance the productivity of the farm.

Recent advancements, such as the vision of the Internet of Things

(IoT), the cloud computing model, and cyber-physical systems, provide

support for the transmission and management of huge amounts of data

regarding the trends observed in environmental parameters. In this

context, the current work presents three different IoT-based wireless

sensors

for environmental and ambient monitoring: one employing User

Datagram Protocol (UDP)-based Wi-Fi communication, one

communicating through Wi-Fi and Hypertext Transfer Protocol (HTTP),

and a third one using Bluetooth Smart. All of the presented systems

provide the possibility of recording data at remote locations and of

visualizing them from every

Dept.of.ECE 31
device with an Internet connection, enabling the monitoring of

geographically large areas. The development details of these systems are

described, along with the major differences and similarities between

them. The feasibility of the three developed systems for implementing

monitoring applications, taking into account their energy autonomy, ease

of use, solution complexity, and Internet connectivity facility, was

analysed, and revealed that they make good candidates for IoT-based

solutions.

Nowadays, IoT is one of the most advanced, efficient, and cost less technological
solution which encompasses various hardware and software resources; and allows remotely
connected sensing devices to sense with more capabilities, provides efficiency and can be
monitored and controlled through deployed of existing systems or infrastructures, resulting
the physical World integration with computer controllers (or systems).

As IoT provides interconnectivity among various real-time sensing sensors and PLC
and other intelligent devices, therefore this technology will be an entity indicated for the more
advance cyber-systems encircling the significant developments, “such as smart grid, smart
vehicle systems, smart medical systems, smart cities, and others smart systems.” In early
future, IoT has striven to provide advance or smart connectivity for variety of electronic and
intelligent equipment’s or devices, IT-based systems and the more advanced services through
deploying of various traditional and real-time protocols, networks domains, and system
software/hardware applications, which will be an work followed by machine-to-machine
technological concept.

Through interconnection of various devices and managing of the internet of


things (IoT) is the network of physical devices, vehicles, buildings and other items
embedded with electronics, software, sensors, actuators, and network connectivity that enable
these objects to collect and exchange data. In 2013 the Global Standards Initiative on Internet
of Things (IoT-GSI) defined the IoT as "the infrastructure of the information society. The IoT
allows objects to be sensed and controlled remotely across existing network
infrastructure, creating opportunities for more direct integration of the physical world into

Dept.of.ECE 32
computer-based systems, and resulting in improved efficiency, accuracy and economic
benefit.

Dept.of.ECE 33
When IoT is augmented with sensors and actuators, the technology becomes an
instance of the more general class of cyber-physical systems, which also encompasses
technologies such as smart grids, smart homes, intelligent transportation and smart cities.
Each thing is uniquely identifiable through its embedded computing system but is able to
interoperate within the existing Internet infrastructure. Experts estimate that the IoT will
consist of almost 50 billion objects by 2020.

IoT is a system defines an environment that encompasses numerous of objects;


sensors that connected with these objects are accessible over the Internet through employing
of various Networks connections, such wired or wireless. IoT can be able to carry
information from various embedded sensors attached with the physical World, human and
any inanimate object, and then transmit them to a system for further analyses. In early future,
IoT will be able to connect almost components or parts of industrial infrastructures, smart
medical tele monitoring systems, and smart transportation systems; and will provide the
information sharing facilities in order to make systems and peoples always updated.

What is the internet of things (IoT)?


The internet of things, or IoT, is a system of interrelated computing devices, mechanical and
digital machines, objects, animals or people that are provided with unique identifiers (UIDs)
and the ability to transfer data over a network without requiring human-to-human or human-
to-computer interaction.
A thing in the internet of things can be a person with a heart monitor implant, a farm animal
with a biochip transponder, an automobile that has built-in sensors to alert the driver when
tire pressure is low or any other natural or man-made object that can be assigned an Internet
Protocol (IP) address and is able to transfer data over a network.
Increasingly, organizations in a variety of industries are using IoT to operate more efficiently,
better understand customers to deliver enhanced customer service, improve decision-making
and increase the value of the business.

How does IoT work?


An IoT ecosystem consists of web-enabled smart devices that use embedded systems, such as
processors, sensors and communication hardware, to collect, send and act on data they
acquire from their environments. IoT devices share the sensor data they collect by connecting
to an IoT gateway or other edge device where data is either sent to the cloud to be analyzed
or analyzed

Dept.of.ECE 34
locally. Sometimes, these devices communicate with other related devices and act on the
information they get from one another. The devices do most of the work without human
intervention, although people can interact with the devices -- for instance, to set them up,
give them instructions or access the data.

The connectivity, networking and communication protocols used with these web-enabled
devices largely depend on the specific IoT applications deployed.
IoT can also make use of artificial intelligence (AI) and machine learning to aid in making
data collecting processes easier and more dynamic.

Fig 2.14 Example of an IOT system

Why is IoT important?


The internet of things helps people live and work smarter, as well as gain complete control
over their lives. In addition to offering smart devices to automate homes, IoT is essential to
business. IoT provides businesses with a real-time look into how their systems really work,
delivering insights into everything from the performance of machines to supply chain and
logistics operations.

Dept.of.ECE 35
IoT enables companies to automate processes and reduce labor costs. It also cuts down on
waste and improves service delivery, making it less expensive to manufacture and deliver
goods, as well as offering transparency into customer transactions.
As such, IoT is one of the most important technologies of everyday life, and it will continue
to pick up steam as more businesses realize the potential of connected devices to keep them
competitive.
What are the benefits of IoT to organizations?
The internet of things offers several benefits to organizations. Some benefits are industry-
specific, and some are applicable across multiple industries. Some of the common benefits of
IoT enable businesses to:
 monitor their overall business processes;
 improve the customer experience (CX);
 save time and money;
 enhance employee productivity;
 integrate and adapt business models;
 make better business decisions; and
 generate more revenue.
IoT encourages companies to rethink the ways they approach their businesses and gives them
the tools to improve their business strategies.
Generally, IoT is most abundant in manufacturing, transportation and utility organizations,
making use of sensors and other IoT devices; however, it has also found use cases for
organizations within the agriculture, infrastructure and home automation industries, leading
some organizations toward digital transformation.
IoT can benefit farmers in agriculture by making their job easier. Sensors can collect data on
rainfall, humidity, temperature and soil content, as well as other factors, that would help
automate farming techniques.
The ability to monitor operations surrounding infrastructure is also a factor that IoT can help
with. Sensors, for example, could be used to monitor events or changes within structural
buildings, bridges and other infrastructure. This brings benefits with it, such as cost saving,
saved time, quality-of-life workflow changes and paperless workflow.
A home automation business can utilize IoT to monitor and manipulate mechanical and
electrical systems in a building. On a broader scale, smart cities can help citizens reduce
waste and energy consumption.

Dept.of.ECE 36
IoT touches every industry, including businesses within healthcare, finance, retail and
manufacturing.

What are the pros and cons of IoT?


Some of the advantages of IoT include the following:
 ability to access information from anywhere at any time on any device;
 improved communication between connected electronic devices;
 transferring data packets over a connected network saving time and money; and
 automating tasks helping to improve the quality of a business's services and reducing
the need for human intervention.
Some disadvantages of IoT include the following:
 As the number of connected devices increases and more information is shared
between devices, the potential that a hacker could steal confidential information also
increases.
 Enterprises may eventually have to deal with massive numbers -- maybe even millions
-- of IoT devices, and collecting and managing the data from all those devices will be
challenging.
 If there's a bug in the system, it's likely that every connected device will become
corrupted.
 Since there's no international standard of compatibility for IoT, it's difficult for
devices from different manufacturers to communicate with each other.

IoT standards and frameworks


There are several emerging IoT standards, including the following:
 IPv6 over Low-Power Wireless Personal Area Networks (6LoWPAN) is an open
standard defined by the Internet Engineering Task Force (IETF). The 6LoWPAN
standard enables any low-power radio to communicate to the internet, including
804.15.4, Bluetooth Low Energy (BLE) and Z-Wave (for home automation).
 ZigBee is a low-power, low-data rate wireless network used mainly in industrial
settings. ZigBee is based on the Institute of Electrical and Electronics Engineers
(IEEE)
802.15.4 standard. The ZigBee Alliance created Dotdot, the universal language for
IoT that enables smart objects to work securely on any network and understand each
other.
Dept.of.ECE 37
 LiteOS is a Unix-like operating system (OS) for wireless sensor networks. LiteOS
supports smartphones, wearables, intelligent manufacturing applications, smart

Dept.of.ECE 38
homes and the internet of vehicles (IoV). The OS also serves as a smart device
development platform.
 OneM2M is a machine-to-machine service layer that can be embedded in software
and hardware to connect devices. The global standardization body, OneM2M, was
created to develop reusable standards to enable IoT applications across different
verticals to communicate.
 Data Distribution Service (DDS) was developed by the Object Management Group
(OMG) and is an IoT standard for real-time, scalable and high-
performance M2M communication.
 Advanced Message Queuing Protocol (AMQP) is an open source published
standard for asynchronous messaging by wire. AMQP enables encrypted and
interoperable messaging between organizations and applications. The protocol is used
in client- server messaging and in IoT device management.
 Constrained Application Protocol (CoAP) is a protocol designed by the IETF that
specifies how low-power, compute-constrained devices can operate in the internet of
things.
 Long Range Wide Area Network (LoRaWAN) is a protocol for WANs designed to
support huge networks, such as smart cities, with millions of low-power devices.

IoT frameworks include the following:


 Amazon Web Services (AWS) IoT is a cloud computing platform for IoT released
by Amazon. This framework is designed to enable smart devices to easily connect and
securely interact with the AWS cloud and other connected devices.
 Arm Mbed IoT is a platform to develop apps for IoT based on Arm microcontrollers.
The goal of the Arm Mbed IoT platform is to provide a scalable, connected and secure
environment for IoT devices by integrating Mbed tools and services.
 Microsoft's Azure IoT Suite is a platform that consists of a set of services that
enables users to interact with and receive data from their IoT devices, as well as
perform various operations over data, such as multidimensional analysis,
transformation and aggregation, and visualize those operations in a way that's suitable
for business.
 Google's Brillo/Weave is a platform for the rapid implementation of IoT
applications. The platform consists of two main backbones: Brillo, an Android-based
OS for the development of embedded low-power devices, and Weave, an
IoT-oriented
Dept.of.ECE 39
communication protocol that serves as the communication language between the
device and the cloud.
 Calvin is an open source IoT platform released by Ericsson designed for building and
managing distributed applications that enable devices to talk to each other. Calvin
includes a development framework for application developers, as well as a runtime
environment for handling the running application.

Consumer and enterprise IoT applications


There are numerous real-world applications of the internet of things, ranging from consumer
IoT and enterprise IoT to manufacturing and industrial IoT (IIoT). IoT applications span
numerous verticals, including automotive, telecom and energy.
In the consumer segment, for example, smart homes that are equipped with smart
thermostats, smart appliances and connected heating, lighting and electronic devices can be
controlled remotely via computers and smartphones.
Wearable devices with sensors and software can collect and analyze user data, sending
messages to other technologies about the users with the aim of making users' lives easier and
more comfortable. Wearable devices are also used for public safety -- for example, improving
first responders' response times during emergencies by providing optimized routes to a
location or by tracking construction workers' or firefighters' vital signs at life-threatening
sites.
In healthcare, IoT offers many benefits, including the ability to monitor patients more closely
using an analysis of the data that's generated. Hospitals often use IoT systems to complete
tasks such as inventory management for both pharmaceuticals and medical instruments.
Smart buildings can, for instance, reduce energy costs using sensors that detect how many
occupants are in a room. The temperature can adjust automatically -- for example, turning the
air conditioner on if sensors detect a conference room is full or turning the heat down if
everyone in the office has gone home.
In agriculture, IoT-based smart farming systems can help monitor, for instance, light,
temperature, humidity and soil moisture of crop fields using connected sensors. IoT is also
instrumental in automating irrigation systems.
In a smart city, IoT sensors and deployments, such as smart streetlights and smart meters, can
help alleviate traffic, conserve energy, monitor and address environmental concerns, and
improve sanitation.

Dept.of.ECE 40
IoT security and privacy issues
The internet of things connects billions of devices to the internet and involves the use of
billions of data points, all of which need to be secured. Due to its expanded attack surface,
IoT security and IoT privacy are cited as major concerns.
In 2016, one of the most notorious recent IoT attacks was Mirai, a botnet that infiltrated
domain name server provider Dyn and took down many websites for an extended period of
time in one of the biggest distributed denial-of-service (DDoS) attacks ever seen. Attackers
gained access to the network by exploiting poorly secured IoT devices.
Because IoT devices are closely connected, all a hacker has to do is exploit one vulnerability
to manipulate all the data, rendering it unusable. Manufacturers that don't update their devices
regularly -- or at all -- leave them vulnerable to cybercriminals.
Additionally, connected devices often ask users to input their personal information, including
names, ages, addresses, phone numbers and even social media accounts -- information that's
invaluable to hackers.
Hackers aren't the only threat to the internet of things; privacy is another major concern for
IoT users. For instance, companies that make and distribute consumer IoT devices could use
those devices to obtain and sell users' personal data.
Beyond leaking personal data, IoT poses a risk to critical infrastructure, including electricity,
transportation and financial services.

Dept.of.ECE 41
2.7 ULTRASONIC SENSOR
Ultrasonic sensors are industrial control devices that use sound waves above 20,000
Hz, beyond the range of human hearing, to measure and calculate distance from the sensor to
a specified target object.

Features of ultrasonic sensors:


 Devices with TEACH-IN functionality for fast and simple installation
 ULTRA 3000 software for improved adaptation of sensors to applications
 Adjustable sensitivity to the sound beam width for optimized adjustment of the sensor
characteristics according to the application
 Temperature compensation - compensates for sound velocity due to varying air
temperatures
 Synchronization input to prevent cross-talk interference when sensors are mounted
within close proximity of each other
 Sensors with digital and/ or analog outputs

Description:
Ultrasonic sensors use electrical energy and a ceramic transducer to emit and receive
mechanical energy in the form of sound waves. Sound waves are essentially pressure waves
that travel through solids, liquids and gases and can be used in industrial applications to
measure distance or detect the presence or absence of targets
Ultrasonic sensors (also known as transceivers when they both send and receive) work
on a principle similar to radar or sonar which evaluate attributes of a target by interpreting the
echoes from radio or sound waves respectively. Ultrasonic sensors generate high frequency
sound waves and evaluate the echo which is received back by the sensor. Sensors calculate
the time interval between sending the signal and receiving the echo to determine the distance
to an object.
This technology can be used for measuring: wind speed and direction (anemometer),
fullness of a tank, and speed through air or water. For measuring speed or direction a device
uses multiple detectors and calculates the speed from the relative distances to particulates in
the air or water. To measure the amount of liquid in a tank, the sensor measures the distance
to the surface of the fluid. Further applications include: humidifiers, sonar, medical
ultrasonography, burglar alarms, and non-destructive testing.

Dept.of.ECE 42
Fig 2.15 Block Diagram of Ultrasonic Sensor
Systems typically use a transducer which generates sound waves in the ultrasonic range,
above 20,000 hertz, by turning electrical energy into sound, then upon receiving the echo turn
the sound waves into electrical energy which can be measured and displayed.
The technology is limited by the shapes of surfaces and the density or consistency of
the material. For example foam on the surface of a fluid in a tank could distort a reading.

Transducers
Sound field of a non focusing 4MHz ultrasonic transducer with a near field length of
N=67mm in water. The plot shows the sound pressure at a logarithmic db-scale. Sound
pressure field of the same ultrasonic transducer (4MHz, N=67mm) with the transducer
surface having a spherical curvature with the curvature radius R=30mm
An ultrasonic transducer is a device that converts energy into ultrasound, or sound
waves above the normal range of human hearing. While technically a dog whistle is an
ultrasonic transducer that converts mechanical energy in the form of air pressure into
ultrasonic sound waves, the term is more apt to be used to refer to piezoelectric transducers
that convert electrical energy into sound. Piezoelectric crystals have the property of changing
size when a voltage is applied, thus applying an alternating current (AC) across them causes
them to oscillate at very high frequencies, thus producing very high frequency sound waves.
The location, at which a transducer focuses the sound, can be determined by the active
transducer area and shape, the ultrasound frequency and the sound velocity of the
propagation medium.

Dept.of.ECE 43
The example shows the sound fields of an unfocused and a focusing ultrasonic transducer
in water.

Range
This ultrasonic rangefinder can measure distances up to 2.5 meters at accuracy of 1 centi-
meter.

Working
The sensor has a ceramic transducer that vibrates when electrical energy is applied to it. The
vibrations compress and expand air molecules in waves from the sensor face to a target
object. A transducer both transmits and receives sound. The ultrasonic sensor will measure
distance by emitting a sound wave and then "listening" for a set period of time, allowing for
the return echo of the sound wave bouncing off the target, before retransmitting.
Microcontroller and the ultrasonic transducer module HC-SR04 forms the basis of
this circuit. The ultrasonic module sends a signal to the object, then picks up its echo and
outputs a wave form whose time period is proportional to the distance. The microcontroller
accepts this signal, performs necessary processing and displays the corresponding distance on
the 3 digit seven segment display. This circuit finds a lot of application in projects like
automotive parking sensors, obstacle warning systems, terrain monitoring robots, industrial
distance measurements etc.
It has a resolution of 0.3cm and the ranging distance is from 2cm to 500cm. It
operates from a 5V DC supply and the standby current is less than 2mA. The module
transmits an ultrasonic signal, picks up its echo, measures the time elapsed between the two
events and outputs a waveform whose high time is modulated by the measured time which is
proportional to the distance.

The supporting circuits fabricated on the module makes it almost stand alone and what the
programmer need to do is to send a trigger signal to it for initiating transmission and receive
the echo signal from it for distance calculation.
The HR-SR04 has four pins namely Vcc, Trigger, Echo, GND and they are explained in
detail below.

Dept.of.ECE 44
Fig 2.16 Pin: Pin Description and View of Ultrasonic Sensor
1) VCC : 5V DC supply voltage is connected to this pin.
2) Trigger: The trigger signal for starting the transmission is given to this pin. The
trigger signal must be a pulse with 10uS high time. When the module receives a valid
trigger signal it issues 8 pulses of 40KHz ultrasonic sound from the transmitter. The
echo of this sound is picked by the receiver.
3) Echo: At this pin, the module outputs a waveform with high time proportional to the
distance.
4) GND: Ground is connected to this pin.
The transmitter part of the circuit is build around IC1(NE 555).The IC1 is wired as an
astable multi vibrator operating at 40KHz.The output of IC1 is amplifier the complementary
pair of transistors ( Q1 & Q2) and transmitted by the ultrasonic transmitter K1.The push
button switch S1 is used the activate the transmitter.
The receiver uses an ultrasonic sensor transducer (K2) to sense the ultrasonic signals.
When an ultrasonic signal is falling on the sensor, it produces a proportional voltage signal at
its output. This weak signal is amplified by the two stage amplifier circuit comprising of
transistors Q3 and Q4.The output of the amplifier is rectified by the diodes D3 & D4.The
rectified signal is given to the inverting input of the opamp which is wired as a comparator.
Whenever there is an ultrasonic signal falling on the receiver, the output of the comparator
activates the transistors Q5 & Q6 to drive the relay. In this way the load connected via the
relay can be switched. The diode D5 is used as a free-wheeling diode.

Detectors
Since piezoelectric crystal generate a voltage when force is applied to them, the same
crystal can be used as an ultrasonic detector. Some systems use separate transmitter and
receiver components while others combine both in a single piezoelectric transceiver.

Dept.of.ECE 45
Alternative methods for creating and detecting ultrasound include magnetostriction
and capacitive actuation.

Application
Ultrasonic sensors use sound waves rather than light, making them ideal for stable
detection of uneven surfaces, liquids, clear objects, and objects in dirty environments. These
sensors work well for applications that require precise measurements between stationary and
moving objects.
Ultrasonic sensor provides a very low-cost and easy method of distance measurement.
This sensor is perfect for any number of applications that require you to perform
measurements between moving or stationary objects. Naturally, robotics applications are very
popular but it is also find in product which is useful in security systems or as an infrared
replacement if so desired.

Use in medicine
Medical ultrasonic transducers (probes) come in a variety of different shapes and sizes
for use in making pictures of different parts of the body. The transducer may be passed over
the surface of the body or inserted into an body opening such as the rectum or vagina.
Clinicians who perform ultrasound-guided procedures often use a probe positioning system to
hold the ultrasonic transducer.
Use in industry
Ultrasonic sensors are used to detect the presence of targets and to measure the
distance to targets in many automated factories and process plants. Sensors with an on or off
digital output are available for detecting the presence of objects, and sensors with an analog
output which varies proportionally to the sensor to target separation distance are
commercially available.
Other types of transducers are used in commercially available ultrasonic cleaning
devices. An ultrasonic transducer is affixed to a stainless steel pan which is filled with a
solvent (frequently water or isopropanol) and a square wave is applied to it, imparting
vibrational energy on the liquid.

Application In Industries
 Measurement of dynamically changing diameters

Dept.of.ECE 46
 Measurement of dynamically changing distances
 Measurement of dynamically changing heights
 Measurement of dynamically changing depths
 Counting number of units.

Dept.of.ECE 47
2.8 RAIN SENSOR MODULE
Description
The rain sensor module is an easy tool for rain detection. It can be used as a switch when
raindrop falls through the raining board and also for measuring rainfall intensity. The module
features, a rain board and the control board that is separate for more convenience, power
indicator LED and an adjustable sensitivity though a potentiometer.
The analog output is used in detection of drops in the amount of rainfall. Connected to 5V
power supply, the LED will turn on when induction board has no rain drop, and DO output is
high. When dropping a little amount water, DO output is low, the switch indicator will turn
on. Brush off the water droplets, and when restored to the initial state, outputs high level.

Specifications
Adopts high quality of RF-04 double sided material.
Area: 5cm x 4cm nickel plate on side,
Anti-oxidation, anti-conductivity, with long use time;
Comparator output signal clean waveform is good, driving ability, over 15mA;
Potentiometer adjust the sensitivity;
Working voltage 5V;
Output format: Digital switching output (0 and 1) and analog voltage output AO;
With bolt holes for easy installation;
Small board PCB size: 3.2cm x 1.4cm;
Uses a wide voltage LM393 comparator

Dept.of.ECE 48
2.9 WATER LEVEL SENSOR
What is a water level sensor?
The water level sensor is a device that measures the liquid level in a fixed container that is
too high or too low. According to the method of measuring the liquid level, it can be divided
into two types: contact type and non-contact type. The input type water level transmitter we
call is a contact measurement, which converts the height of the liquid level into an electrical
signal for output. It is currently a widely used water level transmitter.

Fig 2.17 Water level sensor

How does the water level sensor work?


The working principle of the water level sensor is that when it is put into a certain depth in
the liquid to be measured, the pressure on the sensor’s front surface is converted into the
liquid level height. The calculation formula is Ρ=ρ.g.H+Po, in the formula P is the pressure
on the liquid surface of the sensor, ρ is the density of the liquid to be measured, g is the local
acceleration of gravity, Po is the atmospheric pressure on the liquid surface, and H is the
depth at which the sensor drops into the liquid.

Where to use water level sensors?


The uses of water level sensors include the following applications:
1. Water level measurement of pools and water tanks
2. Water level measurement of rivers and lakes
3. Marine level measurement

Dept.of.ECE 49
4. Level measurement of acid-base liquids
5. Oil level measurement of oil trucks and mailboxes
6. Swimming pool water level control
7. Tsunami warning and sea-level monitoring
8. Cooling tower water level control
9. Sewage pump level control
10. Remote monitoring of the liquid level

What are the benefits of water level sensors?


1. Simple structure: There are no movable or elastic elements, so the reliability is extremely
high, and there is no need for regular maintenance during use. The operation is simple and
convenient.
2. Convenient installation: When using, first connect one end of the wire correctly, and then
put the other end of the water level probe into the solution to be measured.
3. Ranges are optional: you can measure the water level in the range of 1-200 meters, and
other measurement ranges can also be customized.
4. Wide range of applications: suitable for liquid level measurement of high temperature
and high pressure, strong corrosion, high pollution, and other media. Building an electronic
water level gauge on the river bank can be used for tide monitoring.
5. Wide range of measuring medium: High-precision measurement can be carried out from
the water, oil to paste with high viscosity, and wide-range temperature compensation is not
affected by the foaming, deposition, and electrical characteristics of the measured medium.
6. Long service life: Generally, the liquid level sensor can be used for 4-5 years in a normal
environment, and it can also be used for 2-3 years in a harsh environment.
7. Strong function: It can be directly connected to the digital display meter to display the
value in real-time, or it can be connected to a variety of controllers and set the upper and
lower limits to control the water volume in the container.
8. Accurate measurement: The built-in high-quality sensor has high sensitivity, fast
response, and accurately reflects the subtle changes of the flowing or static liquid level, and
the measurement accuracy is high.

9. Variety of types: liquid level sensors have various structural designs such as input type,
straight rod type, flange type, thread type, inductive type, screw-in type, and float type. It can
meet the measurement needs of all different places.

Dept.of.ECE 50
2.10 BUZZER
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles,
house hold appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches or sensors connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually
illuminates a light on the appropriate button or control panel, and sounds a warning in the
form of a continuous or intermittent buzzing or beeping sound. Initially this device was based
on an electromechanical system which was identical to an electric bell without the metal gong
(which makes the ringing noise). Often these units were anchored to a wall or ceiling and
used the ceiling or wall as a sounding board. Another implementation with some AC-
connected devices was to implement a circuit to make the AC current into a noise loud
enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays,
it is more popular to use a ceramic-based piezoelectric sounder like a Sonalert which makes a
high-pitched tone. Usually these were hooked up to “driver” circuits which varied the pitch of
the sound or pulsed the sound on and off.
In game shows it is also known as a “lockout system,” because when one person signals
(“buzzes in”), all others are locked out from signalling. Several game shows have large
buzzer buttons which are identified as “plungers”.

Fig 2.18 Buzzer


USES
 Annunciator panels
 Electronic metronomes
 Game shows
 Microwave ovens and other household appliances
 Sporting events such as basketball games
 Electrical alarms

Dept.of.ECE 51
CHAPTER 3
SOFTWARE SPECIFICATIONS
3.1 MICRO PYTHON
What is MicroPython?
MicroPython is a full implementation of the Python 3 programming language that runs
directly on embedded hardware like Raspberry Pi Pico. You get an interactive prompt (the
REPL) to execute commands immediately via USB Serial, and a built-in filesystem. The Pico
port of MicroPython includes modules for accessing low-level chip-specific hardware.

THONNY
Python IDE

Fig 3.0 Python IDE


Features

Dept.of.ECE 52
Easy to get started. Thonny comes with
Python 3.10 built in, so just one simple
installer is needed and you're ready to learn
programming. (You can also use a separate
Python installation, if necessary.) The initial
user interface is stripped of all features that
may distract beginners.

Fig 3.1 Features of python

No-hassle variables. Once you're done with


hello-worlds, select View → Variables and
see how your programs and shell commands
affect Python variables.

Fig 3.2 Variables

Simple debugger. Just press Ctrl+F5 instead


of F5 and you can run your programs step-by-
step, no breakpoints needed. Press F6 for a
big step and F7 for a small step. Steps follow
program structure, not just code lines.

Fig 3.3 Simple debug

Step through expression evaluation. If you


use small steps, then you can even see how
Python evaluates your expressions. You can
think of this light-blue box as a piece of paper
Dept.of.ECE 53
where Python replaces subexpressions with
Fig 3.4 Step through expression Step
their values, piece-by-piece.
through expression

Faithful representation of function


calls. Stepping into a function call opens a
new window with separate local variables
table and code pointer. Good understanding of
how function calls work is especially
important for understanding recursion.

Fig 3.5 Representaion of function call

Highlights syntax errors. Unclosed quotes


and parentheses are the most common
beginners' syntax errors. Thonny's editor
makes these easy to spot.

Fig 3.6 Highlights syntax errors

Explains scopes. Highlighting variable


occurrences reminds you that the same name
doesn't always mean the same variable and
helps spotting typos. Local variables are
visually distinguished from globals. Fig3.7:Explains scopes

Dept.of.ECE 54
Mode for explaining references. Variables
are initially presented according to simplified
model (name → value) but you can switch to
more realistic model (name → address/id →
value).

Fig 3.8 Mode of explanation

Code completion. Students can explore APIs


with the help of code completion.

Fig 3.9 Code completion

Beginner friendly system shell. Select Tools


→ Open system shell to install extra packages
or learn handling Python on command line.
PATH and conflicts with other Python
interpreters are taken care of by Thonny.

Fig 3.10 Begginer friendly system

Simple and clean pip GUI. Select Tools →


Manage packages for even easier installation
of 3rd party packages.

Fig 3.11 Simple and clean GUI

Dept.of.ECE 55
Dept.of.ECE 56
How to Set Up the Raspberry Pi Pico / Pico W
1. Download the MicroPython UF2 file for your model of Raspberry Pi Pico.

Fig 3.12 Setting up of raspberry pi


2. Push and hold the BOOTSEL button on the Pico, then connect to your computer using a
micro USB cable. Release BOOTSEL once the drive RPI-RP2 appears on your computer.

Dept.of.ECE 57
Fig 3.13 Push and hold the BOOTSEL
3. Drag and drop the UF2 file on to the RPI-RP2 drive. The Raspberry Pi Pico will reboot
and will now run MicroPython.
MicroPython is a version of Python 3 developed for microcontrollers. If you can write
Python, then you can write MicroPython. To write MicroPython code, we need to use a
dedicated editor and the default, basic editor is Thonny which is
what we shall use for this tutorial.
1. Download and install Thonny for your OS, if you don’t already have it. You can grab it
for free from the Thonny website.
2. Connect the Raspberry Pi Pico to your computer and in Thonny go to Tools >
Options and click on the Interpreter tab. From the interpreter dropdown list select
MicroPython (Raspberry Pi Pico). The port dropdown menu can be left to automatically
detect the Pico. Click Ok to close.

Dept.of.ECE 58
3.14 Connect the Raspberry Pi Pico
The Python Shell (also called REPL, Read, Eval, Print, Loop) will now update to show that
the Pico is connected and working.
3. To test we can write a quick print function to say “Hello World.” Press Enter to run the
code. print(“Hello World”)

Dept.of.ECE 59
Fig 3.15 Drag and drop the UF2 file
How to Blink an LED Light on Raspberry Pi Pico
To further test that we can successfully program the Raspberry Pi Pico, we shall write the
“Hello World” equivalent for hardware projects, flashing an LED. This quick test ensures
that our hardware is working, and it will introduce the MicroPython language and syntax in
the simplest form.
Before we start writing any code, we first need to wire up our test circuit. This will require
header pins to be soldered to the Raspberry Pi Pico. To build this project you will need:
 A half size breadboard
 An LED
 A 330 Ohm resistor (see 330 Ohm resistor color code to identify)
1. Insert the Raspberry Pi Pico into the breadboard so that it sits over the central channel.
Make sure that the Micro USB port is at one end of the breadboard.

Dept.of.ECE 60
Fig 3.16 Inserting raspberry pi
2. Insert a 330 Ohm resistor into the breadboard, one leg should be inline with GND, which
is pin 38. The other leg should be inserted into the - rail of the breadboard. This provides us
with a GND rail where all pins in that rail are connected to GND.

Dept.of.ECE 61
Fig 3.17 Insert a 330 Ohm resistor
3. Insert an LED, with the long leg (the anode) inserted into the breadboard at pin 34, and
the short leg inserted into the GND rail. The circuit is now built.

Fig 3.18 Insert an LED

Dept.of.ECE 62
With the circuit built we can now start writing the code to flash (blink) the LED.

Fig 3.19 Testing LED


4. Import the necessary libraries. Our code is written in the large blank space above the
REPL and we start by importing two MicroPython libraries. The first is the Pin class from the
Machine library, the second is utime, used to control the pace of our code.
from machine import Pin
import utime
5. Create an object, “led” which is used to create a link between the physical GPIO pin and
our code. In this case, it will set GPIO 28 (which maps to physical pin 34 on the board) as an
output pin, where current will flow from the Raspberry Pi Pico GPIO to the LED. We then
use the object to instruct the GPIO pin to pull low.n other words this will ensure that the
GPIO pin is turned off at the start of our project.
led = Pin(28, Pin.OUT)
led.low()
6. Inside of a while True loop, a loop with no end, we toggle the LED on and off, and print a
message to the Python Shell (REPL) to prove that the loop is working. Lastly, we add a sleep
to pause the code for one second between each iteration of the loop.
while True:
led.toggle()
print("Toggle")

Dept.of.ECE 63
utime.sleep(1)
7. Click on Save and choose to save the code to the MicroPython device (Raspberry Pi
Pico). Name the file blink.py and click Ok to save. Your code should look like this.
from machine import Pin
import utime
led = Pin(28, Pin.OUT)
led.low()
while True:
led.toggle()
print("Toggle")
utime.sleep(1)
8. To run the code, click on the Green play / arrow button and the Python Shell will update
to say TOGGLE every second, and the LED will flash on and off.

Fig 3.20 Testing the LED


We have successfully tested our Raspberry Pi Pico.

Dept.of.ECE 64
CHAPTER 4
IMPLEMENTATIONS

4.1 SCHEMATIC

Dept.of.ECE 65
CHAPTER 5
SIMULATION AND DESIGN

5.1 OUTPUT SCREEN SHOTS

Dept.of.ECE 66
CHAPTER 6
CONCLUSION

This project highlights the possibility to provide an alert system that will overcome the risk of
flood. As the project is enabled with IOT technology and hence the sensor data can be
monitored from anywhere in the world. More sensors can be integrated into the system in
order to create more accurate and efficient flood detection system. It can also contribute to
multiple government agencies or authority that ultimately help the society and mankind about
the flood like hazardous natural disaster. It will monitor each and every aspect that can lead
to flood. If the water level rises along with the speed, it will send an alert immediately. It also
ensures increased accessibility in dealing and reverting to this catastrophic incident. In
summary, it will help the community in taking quick decisions and planning against this
disaster mankind about the flood like hazardous natural disaster.

Dept.of.ECE 67
REFERENCES

[1]. Internet of Things Based Real Time Flood Monitoring and Alert Management System
Author: Tibin Mathew Thekkil ; Dr.N.Prabakaran Year: 2021
[2]. Development of Flood Monitoring System using WSN and IoT based on Cloud Author:
Pallavi C B1; Chandrakala; Year:2019
[3]. Flood Detection using Sensor Network and Notification via SMS and Public Network
Author: Mohamed Ibrahim Khalaf alfahadiwy; Azizah suliman ; Year:2018
[4]. Flood Detection System Using Wireless Sensor Network Author: Abhijeet A Pasi;Uday
Bhave Year: 2017
[5]. A New WSN Paradigm for Environmental Monitoring and Data Collection Author:Eric
Dines, Hassanain Al-Majeed, Asanka Fernando, Mutaz Abdalla, Year: 2016
[6]. Internet of Things Based Real Time Flood Monitoring and Alert Management System
Author: Jagadeesh Babu Mallisetty and Chandrasekhar V; Year :2015
[7]. An Intelligent Flood Monitoring System for Bangladesh Using Wireless Sensor Network
Author: Z.M.Taib, N.S.Jaharuddin and Z.D. Mansor ;Year : 2014
[8]. Development of a low cost Community Based Real Time Flood Monitoring And Early
Warning System – Abimbola Atijosan, Ayodeji Olalekan Salau, Rahmon Ariyo Badru,
Taofeek Alaga ; Year: 2013
[9].SMS Based Flood Monitoring and Early Warning Author: Sheikh Azid, Bibhya Sharma,
Krishna Raghu Waiya, Abinendra Chand Year Year: 2012
[10] D. Mysar, Jagadeesh Babu, Real Time Monitoring of Water Level Variation in Rivers
and Flood Alerting System using ARM7 on International Journal of Advanced Research in
Computer and Communication Engineering , 2016
[11] L.S.C. Johnson, and S.N Hidayah M., A Review of Flood Catastrophic Management in
Malaysia, ARPN Journal of Engineering and Applied Sciences, Vol.11, No. 14, Jul 2015.
[12] Z.M.Taib, N.S.Jaharuddin and Z.D. Mansor, “A Review of Flood Disaster and Disaster
in Malaysia” International Journal of Accounting and Business Management, Vol. 4,
No.3,2014.

Dept.of.ECE 68

You might also like