You are on page 1of 50

Internship Report on

Programming with Arduino uno and Raspberry pi with


Radar sensor for IOT Applications
is submitted in partial fulfillment of the requirement (II B.Tech Internship) for the award of the Degree
of Bachelor of Technology

By

G.Anvitha
(21711A0418)

DR.E vijaya lakshmi


PROFESSOR
Internship carried out at
SRI SHASHA PRAYATHI TECHNOLOGIES
(Duration: 8th MAY, 2023 to 4rd JUNE, 2023 )

Department of Electronics and Communication Engineering

2022-2023
Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the “Internship Report” is submitted by G.ANVITHA

(21711A0418) during academic year 2022-2023, in partial fulfillment of the requirements for the

award of degree of Bachelor of Technology in Department of Electronics and

Communication Engineering, at (Sri Shasha Prayathi Technologies,NITK,Surathkal).

Internship Guide Head of the Department

Dr.E vijaya lakshmi M.TECH Dr. K. Murali,M.Tech, Ph.D


Professor & HOD Dept of ECE

Professor

Signature of the Examiners

1.

2.
DECLARATION
I hereby declare that the internship entitled Programming with Ardunio Uno and

Raspberry pi with Radar Sensor for IOT Applications has been done by me and has

submitted to NARAYANA ENGINEERING COLLEGE, NELLORE as a part of

partial fulfillment of the requirements for the award of degree of Bachelor of

Technology in Department of Electronics and Communication Engineering.

I also declare that this internship report has not submitted to any other institute

or university and not copied from any other sources.

G.anvitha
(21711A0418)

Place: NELLORE
Date:
CERTIFICATION

Model certificate
ACKNOWLEDGEMENT
I am extremely thankful to Dr. P. NARAYANA, the Founder Chairman of
Narayana Group for his good initiation starting technical institution in Nellore. I also
extremely thankful to Mr. R. Sambasiva Rao, B.Tech, Registrar, Narayana Engineering
College, Nellore.

I am highly indebted to director Dr. A. V. S Prasad, Ph.D, Director, Narayana


Engineering & Pharmacy Colleges, Principal Dr. G. Srinivasulu Reddy, Ph.D.,
Narayana Engineering College, Nellore for provided to accomplish this internship.

I would like to thank my Head of the Department Dr. K. Murali, M.Tech, Ph.D,
Professor & HOD, Department of Electronics and Communication Engineering,
Narayana Engineering College, Nellore for his constructive criticism throughout my
internship.

I would like to thank my guide Dr.E vijaya lakshmi, Professor, Department


of ECE for his/her support, guidance, constant assistance, endurance and constructive
for the betterment of the internship.

I would like to thank the CEO of Sri Shasha Prayathi Technologies, NITK,
Surathkal for giving me the opportunity to do an internship within the organization
through virtual mode. I also would like all the people that worked along with me in Sri
Shasha prayathi Technologies with their patience and openness they created an
enjoyable working environment. It is indeed with a great sense of pleasure and immense
sense of gratitude that I acknowledge the help of these individuals.

I am extremely great full to my department staff members and friends who helped me
in successful completion of this internship.

G.Anvitha
(21711A0418)
ABSTRACT

This internship aims to explore the use of Arduino Uno and Raspberry Pi platforms for
building IOT applications. The internship will focus on using radar sensors to detect
objects and collect data for analysis. The internship will involve programming the
sensors and devices using C++ and Python, and using cloud-based services for data
storage and analysis. The internship will demonstrate the potential for these platforms
to be used in a variety of IOT applications, including smart homes, industrial
automation, and environmental monitoring. Both Arduino Uno and Raspberry Pi are
popular microcontroller boards used in building IOT applications. The Arduino Uno is
typically used for sensing and data collection, control and automation, and prototyping,
while the Raspberry Pi is used for data processing, cloud connectivity, and multimedia
applications. The Arduino Uno is simpler and lower cost, making it a good choice for
applications that require real-time control and low power consumption, while the
Raspberry Pi is more powerful and versatile, making it a good choice for applications
that require data processing, cloud connectivity, and multimedia capabilities. Overall,
the choice of board depends on the specific requirements of the IOT application.

KEYWORDS: Microcontroller, Arduino Uno, Raspberry Pi, Sensors, Servo motor,


LCD, Tinkercad, Arduino IDE software, Thingspeak, AWR 1642

I
Organization Information / Industry Profile

Sri Shasha Prayathi Technologies is incubated by National Institute of


