You are on page 1of 21

HANOI UNVERSITY OF SCIENCE AND TECHNOLOGY

Embedded Control

REPORT
Topic: Design pressure monitoring and control systems

Students ID
Nguyễn Quốc Hưng 20176943
Lại Phúc Đăng 20176928
Trần Văn Nam 20176953
Phan Xuân Nam 20171556

Hanoi, January 19 2021


Self-assignment

Nguyễn Quốc Hưng_20176943 9/10


idea up, report making, circuit design
Lại Phúc Đăng_20176928 9/10
idea up, report making, circuit design
Phan Xuân Nam_20171556 Idea up 5/10
Trần Văn Nam_20176953 Idea up 5/10

Preface


Today, together with the applications of science and technology of the world, we are
changing, civilized and more modern.

The development of electronic technology has created a series of devices with outstanding
features such as high precision, fast speed, compactness ... are essential factors to increase
the labor efficiency of children. people.

Automation is becoming a science with multiple tasks. Automation has met the constant
requirements of different industries and fields to the essential needs of people in everyday
life. One of its advanced products is the embedded system. A very important application of
the automation technology industry is the control and monitoring of systems with very
sophisticated remote control devices that achieve high productivity and economy.

Starting from that application, we would like to propose a design plan for the pressure
monitoring and control system.

Part 1: Theoretical Basis

1. Part 1: Technology description theoretical basis and system analysis


i. System analysis
a) Concept design.

Design a pressure controller based on industry devices.

The controller can measure continuously liquid level and choose a set point for desired
level.

Use PID to improve performance of controller.

Overcurrent and Short Circuit Protection.

b) Block diagram:
100-240VAC 50/60Hz

Power supply
circuit

UART RS232 RS232


LCD I2C transceiver Interface
MCU
DAC Protection Analog
SPI output
Analog
Input ADC ADC
isolator

c) System description:
 Use the power source AC 100-240V 50/60Hz
For using industrial power, the embedded controller must incorporate an AC / DC unit to
convert industrial voltage to DC voltage. To power the microcontroller, a
DC/DC converter is used.
 The user interface can display the pressure values to be measured and the usage
modes can be set according to the user's requirements.
Displays measured values and selects operating modes according to user requirements
 Pressure measurements
The method of pressure measurement depends on the type of pressure
Static pressure measurement
Measure directly through a hole drilled in the wall
Indirect measurement through deformation of the wall of the vessel under the action of
pressure
Dynamic pressure measurement
As a general rule, total efficiency and static pressure are measured
Can be measured by applying total pressure on the front diaphragm, applying static
pressure on the back membrane of the measuring diaphragm, the output signal is to
measure the difference between total pressure and static pressure.
Pressure is measured in pascal (Pa).
In industry, we also use bar (1bar = 10 ^ 5 Pa).

Formula determined:
dF
P= dS

- dF: force
- dS: the area of the wall of the tube bearing the applied force

In this topic, we measure pressure using Pressure Sensor to measure. With the advantages
of simplicity, ease of use, and periodic maintenance, quality is guaranteed
 Several sensors measure pressure:
Pressure sensor is a device used to measure pressure & convert pressure into electrical
signals. Signals are transmitted to the displays or the controller, PLC by the power cable.
The output signal of the pressure sensor is Analog with signal types: 0-5V, 0-10V, 2-10V,
0.5-4.5V, 4-20mA, 0-20mA ...
In the past, we used to use 0-10V output signal because the control circuit microprocessor
or main board from Japan only received 0-10V. Today, according to the general trend of
the world, all pressure sensors are standardized using 4-20mA signals.
Even if you only encounter 4-20mA or 0-10V analog signals, other types of signals are still
used on pressure sensors:
Of course there will be 0-5V
0.5-4.5V signal
The 0-20ma signal type was also used in the past
4-20mA / HART signal
Modbus signaling is integrated recently
Although there are many different types of signals used for pressure sensors, up to 90% of
4-20mA signals are used.
Because,
4-20mA minimizes the error when pulling away due to no voltage drop like 0-10v
High noise cancellation capacity on 2 4-20mA wires both source and signal
Almost all devices use 4-20mA signals as the standard for connection.
d) Choose components (All components can be replaced with other components have
similar datasheet)
From the block diagram, we have the source 100-240VAC
 AC/DC IC:
