[go: up one dir, main page]

0% found this document useful (0 votes)
23 views34 pages

Pico Sample Document

The document provides an overview of embedded systems, detailing their components, architecture, and functionality. It explains the differences between microcontrollers and microprocessors, the role of memory, input/output devices, and communication interfaces. Additionally, it covers power supply design, rectification methods, voltage regulation, and introduces the Raspberry Pi Pico microcontroller as a versatile tool for various applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views34 pages

Pico Sample Document

The document provides an overview of embedded systems, detailing their components, architecture, and functionality. It explains the differences between microcontrollers and microprocessors, the role of memory, input/output devices, and communication interfaces. Additionally, it covers power supply design, rectification methods, voltage regulation, and introduces the Raspberry Pi Pico microcontroller as a versatile tool for various applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

[Type the document title]

ABSTRACT:

[Type text] Page 1


[Type the document title]

CHAPTER 1

INTRODUCTION TO PROJECT

PROBLEM STATEMENT

EXISTING SYSTEM

PROPOSED SYSTEM

[Type text] Page 2


[Type the document title]

CHAPTER 2

LITERATURE SURVEY

[Type text] Page 3


[Type the document title]

CHAPTER 3

INTRODUCTION TO EMBEDDED SYSTEM

1.1 Introduction Embedded Systems:-

An embedded system is a combination of software and hardware to perform a dedicated


task. Some of the main devices used in embedded products are Microprocessors and
Microcontrollers.

Microprocessors are commonly referred to as general purpose processors as they simply


accept the inputs, process it and give the output. In contrast, a microcontroller not only accepts
the data as inputs but also manipulates it, interfaces the data with various devices, controls the
data and thus finally gives the result.

An Embedded System is a combination of computer hardware and software, and perhaps


additional mechanical or other parts, designed to perform a specific function. A good example is
the microwave oven. Almost every household has one, and tens of millions of them are used
every day, but very few people realize that a processor and software are involved in the
preparation of their lunch or dinner.

This is in direct contrast to the personal computer in the family room. It too is
comprised of computer hardware and software and mechanical components (disk drives, for
example). However, a personal computer is not designed to perform a specific function rather; it
is able to do many different things. Many people use the term general-purpose computer to make
this distinction clear. As shipped, a general-purpose computer is a blank slate; the manufacturer
does not know what the customer will do wish it. One customer may use it for a network file
server another may use it exclusively for playing games, and a third may use it to write the next
great American novel.

Frequently, an embedded system is a component within some larger system. For


example, modern cars and trucks contain many embedded systems. One embedded system
controls the anti-lock brakes, other monitors and controls the vehicle's emissions, and a third

[Type text] Page 4


[Type the document title]

displays information on the dashboard. In some cases, these embedded systems are connected by
some sort of a communication network, but that is certainly not a requirement.

At the possible risk of confusing you, it is important to point out that a general-purpose
computer is itself made up of numerous embedded systems. For example, my computer consists
of a keyboard, mouse, video card, modem, hard drive, floppy drive, and sound card-each of
which is an embedded system. Each of these devices contains a processor and software and is
designed to perform a specific function. For example, the modem is designed to send and receive
digital data over analog telephone line. That's it and all of the other devices can be summarized
in a single sentence as well.

3.2. OVERVIEW OF EMBEDDED SYSTEM :

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 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 foran 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. 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:

a. Central Processing Unit (CPU)


b. Memory (Read-only Memory and Random Access Memory)
c. Input Devices
d. Output devices
e. Communication interfaces

[Type text] Page 5


[Type the document title]

f. Application-specific circuitry