Technology Karnataka Science and Technology Entrepreneurship Park (NITK-STEP)
and the directors and founders have obtained their qualifications from reputed
universities/institutes from India and abroad. We have got significant experience in the
domain of radar systems, radar signal processing and target tracking. The consultants
for this start-up are having a wide range of practical/ industry exposure in the area of
radar system design. We are engaged in the research and development activities in the
state- of-the-art domains of radar systems, radar/sonar signal processing, target tracking
and navigation systems. Our company is also interested in providing consultancy
services for defence establishments, public sector companies, and other private
companies in the area of radar systems, radar signal processing, target tracking,
navigation systems, sonar signal processing, radar/sonar waveform design, FMCW
radar- based signal and image processing and associated applications. Also, working on
developing of hardware and software based academic products and services in the
domain of radar systems, signal processing, target tracking and navigation systems. We
have organized skill development programs in the area of radar systems, radar signal
processing, radar target tracking and navigation systems
Course Instructor: The course instructor Vandana G S has completed M.Tech
degree in Digital electronics and communication. She is currently working as Head
R&D Activities at Sri Shasha Prayathi Technolgies Pvt. Ltd.

Address and Contact details:


Nursery Unit No. 12(b),
Science and Technological Entrepreneurship Park (STEP) National Institute of Technology
Karnataka, P.O.Surathkal
P. So Srinivasa Nagar Mangalore-
575025 E-mail:
director@shashaprayathi.com

II
Learning Objectives / Internship Objectives
 Internships are generally thought of to be reserved for college students looking
to gain experience in a particular field. However, a wide array of people can
benefit from Training Internships in order to receive real world experience and
develop their skills.
 An objective for this position should emphasize the skills you already possess
in the area andyour interest in learning more

 Internships are utilized in a number of different career fields, including


architecture, engineering, healthcare, economics, advertising and many more.
 Some internship is used to allow individuals to perform scientific research
while others are specifically designed to allow people to gain first-hand
experience working.
 Utilizing internships is a great way to build your resume and develop skills that
can be emphasized in your resume for future jobs. When you are applying for a
Training Internship,make sure to highlight any special skills or talents that can
make you stand apart from the restof the applicants so that you have an
improved chance of landing the position

III
Weekly Overview of Internship Activities
WEEK DATE DAY TOPIC COVERED

08/05/2023 Introduction to Embedded Systems.


Monday

09/05/2023 Tuesday Introduction to IOT Systems.

10/05/2023 Wednesday Different Electronic Components.

11/05/2023 Thursday Applications of Different Electronic Components.

12/05/2023 Introduction to Arduino


Friday

TOPIC COVERED
WEEK DATE DAY
15/05/2023 Introduction to Arduino IDE, Arduino
Monday software tools specifications
16/05/2023 Tuesday Introduction to Tinkercad,simulation of ultrasonic
sensor and servomotor with Arduino using Tinkercad
17/05/2023 Wednesday Introduction to 16x2 LCD , its pin
configuration. Simulation of LCD and
Temperature sensor with Arduino using
Tinkercad
18/05/2023 Thursday Introduction to Raspberry pi, some basic
programming.
19/05/2023 Raspberry pi based embedded system design.
Friday

IV
WEEK DATE DAY TOPIC COVERED

22/05/2023 Circuit connection using multiple sensors


Monday

23/05/2023 Tuesday Introduction to Arduino Nano Board, LCD display,


LM35 temperature sensor,ESP8266,Pulse sensor
24/05/2023 Wednesday Introduction to Thingspeak, How to log
in and different tabs specifications.
25/05/2023 Thursday Programming using Thingspeak.

26/05/2023 Introduction to AWR1642


Friday

WEEK DATE DAY TOPIC COVERED


29/05/2023 Making a desktop application, Introduction to
Monday Tkinter, Creating different buttons, and PIR
sensor and buzzer experiment.
30/05/2023 Tuesday -

31/05/2023 Wednesday Real time vital sign monitoring system using


AWR1642 radar module with remote Access.
01/06/2023 Thursday Programming for vital sign.

02/06/2023 Programming for vital sign.


Friday

V
INDEX

CHAPTER NAMES PAGE NO


I
Abstract
Organization Information Ii
Benefits to the Company / Institute Through Your
Report
Internship Objectives Iii
Weekly Overview of Internship Activities iv ,v
Index Vi,vii
List of Figures Viii,ix
List of Tables Ix
1. Introduction
1.1 Embedded Systems
1
1.2 Architecture 2
1.3 Features 3
1.4 Internet Of Thigs(IoT) 4
1.5 Features of IoT 5
2. Electronic Devices 6
2.1 On board Communication Interface 9
2.2 External Communication Interface 12
3. Internet Of Things
3.1 Introduction to IoT
13
3.2 Ecosystem of IoT 14
3.3 Applications 15
4. Arduino Uno
4.1 Arduino Board
16