The minimum requirements for the AC/DC to operate in the product are:
Table 2. Requirements for AC/DC
Index Requirement Value
1 Input voltage 100~240VAC
50/60Hz
2 Output voltage 12V
3 Minimum power 5W

In this project, we choose IC RAC05-12SK/277.


DC/DC IC:
The minimum requirements for the DC/DC to operate in the product are:
Table 4. Requirements for DC/DC

Index Requirement Value


1 Input voltage 12V
2 Output voltage 5V

In this project, we choose IC ITR0312S05.


In measurement the problem is often encountered signal interference. Signal
interference is when the transmit and receive position values are not equal in
value. It is possible that the signal value may be decreased or increased. This
makes monitoring and control difficult.
 First, we should handle the EMC from the input signal
Offer:
 OMX333UNI isolator – filter
Inputs that read common signals such as: 0… 5 mA, 0… 20 mA, 4… 20 mA,
0… 2 V, 0… 5 V, 0… 10 V
The output of the OMX39PM receives a signal such as: 0… 20, 4… 20 mA,
0… 2/5/10 V The request signal can be set to ± 20 mA, ± 10 V.
The equipment's anti-interference Isolation coefficient reaches: 2500 VAC
Device error is: 0.1%
Power supply for converter is: 10 to 30VDC, normally use 24VDC
Normal converter working temperature: -20… 60 C
The dimensions of the switchboard mounting box is: 113 x 98 x 22mm
 Noise filter circuit

Choose the Noise filter circuit because it is more compact and saves a great
deal of money when it comes to 4-20mA analog signal interference.
 Choose current sensing
To connect from 4-20 mA signal to ADC, we offer to use a
Current Sensing and in this case, we choose HW685 because of
cheap price, easy to find, stability.

Technical parameters:
Current Input support: 4 ~ 20mA & 0 ~ 20mA
Voltage Output support: 0 ~ 3.3VDC / 0 ~ 5VDC / 0 ~ 10VDC
Size: 25 x 42mm
We will use the voltage range as under to compliant for ADC
 0~3.3VDC range: J1 1,2 feet off, 3,4 feet off
 0~5.0VDC range: J1 1,2 feet short, 3,4 feet shorted
Price: 2.5$
 Choose ADC:
Choose the ADC which have one simple digital output, and one analog input
In the table below, we offer some ADC which is comfortable
ADS7885 ADS7888 ADS7827 ADS7884 ADS7887
Resolution (Bits) 8 8 8 10 10
Number of input 1 1 1 1 1
channels
Input range( Max) 5.5 5.25 5.25 5.5 5.25
Operating temperature -40 to -40 to 125 -40 to 85 -40 to 125 -40 to 125
125
Digital supply (Min) 2.7 2.35 2.7 2.7 2.35
(V)
Digital supply (Max) 5.5 5.25 5.25 5.5 5.25
(V)
Approx. price (US$) 1.1 0.9 0.704 1.5 1.25

We will offer ADS7884 for this project because of high resolution, the price is
not too expensive and easy to buy.

Terminal functions

Terminal I/O Description


Name No
VDD 1 - Power supply input also acts like a reference
voltage to ADC
GND 2 - Ground for power supply, all signal are referred
with respect to this pin.
VIN 3 I Analog signal input
SCLK 4 I Serial data out
SDO 5 O Serial data out
CS 6 I Chip select signal, active low
 Choose DAC:
Choose the DAC which using SPI communication and has at least 1 input, 1
output.
In the next table, we will offer some DAC which is suitable for the project.
DAC5311 DAC6311 DAC6571 DAC5311-Q1
Resolution 8 10 10 8
DAC 1 1 1 1
channels
Output range 5.5 5.5 5.5 5.5
(Max)
(mA/V)
Output range 0 0 0 0
(Min) (mA/V)
Operating -40 to 125 -40 to 125 -40 to 125 -40 to 85
temperature
range (C)
Approx. price 0.44 0.572 0.572 0.519
(US$)

Choose DAC6311 because of high resolution, the price is not too expensive and
easy to buy.

Pin functions
Pin I/0 Description
Name No
AVDD/VREF 4 I Power supply input +2.0V to +5.5V
DIN 3 I Serial data input. Data are clocked into the 16- bit shift
register on the falling edge of the serial clock input
GND 5 - Ground reference point for all circuitry on the part
SCLK 2 I Serial clock input. Data are transferred at rates up to
50MHz
SYNC 1 I Level- trigged control input (active low)
VOUT 6 O Analog output voltage from DAC

 Choose MCU:
From block diagram, a MCU has at least 1-I2C, 2-SPI, 1-UART is required. 
  Atmega324PB MSP430FR4131 MSP430FR2032
Operating voltage 1.8 – 5.5V 1.8 – 3.6V 1.8 – 3.6V
Operating -40 to105 ̊C -40 to 105 ̊C -40 to 105 ̊C
temperature
Digital 3 UART 1 UART 1 UART
Communication
2 SPI 2 SPI 2 SPI
Peripherals
2 I2C 1 I2C 1 I2C
Pin count 44 60 60
Price 1.93$ 0,43$ 0.537$

We offer Atmega324PB although it is more expensive, it has only 44 pin counts


and more stability.

 Choose isolator:
DAC Isolator: Choose isolator has three forward channels,
since the controller needn’t receive data from DAC. Only three lines for SPI
communication (SS, SCLK, and MISO/MOSI). 
  ISO7330-Q1  ISO7830  ISOW7841A-Q1 
Operating voltage  2.25 – 5V  2.25 – 5V  3 – 5.5V 
Forward/reverse  3/0  3/0  3/1 
Operating -40 – 125 ̊C  -55 – 125 ̊C  -40 – 125 ̊C 
temperature 
Price  1.125$  2.957$  5.951$ 
 
Choose ISO7330-Q1 has enough channels and cheap price. 

 
 ADC Isolator: similar with DAC isolator, MCU needn’t transmit data to ADC. 
  ISO7731-Q1  ISO7831  ISO7332 
Operating voltage  2.25 – 5.5V  2.25 – 5.5V  3.3 – 5V 
Operating temperature -40 – 125 ̊C  -55 – 125 ̊C  -40 – 125 ̊C  
Forward/reverse  2/1  2/1  2/1 
Price  0.945$  2.464$  1.232$ 
 
Choose ISO7731-Q1 has low price and wide operating voltage. 

 UART:
We choose RS232 and MAX232 (RS232 transceiver)

MAX232
Operating voltage 3 to 6V
Operating temperature -40 to 85 ̊C
Drivers 2
Receivers 2
Price 0.23$

 User interface: 
The UI is included 4 buttons, 1LCD, 3 LEDs. 
The LCD will indicate Set point, Measurement pressure, and other variables.  
Choose LCD 16x2 

e) Schematic:
 Source:

 Input: Since input range of ADC is 0 - 5.25V,


The signal 4-20mA from pressure sensor will connect to the current sensing to
reduce EMC, and next the 4-20mA will go through the HW685 to have the
voltage we need to connect to the ADC
OUTA is connected to SS0 of MCU.
OUTB is connected to SCK0 of MCU.
INC is connected to MISO0 of MCU.

 Output: To amplifier output from 0-5.5V to 0-10V, an op-amp is used. 