Fig: 3.1 Building blocks of the hardware of an embedded system

 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 11emory (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.

[Type text] Page 6


[Type the document title]

 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 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.

[Type text] Page 7


[Type the document title]

CHAPTER 4

BLOCK DIAGRAM AND HARDWARE DISCRIPTION

4.1. BLOCK DIAGRAM:

POWER SUPPLY
All digital circuits require regulated power supply. In this article we are going to learn how to get
a regulated positive supply from the mains supply.

Figure 1 shows the basic block diagram of a fixed regulated power supply.

Let us go through each block.

[Type text] Page 8


[Type the document title]

TRANSFORMER

A transformer consists of two coils also called as “WINDINGS” namely PRIMARY &
SECONDARY. They are linked together through inductively coupled electrical conductors also
called as CORE. A changing current in the primary causes a change in the Magnetic Field in the
core & this in turn induces an alternating voltage in the secondary coil. If load is applied to the
secondary then an alternating current will flow through the load. If we consider an ideal
condition then all the energy from the primary circuit will be transferred to the secondary circuit
through the magnetic field.

So

The secondary voltage of the transformer depends on the number of turns in the Primary as well as
in the secondary.

Rectifier

A rectifier is a device that converts an AC signal into DC signal. For rectification purpose we use
a diode, a diode is a device that allows current to pass only in one direction i.e. when the anode
of the diode is positive with respect to the cathode also called as forward biased condition &
blocks current in the reversed biased condition.

[Type text] Page 9


[Type the document title]

Rectifier can be classified as follows:

1) Half Wave rectifier.

This is the simplest type of rectifier as you can see in the diagram a half wave rectifier consists
of only one diode. When an AC signal is applied to it during the positive half cycle the diode is
forward biased & current flows through it. But during the negative half cycle diode is reverse
biased & no current flows through it. Since only one half of the input reaches the output, it is
very inefficient to be used in power supplies.

2) Full wave rectifier.

[Type text] Page 10


[Type the document title]

Half wave rectifier is quite simple but it is very inefficient, for greater efficiency we would like
to use both the half cycles of the AC signal. This can be achieved by using a center tapped
transformer i.e. we would have to double the size of secondary winding & provide connection to
the center. So during the positive half cycle diode D1 conducts & D2 is in reverse biased
condition. During the negative half cycle diode D2 conducts & D1 is reverse biased. Thus we get
both the half cycles across the load. One of the disadvantages of Full Wave Rectifier design is
the necessity of using a center tapped transformer, thus increasing the size & cost of the circuit.
This can be avoided by using the Full Wave Bridge Rectifier.

3) Bridge Rectifier

As the name suggests it converts the full wave i.e. both the positive & the negative half cycle
into DC thus it is much more efficient than Half Wave Rectifier & that too without using a center
tapped transformer thus much more cost effective than Full Wave Rectifier. Full Bridge Wave
Rectifier consists of four diodes namely D1, D2, D3 and D4. During the positive half cycle
diodes D1 & D4 conduct whereas in the negative half cycle diodes D2 & D3 conduct thus the
diodes keep switching the transformer connections so we get positive half cycles in the output.

[Type text] Page 11


[Type the document title]

If we use a center tapped transformer for a bridge rectifier we can get both positive & negative
half cycles which can thus be used for generating fixed positive & fixed negative voltages.

FILTER CAPACITOR

Even though half wave & full wave rectifier give DC output, none of them provides a constant
output voltage. For this we require to smoothen the waveform received from the rectifier. This
can be done by using a capacitor at the output of the rectifier this capacitor is also called as
“FILTER CAPACITOR” or “SMOOTHING CAPACITOR” or “RESERVOIR CAPACITOR”.
Even after using this capacitor a small amount of ripple will remain. We place the Filter
Capacitor at the output of the rectifier the capacitor will charge to the peak voltage during each
half cycle then will discharge its stored energy slowly through the load while the rectified
voltage drops to zero, thus trying to keep the voltage as constant as possible.

[Type text] Page 12


[Type the document title]

If we go on increasing the value of the filter capacitor then the Ripple will decrease. But then the costing will
increase. The value of the Filter capacitor depends on the current consumed by the circuit, the frequency of
the waveform & the accepted ripple.

Where,

Vr = accepted ripple voltage.( should not be more than 10% of the voltage)
I = current consumed by the circuit in Amperes.
F = frequency of the waveform. A half wave rectifier has only one peak in one cycle so F=25hz