VI
4.2 Arduino IDE 21
4.3 Tinkercad Software 25
5. Raspberry Pi 26
5.1 Creating GUI 29
5.2 Introduction to Thingspeak 31
6. Results and Discussion 33
7. Conclusion 34
References 34

VII
List of Figures

Figure No Name Page No

Layered Architecture of an
Figure 1.1 Embedded System 2
Figure 1.2 Hardware Architecture of an 3
Embedded System
Figure 2.1 LED Diagram 6
Figure 2.2 Stepper Motor 7
Figure 2.3 Unipolar Stepper Motor 8
Figure 2.4 Bipolar Stepper Motor 8
Figure 2.5 Relay 8
Figure 2.6 Piezo Buzzer 9
Figure 2.7 I2C Interface 10
Figure 2.8 SPI Interface 11
Figure 2.9 UART Interface 12
Figure 2.10 USB 12
Figure 3.1 IOT Overview 13
Figure 3.2 IOT Ecosystem 14
Figure 4.1 The Arduino Board 17
Figure 4.2 The Arduino Board starting at 18
the USB connector
Figure 4.3 ATMega328p Microcontroller 18
Figure 4.4 ATMega328p and Arduino Uno 19
pin mapping
Figure 4.5 Arduino Uno board mapping 19
Figure 4.6 Power and Analog sockets 20
Figure 4.7 Power and Digital sockets 20
Figure 4.8 On-Board LED 20
Figure 4.9 Reset Button 21
Figure 4.10 Arduino IDE 21
Figure 4.11 Installation of Arduino IDE 23
Figure 4.12 Tinkercad Software 25
Figure 5.1 Raspberry Pi Board 26
Figure 5.2 Raspberry Pi 3 model 27
Figure 5.3 Commands 28
Figure 5.4 Buzzer Experiment 28
Figure 5.5 Raspberry Pi connected to 29
Breadboard

VIII
List of Tables

TABLE NO NAME PAGE NO


TABLE 1 Hardware Architecture of an 3
Embedded System
TABLE 2 I2C interface 10
TABLE 3 IOT Ecosystem 14
TABLE 4 ATMega328P and Arduino 19
Uno Pin Mapping
TABLE 5 Commands 28

IX
CHAPTER-1
INTRODUCTION
Embedded
system:
• An embedded system is one that has computer hardware with software embedded in it
as oneof its components.
• We can define an embedded system as "A microprocessor based system that does not
look like a computer".
• We can say that it is "A combination of computer hardware and software, and perhaps
additional mechanical or other parts, designed to perform a dedicated function. In some
cases,
embedded systems are part of a larger system or product, as is the case of an anti lock
braking
system in a car".
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 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.

Dept. of ECE, Narayana Engineering College, Nellore 1


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 we 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 and you don’t need to reload new
software .

Figure 1.1: Layered architecture of an Embedded System

Dept. of ECE, Narayana Engineering College, Nellore 2


Features of an Embedded System:
• 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.
Classification of Embedded Systems:
Based on functionality and performance requirements, embedded systems are classified
as :
• Stand-alone Embedded Systems
• Real-time Embedded Systems

Dept. of ECE, Narayana Engineering College, Nellore 3


Stand-alone Embedded Systems:
• As the name implies, stand-alone systems work in stand-alone mode. They take
inputs, process them and produce the desired output.
• The input can be electrical signals from transducers or commands from a human
being such as the pressing of a button.
• The output can be electrical signals to drive another system, an LED display or
LCD display for displaying of information to the users.
• Embedded systems used in process control, automobiles, consumer electronic
items etc. fall into this category.
Real-time Embedded Systems:
• Embedded systems in which some specific work has to be done in a specific
time period are called real-time systems.
• For example, consider a system that has to open a valve within 30 milliseconds
when the humidity crosses a particular threshold. If the valve is not opened within 30
milliseconds, a catastrophe may occur. Such systems with strict deadlines are called
hard real-time systems.
• In some embedded systems, deadlines are imposed, but not adhering to them
once in a while may not lead total catastrophe.

Networked Embedded Systems:


• Embedded systems that are provided with network interfaces and accessed by
networks such as Local Area Network or the Internet are called networked information
appliances.
• Such embedded systems are connected to a network, typically a network running
TCP/IP (Transmission Control Protocol/Internet Protocol) protocol suite, such as the
Internet or a company’s Intranet.
• These systems have emerged in recent years. These systems run the protocol
TCP/IP stack and get connected through PPP or Ethernet to an network and
communicate with other nodes in the network.
• Networked Information Appliances Embedded systems that are provided with
network interfaces and accessed by networks such as Local Area Network or the
Internet are called networked information appliances.