INA is connected to SS1 of MCU. 


INB is connected to SCK1 of MCU. 
INC is connected to MOSI1 of MCU. 

 
 

 User’s Interface: A 1602 I2C LCD Module is used for i2c communication


with LCD. 
SDA is connected to SDA1 of MCU. 
SCL is connected to SCL1 of MCU.

 MAX232
RXD1 connect to TXD1 and TXD2 connect to RXD2

 Serial of buttons:
Button 1: Enter
Button 2: Back
Button 3: Up
Button 4: Down

 MCU:
2. Part 2: Finite State Machine:
i. Operation:
Because the users will choose the pressure sensor so the Set Point will depend on
their demand.

No Variable Symbol Default


1 Set Point SP A
2 Measurement valued MV
3 Alarm level AL B

In this case, I will A and B are constants.

MV<AL

MV>=AL

Run Alarm
MV<AL

MV>=AL
State Description
Run Control by PID controller.
Alarm Output signal = Low.

 User’s interface
Up, down

Enter Enter
Choose
Run Back parameters Back Control Up, down

State Access Description


Run (1) Default Indicate: Setpoint value,
Measurement value.
Back from (2)
Choose Enter from (1) Indicate:
parameters
Back from (3) 1. Setpoint
(2)
2. Kp
3. Ki
4. Kd
5. Alarm level
Up, down to select parameters want
to manipulate.
Control (3) Setpoint: Enter from Indicate: the value of chosen
(2) parameters.
Up, down to manipulate the value.
Control Description
Setpoint 0<= Setpoint <=C
Up=1, Setpoint += 0.2
Down=1, Setpoint -= 0.2
Kp 1<=Kp<=9999
Up=1, Kp +=10
Down=1, Kp -=10
Ki 0<=Ki<=9999
Up=1, Ki +=10
Down=1, Ki -=10
Kd 0<=Kd<=999
Up=1, Kd +=1
Down=1, Kd -=1
Alarm 0<= Alarm <= D
Up=1, Alarm +=0.2
Down=1, Alarm -=0.2

3. Part 3: Result
During the project, we have properly implemented the requirements given by
the teacher, we have learned a lot of new knowledge such as knowing more
about the embedded system and how to choose, evaluate, and simulate
components accordingly.
The limit of the project:
The setting of variable values can be optimized by connecting and
communicating with a computer via UART, but in this project we have not
done because of limited time.
4. Part 4: Reference
https://www.tme.eu/en/details/rac05-12sk_277/ac-dc-converters/recom/
https://dientutuyetnga.com/products/module-hw685-dong-dien-ap-0-4-20ma-0-
3-3v-5v-10v
https://hshop.vn/products/mach-chuyen-tin-hieu-dong-ap-current-to-voltage-0-
4-20ma-to-0-3-3v-5v-10v-hw-685
https://html.alldatasheet.com/html-
pdf/897867/ATMEL/ATMEGA324PB/954/6/ATMEGA324PB.html
https://www.google.com/search?
q=Atmega324PB&oq=Atmega324PB&aqs=chrome..69i57j0i10i19l2j0i19i30l2j
0i19i30i395j69i60l2.616j1j7&sourceid=chrome&ie=UTF-8
https://www.alldatasheet.com/view.jsp?
Searchword=Atmega324pb&gclid=CjwKCAiAgJWABhArEiwAmNVTB0sqL
dy86vBCslgDIN-
NC3dhV8hOs15yZBycLzpBdJLuEUOK1DYmbRoCuKYQAvD_BwE
https://www.ti.com/product/MSP430FR4131?
fbclid=IwAR2TuCkN1xDbFNkYFbYpBnlbIn-
ha553HRq_nxER_E1QwXzRpWrK7NlDyLs
https://www.ti.com/document-viewer/MSP430FR2032/datasheet/device-
overview-slase454409#SLASE454409

You might also like