Where as a full wave rectifier has Two peaks in one cycle so F=100hz.

VOLTAGE REGULATOR

[Type text] Page 13


[Type the document title]

A Voltage regulator is a device which converts varying input voltage into a constant regulated

output voltage. Voltage regulator can be of two types

1) Linear Voltage Regulator Also called as Resistive Voltage regulator because they
dissipate the excessive voltage resistively as heat.
2) Switching Regulators They regulate the output voltage by switching the Current
ON/OFF very rapidly. Since their output is either ON or OFF it dissipates very low
power thus achieving higher efficiency as compared to linear voltage regulators. But
they are more complex & generate high noise due to their switching action. For low
level of output power switching regulators tend to be costly but for higher output
wattage they are much cheaper than linear regulators.

The most commonly available Linear Positive Voltage Regulators are the 78XX series where the
XX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.

After filtering the rectifier output the signal is given to a voltage regulator. The maximum input
voltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across the
regulator so the input voltage should be at least 2-3 Volts higher than the output voltage. If the
input voltage gets below the Vmin of the regulator due to the ripple voltage or due to any other
reason the voltage regulator will not be able to produce the correct regulated voltage.

3. Circuit diagram:

[Type text] Page 14


[Type the document title]

Fig 2.3 Circuit Diagram of power supply

IC 7805:

7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input
voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp
although lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also
has a built-in current limiter as a safety feature. 7805 is manufactured by many companies,
including National Semiconductors and Fairchild Semiconductors. The 7805 will automatically
reduce output current if it gets too hot.The last two digits represent the voltage; for instance, the
7812 is a 12-volt regulator. The 78xx series of regulators is designed to work in complement
with the 79xx series of negative voltage regulators in systems that provide both positive and
negative regulated voltages, since the 78xx series can't regulate negative voltages in such a
system. The 7805 & 78 is one of the most common and well-known of the 78xx series
regulators, as it's small component count and medium-power regulated 5V make it useful for
powering TTL devices.

SPECIFICATIONS IC 7805

V out 5V

V - V Difference
ein out 5V - 20V

Operation Ambient Temp 0 - 125°C

Output I max 1A

Table 2.1. Specifications of IC7805

[Type text] Page 15


[Type the document title]

CHAPTER 5

CONTROLLER

RPI –PICO

A Raspberry Pi Pico is a low-cost microcontroller device. Microcontrollers are tiny computers,


but they tend to lack large volume storage and peripheral devices that you can plug in (for
example, keyboards or monitors).

A Raspberry Pi Pico has GPIO pins, much like a Raspberry Pi computer, which means it can be
used to control and receive input from a variety of electronic devices

Raspberry Pi Foundation is well known for its series of single-board computers (Raspberry Pi
series). But in January 2021 they launched their first micro-controller board known as
Raspberry Pi Pico.

It is built around the RP2040 Soc, a very fast yet cost-effective microcontroller chip packed
with a dual-core ARM Cortex-M0+ processor. M0+ is one of the most power-efficient ARM
processorRaspberry Pi PICO board

[Type text] Page 16


[Type the document title]

Raspberry Pi Pico is a small, fast, and versatile board that at its heart consists of RP2040, a
brand-new product launched by Raspberry Foundation in the UK. It can be programmed
using MicroPython or C language.

Raspberry Pi PICO Board Layout

Raspberry Pi Pico is made up of several components. The board layout given above shows some
of them: RP2040 Microcontroller, Debugging pins, Flash Memory, Boot selection button,
programmable LED, USB port, and power pin.

What is RP2040 Microcontroller Chip?

[Type text] Page 17


[Type the document title]

RP2040 microcontroller is a custom-designed processor chip by the Raspberry Pi foundation


itself. It is a powerful but cost-effective processor, featuring a dual-core Arm Cortex-M0+
processor running at 133Mhz.

It has 264KB of internal RAM and support for up to 16MB of onboard flash memory.