Dept. of ECE, Narayana Engineering College, Nellore 4


Mobile Devices:
• Mobile devices such as mobile phones, Personal Digital Assistants (PDAs),
smart phones etc. are a special category of embedded systems. Though the PDAs do
many general purpose tasks, they need to be designed just like the ‘conventional’
embedded systems.
• The limitations of the mobile devices — memory constraints, small size, lack of
good user interfaces such as full-fledged keyboard and display etc. are same as those
found in the embedded systems discussed above. Internet Of Things (IOT):
INTERNET OF THINGS(IOT)
The Internet of Things (IoT) is a network of physical devices, vehicles, home
appliances, and other items that are embedded with sensors, software, and connectivity
that enable them to connect and exchange data with other devices and systems over the
internet.
• IoT enables the collection and analysis of vast amounts of data from various
sources, providing insights and opportunities for optimization and automation.
• IoT technology can be applied in various industries, including healthcare,
agriculture, transportation, manufacturing, and smart homes and cities.
• IoT devices can communicate with each other and with cloud-based services,
enabling remote monitoring and control of devices and systems.
Features of IOT:
• Connectivity: IoT devices are connected to the internet or other networks,
enabling them to exchange data and communicate with other devices and systems.
• Sensors: IoT devices are equipped with sensors that can detect and measure
various parameters such as temperature, humidity, pressure, and motion.
• Data collection: IoT devices can collect and store vast amounts of data from
various sources, providing insights and opportunities for optimization and automation.

Dept. of ECE, Narayana Engineering College, Nellore 5


CHAPTER-2
ELCTRONIC DEVICES
1. Sensors and Actuators:
➢ A sensor is a transducer device that converts energy from one form to another
for any measurement or control purpose.

➢ The changes in system environment or variables are detected by the sensors


connected to the input port of the embedded system.

➢ Actuator is a form of transducer device (mechanical or electrical) which cony its


signals to corresponding physical action (motion). Actuator acts as an put device.

2. Light Emitting Diode (LED):


➢ LED is an important output device for visual indication in any embedded
system. LED can be used as an indicator for the status of various signals or situations.

➢ LED is a p-n junction diode and it contains an anode and a cathode. For proper
functioning of the LED, the anode of it should be connected to +ve termina1 of the
supply voltage and cathode to the —ve terminal of the supply voltage.

Figure 2.1: LED diagram

Dept. of ECE, Narayana Engineering College, Nellore 6


3. Stepper Motor:
 A stepper motor is an electro-mechanical device which generates discrete
displacement (motion) in response to dc electrical signals.
 It differs from the normal dc motor in its operation. The dc motor produces
continuous rotation on applying dc voltage whereas a stepper motor produces
discrete rotation in response to the dc voltage applied to it.
 The paper feed mechanism of a printer/fax makes use of stepper motors for is
functioning.

Figure 2.2: Stepper Motor

Based on the coil winding arrangements, a two-phase stepper motor is Classified into
two. They are:
• Unipolar
• Bipolar

Dept. of ECE, Narayana Engineering College, Nellore 7


Figure 2.3: Unipolar stepper motor Figure 2.4: Bipolar stepper motor

4. Relay:

 Relay is an electro-mechanical device. In embedded application, the ’Relay’ unit


acts as dynamic path selectors for signals and power.
 The Relay unit contains a relay coil made up of insulated wire on a metal core
and a metal armature with one or more contacts.
 ’Relay’ works on electromagnetic principle. When a voltage is applied to the
relay coi1 current flows through the coil, which in turn generates a magnetic
field.
 The magnetic field attracts the armature core and moves the contact point. The
movement of the contact point changes the power/signal flow path.

Figure 2.5: Relay

Dept. of ECE, Narayana Engineering College, Nellore 8


5. On board Communication Interface:
Onboard Communication Interface refers to the different communication
channels/buses for interconnecting the various integrated circuits and other
peripherals within the embedded system.
The various interfaces for onboard communication are as follows:
 Inter Integrated Circuit (I2C) Bus
 Serial Peripheral Interface (SPI)
 Universal Asynchronous Receiver Transmitter (UART) Bus

Dept. of ECE, Narayana Engineering College, Nellore 9


Inter Integrated Circuit (I2C):

 The Inter Integrated Circuit Bus is a synchronous bi-directional half


duplex two wire serial interface bus. The I2C bus comprise of two bus lines,
namely; Serial Clock-SCL and Serial Data-SDA.
 SCL line is responsible for generating synchronization clock pulses and
SDA is responsible for transmitting the serial data across devices.

Figure 2.7: I2C interface