A wide range of flexible I/O operations is possible including I2C, SPI, and Programmable
general purpose I/O (GPIO).

What is the meaning of RP2040?

The name of the RP2040 microcontroller is made up of 5 sections:

 RP in RP2040 means ‘Raspberry Pi’.


 2 signifies the number of processor cores the microcontroller has i.e, 2 cores.
 0 represents the type of processor core the RP2040 microcontroller has. This processor is
called ARM Cortex-M0+ processor. Other microcontrollers of this series by ARM are
named as Cortex-M1, Cortex-M3, Cortex-M4, Cortex-M7 etc.
 4 means the microcontroller has has 264 kilobytes (kB) of RAM. Which is based on a
special mathematical function: floor(log2(RAM/16)).
 0 simply means there is no non-volatile storage on-board.

[Type text] Page 18


[Type the document title]

Raspberry Pi PICO Pinout

The Raspberry Pi Pico pinout shows that it has a total of 40 pins including GND and Vcc
pins. The pins can be categorized as Power, ground, UART, GPIO, PWM, ADC, SPI, I2C,
system control, and Debugging pins.

Unlike the raspberry pi computer board series, GPIO pins present on the Pico board have
multiple functions.

For example, GP4 and GP5 pins can be either used as digital input or digital output or I2C1
(SDA and SCK pins) or UART1 (Rx and Tx). But only one function can be enabled at a time.

How many GPIO Pins are there on Pi Pico?

[Type text] Page 19


[Type the document title]

In Raspberry Pi Pico, out of 40 pins, 26 pins are multi-functional GPIO pins. These 26
GPIO pins can be used both as digital input and digital output. These digital pins are marked
from GP0, GP1, and up to GP22.

The marked GP23, GP24, and GP25 are not exposed on the header. These GPIO pins are
used for internal board functions:

Pi pico Pins that are not exposed

How many Analog Pins are in Pi Pico?

The board comes with 4 analog pins with 12-bit ADC. Hence, we can use these pins to read
analog inputs from various sensors.

But one out of these four pins(ADC 4) is not provided as a GPIO pin on the board. This
fourth ADC pin is internally connected to a temperature sensor.

NOTE: Therefore, to measure the temperature we can directly use this build-in temperature by
reading the analog value of ADC4.

[Type text] Page 20


[Type the document title]

 The Raspberry Pi Pico has 8 PWM blocks/slices(1-8) and each PWM block provides
up to two PWM outputs(A-B). This means each block can drive up to two PWM
outputs.

[Type text] Page 21


[Type the document title]

 Hence, there is a total of 16 PWM output channels available at a time and every
GPIO pin on the pico is capable of generating PWM output.
 So all GPIO pins can be configured to get PWM signal output when required but
two GPIO pins with the same PWM designation cannot be used at once.

I2C Pins on Raspberry Pi Pico

I2C is a two-wire, bi-directional serial bus that provides an easy and quick method for
transmission of transmission over a short distance between I2C enabled devices.

The Raspberry Pi Pico comes with two I2C controllers, both I2C controllers are accessible
through GPIO pins of Raspberry Pi Pico

PI Pins on Raspberry Pi Pico

Serial Peripheral Interface (SPI) is an interface bus that is used to transfer data between the
microcontroller and SPI-enabled devices. Raspberry Pi Pico supports two SPI interfaces that are
accessible through GPIO pins of the board

[Type text] Page 22


[Type the document title]

UART Pins on Pico

The Raspberry Pi Pico also contains two identical UART peripherals. UART (universal
asynchronous receiver-transmitter) pins are used for asynchronous serial communication
between the micro-controller and UART devices or other microcontrollers.

[Type text] Page 23


[Type the document title]

GPIO Interrupts on Pico

All GPIO pins on the board can be configured as an external interrupt if one of the following
changes in the state of GPIO pins occur:

1. Level high(+3v)
2. Level Low(GND)
3. Positive edge (transition from active low to active high)
4. Negative edge (transition from active high to active low)
Other Pins on Pico board:-