Serial Peripheral Interface (SPI):

 The Serial Peripheral Interface Bus (SPI) is a synchronous bi-directional full


duplex four-wire serial interface bus.

Dept. of ECE, Narayana Engineering College, Nellore 10


 SPI is a single master multi-slave system. SPI requires four signal lines
for communication. They are Master Out Slave (MOSI), Master In Slave
Out (MISO), Serial Clock (SCLK) an’ Slave Select (SS).
 Then compared to I2C, SPI bus is most suitable for applications requiring
transfer of data in’streams’.

Figure 2.8: SPI Interface

Universal Asynchronous Receiver Transmitter (UART):


 Universal Asynchronous Receiver Transmitter (UART) based data transmission
is an asynchronous form of serial data transmission.
 UART based serial data transmission doesn’t require a clock signal to
synchronize the transmitting end and receiving end for transmission. Instead
it relies upon the pre-defined agreement between the transmitting device and
receiving device.
 The serial communication settings (Baud rate, number of bits per byte,
parity, number of start bits and stop bit and flow control) for both transmitter
and receiver should be set as identical.
 The least significant bit of the data byte follows the ‘start’ bit.

Dept. of ECE, Narayana Engineering College, Nellore 11


Figure 2.9: UART Interface

6. External Communication Interface Universal Serial


Bus (USB):
 A USB 2.0 host can support connections up to 127, including slave peripheral
devices and other USB hosts.
 The USB host contains a host controller which is responsible for controlling he
data communication, including establishing connectivity with USB slave devices,
packetizing and formatting the data packet.
 ‘Type A’ connector is used for upstream connection (connection with host) and
Type B OR Mini/Micro USB connector is used for downstream connection
(connection with slave device).
 The USB 2.0 connector seen at desktop PCs or laptops are examples for ‘Type A’
USB connector.
Both Type A and Type B connectors contain 4 pins for communication.

Dept. of ECE, Narayana Engineering College, Nellore 12


Figure 2.10: USB

CHAPTER – 3
INTERNET OF THINGS
(IOT)
Introduction to IOT Systems:

 The Internet of Things (IoT) describes the network of physical objects—


“things”—that are embedded with sensors, software, and other technologies
for the purpose of connecting and exchanging data with other devices and
systems over the internet.
 These devices collect useful data with the help of various existing
technologies and then autonomously flow the data between other devices.

Figure 3.1: IOT Overview Ecosystem of IOT:

Dept. of ECE, Narayana Engineering College, Nellore 13


The IoT Ecosystem can be built using four major components:

1. IoT Devices
2. Communication technology
3. Internet
4. Data storage and processing.

An IoT ecosystem consists of web-enabled smart devices that use embedded


processors, sensors and communication hardware to collect, send and act on data
they acquire from their environments.

Figure 3.2: IOT Ecosystem

Components Sensors:
 These form the front end of the IoT devices. These are the so-called
“Things” of the system.
 The main purpose is to collect data from its surroundings (sensors) or give
out data to its surrounding (actuators).

Dept. of ECE, Narayana Engineering College, Nellore 14


Gateways:
 Gateways are responsible for routing the processed data and send it to
proper locations for its (data) proper utilization.
 The gateway helps in communication of the data. It provides network
connectivity to the data.
Applications:
 Applications form another end of an IoT system. Applications are essential
for proper utilization of all the data collected.
 The cloud-based applications which are responsible for rendering the
effective meaning to the data collected.

Why IOT?
 Almost any industry could profit from the Internet of Things(IoT) devices
because the Internet of Things (IoT) enables objects to just be managed
remotely via the internet.
 IoT devices have opened up possibilities for connecting directly and
integrating the real world with machine platforms via sensors and the
internet.
 Those devices which have IoT in them are interconnected with other
devices and help to create automation for applications. With much
less human participation, the correctness, productivity, and financial
benefit improve even more.

Dept. of ECE, Narayana Engineering College, Nellore 15


Applications of IOT:
Few Applications of IoT are:

 Building and Home automation


 Manufacturing
 Medical and Healthcare systems
 Industrial
 Environmental monitoring
 Infrastructure management
 Energy management
 Transportation

Dept. of ECE, Narayana Engineering College, Nellore 16