GND: is the Ground pin used to complete the circuit.

VBUS: is the micro-USB input voltage it is connected to micro-USB port pin 1.

VSYS: is the main system input voltage, which can vary in the allowed range 1.8V to 5.5V, and
is used by the on-board

SMPS: to generate the 3.3V for the board and its GPIO.

3V3_EN: connects to the onboard SMPS enable pin, and is set to high (to VSYS) connected
through a 100K resistor. To disable the 3.3V(which also de-powers the RP2040), short this pin
low.

[Type text] Page 24


[Type the document title]

3V3: is the main 3.3V supply to the board and its I/O, generated by the on-board SMPS. This pin
can also be used to power external components.

ADC_VREF: is the ADC pin power supply voltage, and is generated by filtering the 3.3V
supply coming through the board.

AGND: is the ground reference for GPIO26-29, there is a separate analog ground plane running
under these signals and terminating at this pin. If the ADC pins are not used or ADC
performance is doesn’t matter, this pin can be connected to digital ground.

RUN: is the RP2040 enable pin, and has an internal (on-chip) pull-up resistor to 3.3V of about
~50K Ohms. To resetRP2040, short this pin low.

Specifications of R-PI Pico:

 Dual-core Arm Cortex M0+ processor running at 133 MHz


 Board comes with 264KB of SRAM, and 2MB of onboard Flash memory
 Comes with the castellated module that allows us to solder it directly to carrier boards
 USB 1.1 with device and host support
 Low-power sleep and dormant modes
 Drag-and-drop programming using mass storage over USB
 26 × multi-function GPIO pins
 2 × SPI peripherals, 2 × I2C controllers, 2 × UART peripherals, 3 × 12-bit ADC, 16 ×
controllable PWM channels
 Accurate clock and timer on-chip
 Temperature sensor
 Accelerated floating-point libraries on-chip
 It features 8 Programmable I/O (PIO) state machines for custom peripheral support

[Type text] Page 25


[Type the document title]

CHAPTER-5

SOFTWARE

Software introduction:

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.

Fig. 3.1 Opening arduino-nightly-windows.zip

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). Doubleclick the icon
to start the IDE.

[Type text] Page 26


[Type the document title]

Fig:3.2 Launch 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

[Type text] Page 27


[Type the document title]

Fig:3.2 Create a new project

Fig: 3.3Open an existing project example

[Type text] Page 28


[Type the document title]

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 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
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.

Fig:3.4 Select your serial port

Before explaining how we can upload our program to the board, we must demonstrate the function of
each symbol appearing in the Arduino IDE toolbar.

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.

[Type text] Page 29


[Type the document title]

Wait a few seconds; you will see the RX and TX LEDs on the board, flashing. If the upload is
successful, the message "Done uploading" will appear in the status bar.

Fig 3.5 function of each symbol appearing in the Arduino IDE toolbar

In this chapter, we will study in depth, the Arduino program structure and we will learn more new
terminologies used in the Arduino world. The Arduino software is open-source. The source code for the
Java environment is released under the GPL and the C/C++ microcontroller libraries are under the LGPL.
Sketch: The first new terminology is the Arduino program called “sketch”. Structure Arduino programs
can be divided in three main parts: Structure, Values (variables and constants), and Functions. In this
tutorial, we will learn about the Arduino software program, step by step, and how we can write the
program without any syntax or compilation error. Let us start with the Structure. Software structure
consist of two main functions:

Setup( ) function

Loop( ) function

[Type text] Page 30


[Type the document title]

Fig: 3.6 Bare minimum code

Data types in C refers to an extensive system used for declaring variables or functions of different types.
The type of a variable determines how much space it occupies in the storage and how the bit pattern
stored is interpreted. The following table provides all the data types that you will use during Arduino
programming.

[Type text] Page 31


[Type the document title]

CODING:

[Type text] Page 32


[Type the document title]

WORKING:

CONCLUSION

[Type text] Page 33


[Type the document title]

REFERENCES:

[Type text] Page 34

You might also like