CHAPTER – 4
ARDUINO UNO
Arduino Board:
According to the Arduino website (http://www. arduino.cc/), it is an open-
sourceelectronics prototyping platform based on flexible, easy-to-use hardware
and software.It’s intended for artists, designers, hobbyists, and anyone
interested in creating interactive objects or environments.By using an almost
unlimited range of input and output devices, sensors, indicators,
displays,motors, and more, you can program the exact interactions required to
create a functional device.

Figure 4.1: The Arduino Board

Dept. of ECE, Narayana Engineering College, Nellore 17


In simple terms, the Arduino is a tiny computer system that can be programmed with
your instructions to interact with various forms of input and output.The current Arduino
board model, the Uno, is quite small in size compared to the average human hand.

The Arduino Board Starting at the Universal Serial Bus (USB) Connector.

the left side of the board, you’ll see two connectors, On the far left is the Universal
Serial Bus (USB) connector.
This connects the board to your computer for three reasons: to supply power to the
board, to upload your instructions to the Arduino, and to send data to and receive it
from a computer.

ATMega328p Microcontroller

The microcontroller is the “brains” of the Arduino. It is a tiny computer that


contains a processor to execute instructions, includes various types of memory
to hold data and instructions from our sketches, and provides various avenues
of sending and receiving data.

Dept. of ECE, Narayana Engineering College, Nellore 18


Figure 4.4: ATMega328P and Arduino Uno Pin Mapping

Arduino Uno board Mapping

Dept. of ECE, Narayana Engineering College, Nellore 19


Figure 4.6: Power and analog sockets

The first row offers power connections and the ability to use an external
RESET button. The second row offers six analog inputs that are used to
measure electrical signals that vary in voltage.Pins A4 and A5 can also be used
for sending data to andreceiving it from other devices.

Figure 4.7: Power and Digital sockets

Dept. of ECE, Narayana Engineering College, Nellore 20


The Arduino board has four LEDs: one on the far right labeled ON, which
indicates when the board has power, and three in another group.The LEDs labeled TX and RX light up
when data is being transmitted or received between the Arduino and attached devices via the serial port
and USB.The L LED is for your own use (it is connected to the digital I/O pin number 13).The little
black square part to the left of the LEDs is a tiny microcontroller that controls the USB interface that
allows your Arduino to send data to and receive it from a computer.

Figure 4.9: Reset button

Dept. of ECE, Narayana Engineering College, Nellore 21


IDE is divided into three main areas: the command area, the text area, and the message windowThe command
area is shown at the top and includes the title bar, menu items, and icons. The title bar displays the sketch’s
filename (sketch mar22a), as well as the version of the IDE (Arduino 1.0).
• Below the menu toolbar are six icons. Mouse over each icon to display its
name. The icons, from left to right, are as follows:
• Verify Click this to check that the Arduino sketch is valid and doesn’t
contain any programming mistakes.
• Upload Click this to verify and then upload your sketch to the Arduino board.
• New Click this to open a new blank sketch in a new window.
• Open Click this to open a saved sketch. Save Click this to save the open
sketch.

Installing Arduino IDE:


Step 1: Download Arduino IDE Software.
You can get different versions of Arduino IDE from the Download page on
the Arduino Official website. You must select your software, which is
compatible with your operating system (Windows, IOS, or Linux). After your
file download is complete, unzip the file.

Step 2: Power up your board.


The Arduino Uno automatically draws power from either, the USB connection
to the computer or an external power supply. The power source is selected
with a jumper, a small piece of plastic that fits onto two of the three pins
between the USB and power jacks. Check that it is on the two pins closest to
the USB port.Connect the Arduino board to your computer using the USB
cable. The green power LED (labeled PWR) should glow.

Dept. of ECE, Narayana Engineering College, Nellore 22


Figure 4.11: Installation of Arduino IDE
Step 3:Launch Arduino IDE
After your Arduino IDE software is downloaded, you need to unzip the
folder. Inside the folder, you can find the application icon with an infinity
label (application.exe). Double-click the icon to start the IDE

Installation of Arduino IDE

Open your first project. Once the software starts, you have two options Create a
new project. Open an existing project example. To create a new project, select
File New.

Dept. of ECE, Narayana Engineering College, Nellore 23


To open an existing project example, select File → Example → Basics →
Blink. Here, we are selecting just one of the examples with the name
Blink. It turns the LED on and off with some time delay. You can select
any other example from the list.

Installation of Arduino IDE


Select your Arduino board. To avoid any error while uploading your program
to the board, you must select the correct Arduino board name, which matches
with the board connected to your computer. Go to Tools → Board and select
your board.

Installation of Arduino IDE

Step 4: Select your serial port. Select the serial device of the Arduino board.
Go to Tools → Serial Port menu. This is likely to be COM3 or higher (COM1

Dept. of ECE, Narayana Engineering College, Nellore 24


and COM2 are usually reserved for hardware serial ports). To find out, you
can disconnect your Arduino board and re-open the menu, the entry that
disappears should be of the Arduino board. Reconnect the board and select
that serial port. SRI

Installation of Arduino IDE

Upload the program to your board. A Used to check if there is any


compilation error. B Used to upload a program to the Arduino board. C
Shortcut used to create a new sketch. D Used to directly open one of the
example sketch. E Used to save your sketch. F Serial monitor used to receive
serial data from the board and send the serial data to the board. Now, simply
click the "Upload" button in the environment.

Tinkercad Software:

Tinkercad is a web-based 3D modeling software that is also used for designing


circuits with Arduino.

- It's a free tool that allows you to create and test circuits in a virtual environment.
- Tinkercad has a drag-and-drop interface that makes it easy to add components
and create circuits.- The software also includes a code editor, so you can
program your Arduino board to interact with your circuit. - Tinkercad is perfect
for beginners

Dept. of ECE, Narayana Engineering College, Nellore 25


and experienced designers alike.Tinkercad has a large library of components,
including resistors, capacitors, LEDs, and sensors, that you can use to create
your circuits. - The software also has a feature that allows you to simulate the
behavior of your circuit before you build it in real life.
- Tinkercad provides a great learning experience for students and hobbyists who
want to learn more about electronics and programming.
- The software is accessible from any computer with an internet connection,
making it easy to work on your projects from anywhere.
- Tinkercad is also integrated with other tools, such as Thingiverse and
MyMiniFactory, which allows you to easily 3D print your designs.

Figure 4.12: Tinker Cad software

Dept. of ECE, Narayana Engineering College, Nellore 26


CHAPTER – 5
RASPBERRY
PI

Raspberry Pi:
 A credit-card-sized computer
 Runs on several operating systems
 Raspbian we will use RASPBIAN Windows 10 loT core
 RetroPie and OpenElec
 Possible to connect with a variety of sensors to interact with the physicalworld.
 Make decisions based on processing of gathered sensor data.

Figure 5.1: Raspberry Pi Board Figure 5.2: The Raspberry Pi 3 Model

Programming in Python:

• General-purpose programming language used for scientific and numerical


applications
• Open source language that has a lot of online resources for problems you might
come

Dept. of ECE, Narayana Engineering College, Nellore 27


• We are using Thorny IDE for programming with Python3 in our Raspberry Pi 3
Model B.
• https://stackoverflowicom is your best friend for programming troubles.
• Hardware PWM is available on these pins only: GPIO12, GPIO13, GPI018,
GPI019.
• Use the GPIO drive outputs and read inputs.
• Python is sensitive to intendation.
• Make sure that the variables and the function have the same exact writing. Watch
out
• Remember that python starts counting from zero.
i.e. when using loops.

Figure 5.3: Commands

Using a
Buzzer:
There are two main types of buzzer:
Active and passive. A passive buzzer emits a tone when a voltage is
applied across it. It also requires a specific signal to generate a variety
of tones. The active buzzers are a lot simpler to use, so these are
covered here.

Dept. of ECE, Narayana Engineering College, Nellore 28


Figure 5.4: Buzzer Experiment

Making a Desktop Application:

Introducing Tkinter: A GUI Toolkit for Python.


• De facto standard GUI for Python Toolkit for GUI programming in
Python. Not the only
one, but the most commonly used one.
• Enables you to build GUI’s with buttons, sliders, drop downs, and other
interactions for the user of the program/device you build.
• When creating a GUI you use event driven programming.
• In the GUI all buttons, sliders, etc, are known as Widgets.
• When a widget is used it make an event in you code start.
Dept. of ECE, Narayana Engineering College, Nellore 29
Creating GUI:
• We will create a GUI that enables us to turn the LED on and off with a
button in a GUI. • Use the 470 Ohm resistor in the circuit.

Dept. of ECE, Narayana Engineering College, Nellore 30


Figure 5.5: Raspberry Pi connected to breadboard

Now we need do decide what the GUI will actually do.

1. We will create a button that will switch the LED on and off
2. We also have to make an exit button so that when we exit the
program the LED turns off, and the GPIO port is reset to default as
input ports.

PIR Senso
rand Buzzer
Experiment
:
import RPi.GPIOas
GPIO import time
pirsensor = 11 piezo
=7

GPIO.setmode(GPIO.BOARD)
GPIO.setup(piezo,GPIO.OUT)
GPIO.setup(pir_sensor, GPIO.IN)
current_state = 0

Dept. of ECE, Narayana Engineering College, Nellore 31


Figure 5.6: PIR sensor and Buzzer connected to Raspberry Pi

Introduction to Thingspeak:
• Open https://thingspeak.com/ and click on the ‘Get Started Now’ button
on the center of the page .
• You will be redirected to the sign-up page(you will reach the same page
when you click the
‘Sign Up’ button on the extreme right).
• Now you should see a page with a confirmation that the account was
successfully created.
• The confirmation message disappears after a few seconds and the final
page should look as in the below screen
• Go ahead and click on ‘New Channel’. You should see a page like the
below:

Dept. of ECE, Narayana Engineering College, Nellore 32


Figure 5.7: Channel Settings
• You can change the name to fit your need and you can add a description
corresponding to
the channel. You can add any other useful description into the metadata field.
• URL - This can be the URL of your blog or website and if specified, will
appear on the public view of the channel.
• Video ID - This is the ID corresponding to your YouTube or Vimeo ID.
If specified, the video appears on the public view of the channel.
• The Private View shows a chart corresponding to each of the fields that
we have added.
• Now click on the ‘Public View’ tab. This should look exactly similar to
the what we see in the ‘Private View’ tab since our channel is public.

Figure 5.8: Private View

Dept. of ECE, Narayana Engineering College, Nellore 33


• ThingSpeak provides apps that allow us for an easier integration with the
web services, social networks and other APIs.
• Below are some of the apps provided by ThingSpeak:
• ThingTweet - This allows you to post messages to twitter via
ThingSpeak. In essence, this is a TwitterProxy which re-directs your posts to
twitter.
• ThingHTTP - This allows you to connect to web services and supports
GET, PUT, POST and DELETE methods of HTTP.
• found in the twitter feed, you can then use ThingHTTP to connect to a
different web service or execute a specific action.

Dept. of ECE, Narayana Engineering College, Nellore 34


CHAPTER – 6 RESULTS AND DISCUSSION
Arduino Uno is a microcontroller board that is easy to use and
relatively inexpensive. It is designed for simple applications that require real-
time processing, such as controlling sensors and actuators.

-Raspberry Pi, on the other hand, is a single-board computer that is


more powerful and versatile than Arduino Uno. It can run a full operating
system and support a variety of programming languages, making it suitable
for more complex applications that require more processing power.

- Both devices can be used for developing IoT applications, and there
are many libraries and tools available to support IoT development on both
platforms.
- Some popular programming languages for IoT development on
Arduino Uno include C, C++, and Python, while Raspberry Pi supports a wider
range of languages, including Python, Java, and Ruby.
- Both Arduino Uno and Raspberry Pi can be programmed using the
Arduino Integrated Development Environment (IDE), which is a free software
tool for writing and uploading code to Arduino boards.
- Raspberry Pi can also be programmed using other popular IDEs such
as Visual Studio Code and Eclipse.
- When developing IoT applications, it's important to consider factors
such as power consumption, memory usage, and network connectivity, as well as
security and privacy concerns.
- Overall, the choice between Arduino Uno and Raspberry Pi depends
on the specific requirements of the IoT application, such as the complexity of the
application, the required processing power, and the available resources.

Dept. of ECE, Narayana Engineering College, Nellore 35


CHAPTER-7 CONCLUSION
This Internship “Programming with Arduino Uno and Raspberry Pi with radar
sensors for IoT Applications” the following points are completed.

• All the basic concepts of Electronic Devices and IoT devices are dicussed.
• Understanding the interfacing of Arduino Uno Board and programming
with Arduino IDE.
• Simulation of Different Circuits in Tinkercad Software.
• Developing different applications using Raspberry Pi.
• Able to use the Thingspeak.

REFERENCES
1. Upton, Eben (24 June 2019). "Raspberry Pi 4 on sale now from $35".
Raspberry Pi Foundation.
2. Upton, Eben (28 May 2020). "8GB Raspberry Pi 4 on sale now at
$75". Raspberry Pi Blog.
Retrieved 28 May 2020.
3. Upton, Eben (2 November 2020). "Raspberry Pi 400: the $70 desktop
PC". Raspberry Pi Foundation.
4. Upton, Liz (30 April 2015). "Windows 10 for IoT". Raspberry Pi Foundation.
5. Hattersley, Lucy (15 November 2018). "Raspberry Pi 4, 3A+, Zero W – specs,
benchmarks & thermal tests". The MagPi magazine. Raspberry Pi Trading Ltd.
Retrieved 28 May 2020.
6. "DATASHEET – Raspberry Pi Compute Module 3+" (PDF). Raspberrypi.org.
1 January 2019.
Retrieved 28 May 2020.
7. "Raspberry Pi 4 Tech Specs". Raspberry Pi. Retrieved 26 June 2019.
8. "Raspberry Pi Zero: the $5 Computer". Raspberry Pi Foundation. 26
November 2015. Retrieved 26 November 2015.
9. "Pi Bootmodes". Only Supports Pi 2 v1.2 and up.

Dept. of ECE, Narayana Engineering College, Nellore 36

You might also like