• 자주 조회사는 Query를 View로 만들어 두면 사용하기 편리하다. 
  • 만들어진 View는 Table조회 하는것과 같이 사용할 수 있다. 
  • 보안, 간략함, 일관성을 유지 할 수 있다. 
  • Join과 Group을 이용하여 여러Table의 정보를 하나의 View로 만들수 있다. 

SQL Server Views

 

Summary: in this tutorial, you will learn about views and how to manage views such as creating a new view, removing a view, and updating data of the underlying tables through a view.

When you use the SELECT statement to query data from one or more tables, you get a result set.

For example, the following statement returns the product name, brand, and list price of all products from the products and brands tables:

 

SELECT product_name, brand_name, list_price FROM production.products p INNER JOIN production.brands b ON b.brand_id = p.brand_id;

Code language: SQL (Structured Query Language) (sql)

Next time, if you want to get the same result set, you can save this query into a text file, open it, and execute it again.

SQL Server provides a better way to save this query in the database catalog through a view.

A view is a named query stored in the database catalog that allows you to refer to it later.

So the query above can be stored as a view using the CREATE VIEW statement as follows:

 

CREATE VIEW sales.product_info AS SELECT product_name, brand_name, list_price FROM production.products p INNER JOIN production.brands b ON b.brand_id = p.brand_id;

Code language: SQL (Structured Query Language) (sql)

Later, you can reference to the view in the SELECT statement like a table as follows:

 

SELECT * FROM sales.product_info;

Code language: SQL (Structured Query Language) (sql)

When receiving this query, SQL Server executes the following query:

 

SELECT * FROM ( SELECT product_name, brand_name, list_price FROM production.products p INNER JOIN production.brands b ON b.brand_id = p.brand_id; );

Code language: SQL (Structured Query Language) (sql)

By definition, views do not store data except for indexed views.

A view may consist of columns from multiple tables using joins or just a subset of columns of a single table. This makes views useful for abstracting or hiding complex queries.

The following picture illustrates a view that includes columns from multiple tables:

Advantages of views

Generally speaking, views provide the following advantages:

Security

You can restrict users to access directly to a table and allow them to access a subset of data via views.

For example, you can allow users to access customer name, phone, email via a view but restrict them to access the bank account and other sensitive information.

Simplicity

A relational database may have many tables with complex relationships e.g., one-to-one and one-to-many that make it difficult to navigate.

However, you can simplify the complex queries with joins and conditions using a set of views.

Consistency

Sometimes, you need to write a complex formula or logic in every query.

To make it consistent, you can hide the complex queries logic and calculations in views.

Once views are defined, you can reference the logic from the views rather than rewriting it in separate queries.

 

산업 모니터링에 관한 다른 Contents도 확인 하세요. 

'ForBeginner' 카테고리의 다른 글

4-5. Kepware의 장점.  (0) 2021.05.22
8-9.Database mail  (0) 2021.05.20
8-6. Linked Server (Good, bad and OPENQUERY)  (0) 2021.05.20
2-5. Sensor와 PLC의 연결  (0) 2021.05.19
2-0. 왜 Sensor의 이해가 필요한가?  (0) 2021.05.19
  • 아래 보기와 같이 Remote서버에 연결하여 Proto Type의 결과물을 빨리 만들고자 할때 Linked server가 유용하다. 
  • 하지만, 속도에 문제가 있다. 
  • 그래서, 실제 Remote서버의 Data를 사용할때에는 OPENQUERY를 추천한다. 

Linked Server in SQL Server: the good, the bad, and the way to make it perfect!

 

 

Introduction (the good)

If you are not familiar with a linked server concept in SQL Server, don’t worry, you probably haven’t needed it yet. You are fortunate to source all your data needs from a single database server, and that is fine. Or maybe you are consuming your SQL Server needs from Azure Single Database or AWS RDS (both public cloud solutions don’t support linked server out of the box).

Most likely this is going to change (Azure VM and AWS EC2 have full support) and you will have to join data between multiple database servers, or even between different RDBMS systems. For example: All the transactional sales data is stored in SQL Server, but all the analytical sales data is stored on another SQL Server server (this could even be MySQL).

This is where Linked Server comes in handy, especially at the data discovery phase. When building a prototype needs to happen quickly and there is no time to adhere to the best practices, Linked Server can be the answer.

 

Linked Servers Basics

According to Microsoft, linked servers enable the SQL Server Database Engine and Azure SQL Database Managed Instance to read data from the remote data sources and execute commands against the remote database servers (for example, OLE DB data sources) outside of the instance of SQL Server. 

Linked Server is a pure convenience feature. With very little to no code changes, you can suddenly join multiple tables between local and remote/cloud servers. For example, let’s use WideWorldImporters transactional database

Figure 1

Linked Server effectively removes the need for a solution that will move and synchronize the data. You just setup a Linked Server (see Fig #2) and add a Linked Server reference in front of the three-part naming convention (see Fig #3). That’s all. A small price to pay for lots of convenience.

Figure 2

 

Figure 3

Problem (the bad)

While the Linked Server feature makes it easy to join tables between two or more different servers, it’s not free and it comes with a price tag: performance overhead. While joining a few small tables might not add noticeable pressure to the server, joining 3-5 fairly large remote tables might introduce locking and blocking and increase the run-time from seconds to minutes.

The main problem occurs when you run queries against a remote server, which is not healthy. When SQL Server runs a query with Linked Server, it will use the least optimal execution plan due to lack of knowledge of those remote tables. Meaning, your local SQL Server is clueless on remote table indexes and statistics, so it might use an incorrect joining mechanism and might be grossly inefficient.

For example, if you had to join all January 2013 orders between OLTP and OLAP tables and compare revenue per product while showing the five top contributors, we might build the following query (see Fig #4) to achieve that goal:

Figure 4

Reviewing Statistics IO (see Fig #5) and execution plan details (see Fig #6), we see:

Figure 5

 

Figure 6

As you might notice (far right), 93% of the query execution cost goes to a “mysterious” remote query.

Solution (a way to make it perfect)

One of the easiest ways to fix performance problems with a linked server is to run it via OPENQUERY.

What is OPENQUERY? According to Microsoft, OPENQUERY executes the specified pass-through query on the specified linked server. This server is an OLE DB data source. We can reference OPENQUERY in the FROM clause of a query as if it were a table name. We can also reference OPENQUERY as the target table of an INSERT, UPDATE, or DELETE statement. This is subject to the capabilities of the OLE DB provider. Although the query may return multiple result sets, OPENQUERY returns only the first one. 

One of the main advantages of OPENQUERY is remote execution. This  means the local server sends the query to the remote server with knowledge of those remote tables that are now local to the query. By the way, remote execution also enables the use of native syntax of the remote server, so you can take advantage of other RDBMS system performance tricks.

Here is how our original query will look with an OPENQUERY (see Fig #7). It’s still using the same linked server, but it happens indirectly now with an  OPENQUERY.

Figure 7

When reviewing Statistics IO (see Fig #8) and execution plan details (see Fig #9), we now see: 

Figure 8

 

Figure 9

Let’s compare Statistics IO and execution plans to see the differences between direct query linked server usage vs. an OPENQUERY linked server.

The most noticeable differences are:

  1. WorkFile reads in Statistics IO (see Fig #10)
  2. Remote Query 93% cost vs. most distributed cost in Execution Plan (see Fig #11) and partially replaced with Remote Scans.

Figure 10

 

Why Does It Work?

The main reason OPENQUERY will usually perform better is knowledge of the table in terms of indexes and stats, knowledge that a direct linked server doesn’t have.

As you can see, we have managed to cut the run-time from 22 seconds (using direct link server) down to 2 seconds (using OPENQUERY). Additionally, we can add indexes specific to the query to make OPENQUERY even faster.

Disclaimer

Since nothing is certain in this life other than taxes and death, your mileage may vary (“YMMV”). Please test it (preferably using DBCC FREEPROCCACHE) prior to deployment. In addition the query above that reduced run-time by 11 times, I also scored a drastic performance gain by using OPENQUERY in one of the clients. In that example, replacing all three direct linked server references reduced run-time by 10 times, to just a few seconds.

 

산업 모니터링에 관한 다른 Contents도 확인 하세요. 

'ForBeginner' 카테고리의 다른 글

8-9.Database mail  (0) 2021.05.20
8-7. View  (0) 2021.05.20
2-5. Sensor와 PLC의 연결  (0) 2021.05.19
2-0. 왜 Sensor의 이해가 필요한가?  (0) 2021.05.19
2-4. 센서와 변환기  (0) 2021.05.19

Sensor Connections: PNP versus NPN and Sourcing versus Sinking

산업자동화에는 24V용 센서가 주로 사용되며, NPN, PNP 두가지 타입이 있습니다. 두가지 타입의 센서는 PLC의 DI(Discrete Input) 모듈의 두가지 타입인 소스방식과 싱크방식에 맞춰서 사용해야 합니다. 

 

Transistor Effects

ON-OFF 형태의 신호를 다루는 전자장치(예를 들어, 입력센서)는 트랜지스터를 내장하고 있습니다. 트랜지스터는 반도체 재질의 소형 릴레이이며, 전류를 흐르거나 차단하는 스위치와 같은 역할을 합니다. 트랜지스터는 약한 신호를 감지후 신호를 증폭하는 역할도 하게 됩니다. 증폭된 신호는 PLC의 입력모듈 또는 기타 장치들로 전달될 수 있습니다. 트랜지스터는 NPN(sourcing), PNP(sinking) 두가지 타입이 있습니다.

 

"P", "N"은 반도체 물질의 종류를 의미하며, "PNP", "NPN"은 이 물질들의 배열순서를 의미합니다. 트랜지스터는 base, collector, emitter로 구성된 3개의 핀을 가지고 있습니다. 

 

PNP versus NPN Switching

산업용 3선식 센서는 대부분 아래와 같은 선으로 구성되어 있습니다.

* +24 Vdc

* 0 Vdc

* 신호선

 

+24 Vdc, 0 Vdc 선은 센서의 구동에 필요한 전원공급용이며, NPN, PNP타입은 신호선이 어떻게 구동될 것인지 결정하게 됩니다.

PNP 타입의 센서는 emitter에 +24 Vdc가 인가되고, collector에 sinking 타입 PLC 모듈과 연결됩니다. 센서가 특정한 물체를 감지하면 base에 전류를 흐르게 하여 emitter-collector간 전류가 흐르게 됩니다. 즉, 신호선쪽으로 +24 Vdc가 인가되고, PLC의 sink 타입 입력모듈 단자를 통해 포토커플러(빛을 이용하여 전류를 흐르게 하는 스위치. 입력모듈이 입력을 확인하는 용도로 사용)를 거친후 0 Vdc로 이어지게 됩니다.

 

 

NPN 타입의 센서는 emitter에 0 Vdc가 인가되고, collector에 source 타입 PLC 모듈과 연결됩니다. 센서가 특정한 물체를 감지하면 base에 전류가 흐르게 하여 collector-emitter간 전류가 흐르게 됩니다. 즉, 신호선쪽으로 0 Vdc가 인가되고, PLC의 source 타입 입력모듈 단자를 통해 포토커플러를 거친후 +24 Vdc로 이어지게 됩니다.

 

Three-Wire Devices and Leakage Current

3선식 센서는 트랜지스터 특성상 누설전류가 발생합니다. 센서가 신호선 스위치를 OFF하고 있음에도 신호선을 통하여 미세하게 전류가 흐르는 현상입니다. 비정상적으로 높은 누설전류는 의도치 않게 PLC의 입력모듈내 포토커플러를 동작시켜 마치 센서가 무언가를 감지한 것처럼 인식하게 만들수 있습니다.

 

Sourcing versus Sinking Circuits

sinking(싱크방식) 입력모듈은 PNP 센서와 사용되며, 입력모듈은 센서 감지시 신호선에 +24 Vdc가 인가되길 기다리고 있습니다.

 

sourcing(소스방식) 입력모듈은 NPN 센서와 사용되며, 입력모듈은 센서 감지시 신호선에 0 Vdc가 인가되길 기다리고 있습니다.

 

 

PLC 기종의 따라 sinking/sourcing를 반대로 표기하는 경우도 있으니, 입력모듈의 결선도는 꼭 확인해 보는 것이 좋습니다.

 

Benefits of PNP versus NPN

PNP 타입의 센서는 케이블 손상시 신호선과 0 Vdc선이 단락될 경우가 있을 수 있습니다. 그 결과로 센서가 손상될 것입니다.

 

NPN 타입의 센서는 케이블 손상시 신호선과 0 Vdc이 단락될 경우가 있을 수 있습니다. 그 결과로 입력모듈에 계속 신호가 들어오는 형태가 되지만 센서가 손상되지는 않습니다.

'ForBeginner' 카테고리의 다른 글

8-7. View  (0) 2021.05.20
8-6. Linked Server (Good, bad and OPENQUERY)  (0) 2021.05.20
2-0. 왜 Sensor의 이해가 필요한가?  (0) 2021.05.19
2-4. 센서와 변환기  (0) 2021.05.19
2-3. Analog & Digital Sensors  (0) 2021.05.19
  • PLC에서 올라온 Sensor의 값이 어떻게 연결 되고 변환 되었는지 알고 있어야 한다. 
  • 현장의 값과 다른 경우, 무엇이 문제인지 알려면 기본적인 지식이 있어야 한다. 
  • PLC Engineer와 원활한 소통을 위해서 Sensor의 이해가 필요하다. 

 

PLC 프로그램을 하다보면

아날로그 입력을 받아 처리하는 경우가 있을 것입니다.

아날로그 입력은 디지털(ON,OFF) 입력과는 달리 연속적인 값을 받아야 하는데요.

대표적으로 압력, 높이, 무게, 온도등이 해당됩니다.

이러한 값을 받아 PLC에서 정확하게 프로그램하기 위해서는

두가지 개념을 이해해야 합니다.

첫째는 스케일(scale) 입니다.

스케일은 범위를 말하는데요.

공학을 공부하거나 현장에서 기계설비를 다루는 사람들은

바늘계기를 가리키며 "풀스케일(full scale)이 얼마인가?"라고 묻곤 합니다.

풀 스케일은 그림에서 보듯이 최대로 표시할 수 있는 범위를 의미합니다.

이처럼 각종 센서들이 유효하게 측정할 수 있는 범위가 어디까지인지

제품사양서를 통해 반드시 확인해야 하는 것입니다.

둘째는 분해능(resolution) 입니다.

센서로부터 입력되는 연속적인 신호(아날로그 신호)를

PLC의 아날로그 입력모듈에서 얼마만큼 작게 쪼개서 표시할 수 있는가를 확인해야 합니다.

분해능이 높을수록 정밀한 값을 표시할 수 있을것입니다.

예를 들어

10bar의 압력을

PLC에서

10개로 쪼갤수 있다면 1bar, 2bar, 3bar와 같이 표시될 것이고,

100개로 쪼갤수 있다면 0.1bar, 0.2bar, 0.3bar와 같이 더 정밀한 값으로 표시할 수 있을 것입니다.

자, 스케일(scale)과 분해능(resolution)을 이해하셨다면

SMC 압력센서와 미쯔비시 PLC 아날로그 입력모듈을 가지고

실제 프로그램까지 작성해보도록 하겠습니다.

압력센서는

PSE564-01 로 선정하였습니다.

아래 사양서를 확인해 보도록 하겠습니다.

위 사양서에서 빨간색 부분을 보시면

센서의 스케일(범위)이 0kPa~500kPa까지이며,

출력이 1~5V 범위라는 것을 알 수 있습니다.

이와같이 센서가 가지는 측정 스케일과 출력신호 스케일을 정확히 파악 하셔아 합니다.

PLC는 FX2N-8AD로 선정하였습니다.

위 사양서에서 빨간색 부분을 보시면

입력범위는 -10V ~ 10V(전체 범위는 20V)이고

분해능은 2가지가 있습니다.

1) 20V를 8000개로 쪼갤수 있는 경우(일반분해능)

2) 20V를 32000개로 쪼갤수 있는 경우(고분해능)

여기서는 일반분해능을 선택하겠습니다

20V를 8000개로 쪼갤경우 2.5mV단위로 표시되게 됩니다.

그런데 센서출력은 1~5V이므로

PLC에서 사용되는 값의 범위는 400~2000이 될 것입니다.

이와같이 PLC의 분해능과 입력범위에 대해서 정확히 파악 하셔야 합니다.

그러면 센서의 스케일과 PLC의 분해능에 따른 입력범위를 가지고 새로운 그래프를 그려보면

PLC 아날로그 입력모듈을 통해 읽혀지는 값이 400이면 현재 압력이 0kPa이고,

2000이라면 500kPa이라는 것을 알수 있습니다.

이 그래프를 계산식으로 표현하면

y = a(x-400) (a는 기울기 또는 gain값으로 500/1600 = 0.3125가 됩니다.)

예제)

x가 1200일때

y = 0.3125 x (1200-400)

= 250

즉, PLC 아날로그 입력값이 1200일때 250kPa이라는 압력값을 얻을수 있습니다.

PLC프로그램은 아래와 같습니다.

빨간색 원을 보면 아날로그 입력값이 1200일때 250으로 계산됩니다.

빨간색 네모를 보면 기울기 0.3125를 곱하지 않고

3125를 곱한 후 10000으로 나누어 주었습니다.

PLC에서 실수형 연산보다는 정수형 연산이 편하기 때문입니다.

 

'ForBeginner' 카테고리의 다른 글

8-6. Linked Server (Good, bad and OPENQUERY)  (0) 2021.05.20
2-5. Sensor와 PLC의 연결  (0) 2021.05.19
2-4. 센서와 변환기  (0) 2021.05.19
2-3. Analog & Digital Sensors  (0) 2021.05.19
2-2. Types of Sensors  (0) 2021.05.18

센서와 변환기의 중요한 차이점 중 하나는 센서가 물리적 변화를 감지 함 주변에서 발생하는 반면 트랜스 듀서는 물리량 또는 비 전기를 다른 신호로 변환합니다. 또는 전기 신호. 센서와 변환기 사이의 다른 차이점은 아래의 비교 차트에서 설명합니다.

트랜스 듀서와 센서는 모두 물리적입니다.물리적 양을 측정하기 위해 전기 및 전자 기기에 사용되는 장치. 센서는 에너지 레벨을 감지하여 디지털 미터로 쉽게 측정 할 수있는 전기 신호로 변경합니다. 트랜스 듀서는 동일한 형태 또는 다른 형태로 에너지를 전달합니다.

내용 : 센서 대 트랜스 듀서

  1. 비교 차트
  2. 정의
  3. 주요 차이점
  4. 결론

 

비교 차트

비교 근거감지기변환기

정의 물리적 변화가 주변에서 발생하고이를 읽을 수있는 양으로 변환 함을 감지합니다. 변환기는 작동 할 때 에너지를 한 형태에서 다른 형태로 변형시키는 장치입니다.
구성 요소 센서 자체 센서 및 신호 컨디셔닝
기능 변경 사항을 감지하고 해당 전기 신호를 유도합니다. 한 형태의 에너지를 다른 형태로 전환.
예제들 근접 센서, 자기 센서, 가속도 센서, 광 센서 등 서미스터, 전위차계, 열전대 등

 

센서의 정의

센서는 물리량 (예 : 열, 빛, 소리 등)을 쉽게 읽을 수있는 신호 (전압, 전류 등)로 측정하는 장치입니다. 교정 후 정확한 판독 값을 제공합니다.

예제들 - 온도계에 사용 된 수은은측정 된 온도는 보정 된 유리 튜브의 도움으로 쉽게 측정 할 수있는 액체의 팽창과 수축으로 이어진다. 열전쌍은 또한 온도를 온도계로 측정 한 출력 전압으로 변환합니다.

센서는 전자 장비에 많은 응용 분야를 가지고 있습니다. 그 중 몇 가지가 아래에 설명되어 있습니다.

  1. 모션 센서는 가정 보안 시스템 및 자동화 도어 시스템에 사용됩니다.
  2. 포토 센서가 적외선 또는 자외선을 감지합니다.
  3. 가속도계 센서는 화면 회전을 감지하기 위해 모바일에 사용됩니다.

변환기의 정의

트랜스 듀서는비 전기 신호의 물리적 속성을 쉽게 측정 할 수있는 전기 신호로 변환합니다. 트랜스 듀서에서의 에너지 변환 과정은 트랜스 덕션 (transduction)으로 알려져 있습니다. 형질 도입은 두 단계로 완료됩니다. 먼저 신호를 감지하고 추가 처리를 위해 신호를 강화합니다.

변환기는 세 가지 주요 구성 요소를 가지고 있습니다. 그것들은 입력 장치, 신호 조절 또는 처리 장치 및 출력 장치입니다.

입력 장치는 측정 량을 수신합니다.비례 아날로그 신호를 컨디셔닝 디바이스로 전송할 수있다. 컨디셔닝 디바이스는 출력 디바이스에 의해 쉽게 받아 들여지는 신호를 수정, 필터링 또는 감쇠합니다.

센서와 변환기의 주요 차이점

다음은 센서와 변환기의 주요 차이점입니다.

  1. 센서는 주변의 물리적 변화를 감지하는 반면 변환기는 한 형태의 에너지를 다른 형태로 변환합니다.
  2. 센서 자체는 센서의 주요 구성 요소이며 센서와 신호 조정은 센서의 주요 구성 요소입니다.
  3. 센서의 주요 기능은 물리적 변화를 감지하는 반면 변환기는 물리적 양을 전기 신호로 변환합니다.
  4. 가속도계, 기압계, 자이로 스코프가 센서의 예이며 서미스터와 열전대는 변환기의 예입니다.

 

결론

센서와 변환기는 둘 다 측정하기 어려운 온도, 변위, 열 등과 같은 물리적 양을 측정하는 데 사용되는 물리적 장치입니다.

산업 모니터링에 관한 다른 Contents도 확인 하세요. 

 

'ForBeginner' 카테고리의 다른 글

2-5. Sensor와 PLC의 연결  (0) 2021.05.19
2-0. 왜 Sensor의 이해가 필요한가?  (0) 2021.05.19
2-3. Analog & Digital Sensors  (0) 2021.05.19
2-2. Types of Sensors  (0) 2021.05.18
8-7. MSSQL(View)  (0) 2021.05.18

Different Types of Sensors – Analog and Digital

 

Sensors have become an integral part of the embedded system. Right from your mobile to security systems installed at home. They are also becoming important for meteorological stations to predict weather parameters like temperature, pressure, humidity, and many more.

To interface any sensor to the microcontroller, you have to know the function of the sensor and different types of sensors used in remote sensing, weather systems, security devices, health equipment etc. But, before going to know about sensors and its types you must know the basic definition of the sensor and its use.

What is a Sensor and How does it Work?

Sensor – Block Diagram

Sensor is a module or chip that observes the changes happening in the physical world and sends the feedback to the microcontroller or microprocessor. Excitation (Power supply) and Grounding must be provided to the sensor for the proper working.

Classification of Sensors

Microcontroller accepts two types of inputs depending up on the type of sensor i.e. analog or digital.

Analog sensor senses the external parameters (wind speed, solar radiation, light intensity etc.) and gives analog voltage as an output. The output voltage may be in the range of 0 to 5V. Logic High is treated as “1” (3.5 to 5V) and Logic Low is indicated by “0” (0 to 3.5 V).

Analog Sensor – Block Diagram

Unlike analog sensor, Digital Sensor produce discrete values (0 and 1’s). Discrete values often called digital (binary) signals in digital communication.

Digital Sensor – Block Diagram

Sensor Selection [Analog or Digital]

To select a sensor it’s important to know about analog and digital circuits. Analog circuits are made up of analog components like resistor, capacitor, Operational amplifiers, diodes and transistors.

 

Whereas digital circuits consist of logic gates and microcontroller chips. Analog signals are much affected by external noise and create errors in the output signal. But digital signals are susceptible to noisy environments and hence digital sensors are preferred over analog ones.

Note: If your application needs better accuracy and throughput go for digital sensors.

Problem with digital sensors:

Digital sensors have low calculation range. For example, digital temperature sensors such as HYT 271 and SHT series have lower temperature range.

But analog temperature sensors (RTD) have higher resolution (positive and negative temperature). This feature makes analog sensors suitable for wide temperature range and stability. The analog output from the sensor is processed by the ADC (Analog to Digital Converter) of the microcontroller.

As discussed above, how sensors are classified and how to select a sensor, now it’s time to know about different sensors in nature and how they are used in the industrial applications.

Types of Sensors

1. Analog Pressure Sensor

Analog Pressure sensors work on the input voltage and against the known pressure value. The output of pressure sensor is analog output voltage (normalized). The units of pressure are psi (pounds per square inch).

Analog pressure Sensors (Barometric)

2. Digital Pressure Sensor

Digital pressure sensor has inbuilt signal processing unit such as ADC that converts the analog input to digital pressure output. Generally, in most of the digital sensors I2c based digital signals are taken out.

 

Some of the applications of the Barometric pressure sensor are:

  • Leak detection in gas pipes and cables
  • Measuring pressure for environmental purpose
  • Radiosonde
  • Tyre pressure monitoring
  • Respiration analytics
  • Industrial and process control
  • Medical devices
  • Airflow monitoring
  • Drones
  • Inhalers
  • Water level measurement

3. Analog Hall effect/Magnetic Sensor (Position Sensor)

The Hall Effect sensor works on the magnetic field. It senses the magnetic field and gives the output voltage. When the magnetic field is positive output voltage increases above the null voltage (no magnetic field and zero current).

Applications of Hall sensor are:

  • GPS positioning
  • Current sensing
  • Speed movement detection
  • Magnetic code decoder
  • Metal detector
  • Controlling motors

4. Load cell (weighing sensors)

Load cells measures and process the weight. There are different types of load cell sensors based on usage of the application. Some of them are:

  1. Beam Load cells (Bending Load cell)

These are suited for normal weight measurement applications and industrial-weight measurement. Applications of beam load cell are

  • To fill the machinery
  • Tank weighing
  • Vehicle Onboard weight
  • Medical equipment
  • Bed weighing
  • To package machinery
  1. Single point Load cell

Single point load cells are used for low weight systems.

Applications:

  • Bench and retail scaling
  • Waste collection
  • Package and filling machinery
  1. Compression Load cell

These are suitable for high weight scaling systems.

Applications:

  • Medical devices
  • Measuring equipment
  • Pump controlling devices
  • Railway weight checkers

5. Temperature Sensor

Analog temperature sensor measures the temperature of the current location based on the resistance in variation. The value of resistance changes with temperature.

 

RTD sensors are best suitable for stability, accuracy and reliability. They comes with wide temperature range.

Applications:

  • To measure water temperature
  • Air temperature measurement
  • Air conditioning
  • Plastics
  • Food processing

6. Reflex Sensor

A simple reflex sensor has transmitter and receiver sections. The transmitter sensor emits a light beam and when an object is detected the receiver captures and process this as changeover signal.

Applications:

  • Monitors flow of material process
  • Level measurement
  • Print and Color detection
  • Inspection of Assembly
  • Sealing cap monitoring
  • Recording level of liquid quantities

7. Fork Sensor

Fork sensors are quite close to the reflex sensor but efficient in picking and detecting very small objects with a size of micrometers (µm).

Applications:

  • Bonding control
  • Placing and sorting small components
  • Power supply control
  • Gap monitoring and control
  • Recognize holes and drills

8. Wind speed / Wind direction Sensor

Wind speed/wind direction sensor commonly called anemometer uses the ultrasonic technique to get wind speed and direction.

Applications:

  • Environmental weather stations
  • Drifter Buoys
  • Oceanographic and meteorological stations
  • Harbours and seaports
  • Road tunnels

9. Radar Sensor

Radar transmit short microwave signals that travel at the light speed. Radar sensors are used for measurement of liquid levels. The output analog current (4-20 mA). This current is converted to the voltage by placing a resistor and read by the ADC of a microcontroller.

10. Solar Radiation Sensor

Global radiation sensor (solar radiation) uses photo voltaic diode for measuring solar radiation.

Applications:

  • Meteorological stations
  • Hydrological and agriculture
  • Energy applications
  • Irrigation

11. Humidity Sensor

Humidity sensor calculates the humidity of the present location. Humidity is an important parameter for environmental observance, consumer electronics and medical diagnostics.

Applications:

  • Humidity transmitter
  • Handheld devices
  • Refrigerators
  • Air compressors
  • Weather stations
  • Industrial incubators
  • Medical systems
  • Dew measurement

12. Air Quality Sensor [Gas sensor]

This sensor monitors the number of gases in the air like CO2 (carbon dioxide), SO2 (sulfur dioxide), CO (carbon monoxide) etc.

Applications:

  • Meteorological institutes
  • Health agencies
  • Homes and Hospitals
  • Industrial applications
  • Ventilation systems
  • Air cleaning

13. Light Sensor

Light sensor captures the ambient light (dark/bright) and converts it to current.

Applications:

  • Display backlight in Mobiles and LCDs
  • PDA (Personal digital assistant)
  • TVs, Cameras
  • Toys
  • Automatic street light control
  • CCTVs

14. Rainfall Sensor

Meteorological agencies use rain gauge sensor to measure the amount of rainfall falls in a particular location. Rainfall is measured in mm. The most used device for measuring rainfall is Tipping bucket Rain gauge.

15. Soil Moisture Sensor

Soil moisture measures the amount of salt and moisture in the soils. It also measures the temperature in the soil. It is based on SDI-12 protocol.

16. Water Level Sensor

Water level sensor calculates the depth of water in lakes, dams and rivers. There are various analog and digital based water level sensors.

Applications:

  • Water level monitoring
  • Environmental applications
  • Groundwater tanks
  • Surface water applications

Conclusion

Sensors have become a vital part of consumer electronics, industrial electronics, Robotics and Internet of things. I hope this article gives you an overview of different types of sensors used in the industry.

 

산업 모니터링에 관한 다른 Contents도 확인 하세요. 

 

'ForBeginner' 카테고리의 다른 글

2-0. 왜 Sensor의 이해가 필요한가?  (0) 2021.05.19
2-4. 센서와 변환기  (0) 2021.05.19
2-2. Types of Sensors  (0) 2021.05.18
8-7. MSSQL(View)  (0) 2021.05.18
8-5. 트리거(Trigger)  (0) 2021.05.18

Five sensory organs of human body such as ears which senses sound in the environment nose which senses smell in the environment and tongue which senses taste of any food atom that we eat skin which senses the hotness or coldness of other body and eyes which senses different colors seen from it in

The same way sensor is an electronic device which detects and responds to some type of input from the physical environment and converts this output signals to in human readable display now let’s have a look

 

What is a Sensor?

In general, sensor is known as a Detector.

The basic definition of,

A sensor is an electronic equipment that is used to detect and observe the physical activities and pass the notifcation/signal to other electrical control devices.

In other words, a sensor is an electronic device that can transform energy from one form to another form. So, it is also called a Transducer.

The main function of the sensor is to identify and communicate with physical quantities such as temperature, heat, pressure, distance, moisture, gas, and so on.

 

And it provides output in the form of electrical signal to connected control systems.

 

You can easily understand this from following simple block diagram.

For example, in an automation system, the sensor is the most important equipment that provides an input to the programmable logic controller (PLC).

In daily life applications, commercial and industrial devices, the educational projects, different types of sensor are used with a specific role.

What are the different types of Sensors?

Sensors are split up into four main categories. Such as,

  • Analog Sensor
  • Digital Sensor
  • Active Sensor
  • Passive Sensor

Each category is having the different types of sensor as follows.

 

1. Temperature Sensor (온도 센서)

Temperature sensor uses to detect the temperature and heat energy and convert it into an electrical signal (in form of voltage or current).

There are several types of temperature sensor used.

  • Thermometer
  • Thermocouple
  • Resistance Temperature Detector (RTD)
  • Thermistor Temperature Sensor
  • Semiconductor Temperature Sensor
  • Vibrating Wire Temperature Sensor

The temperature sensor is used in a computer, refrigerator, automobile, medical device, cooking appliances, electrical motor, etc.

 

2. Pressure Sensor (압력 센서)

Pressure sensor is called Pressure Transducer or Pressure Transmitter or Piezometer.

A pressure sensor detects the pressure of air, gas, water and provides electrical signal to the controller.

 

According to different uses and many more features, it is divided into different parts like,

  • Vacuum Pressure Sensor
  • Absolute Pressure Sensor
  • Gauge Pressure Sensor
  • Differential Pressure Sensor

Pressure sensors are used in many systems like pneumatic, hydraulic, vacuum systems, etc.

 

3. Touch Sensor

The touch sensor is called a Tactile sensor. It is an electronic sensor that is used for detecting and recording physical touch.

Capacitive touch sensor, resistive touch sensor are the best example of touch sensor.

 

It is used in industrial applications like switches for turn on/off light, remote control by the air conditioner (AC), door open/close operation, elevator, and robotics, smartphones, so on.

An oximeter is one of the best example of a touch-based sensor to detect oxygen levels in the human body.

In this COVID pandemic, Pulse Oximeter is in huge demand. It is easy to handle and operate, even at your home. You can easily buy an online Pulse Oximeter.

 

4. Image Sensor

The image sensor is an electronic device that is used to detect the image pixels and provide information to the display devices.

There are analog and digital types of sensor. Generally, an electronic image sensor is classified into two main types.

  • Charge-Coupled Device (CCD)
  • Active Pixel Sensor 

For the digital camera, closed-circuit television (CCTV), medical imaging equipment, thermal imaging devices, radar, sonar, etc., image sensors are used.

 

5. Motion Sensor

Motion sensor measures and records physical activities or movements. It is classified into different types.

  • Active Motion Sensor
  • Passive Motion Sensor
  • Tomographic Motion Sensor
  • Gesture Motion Sensor

The motion sensor is used in home security, automatic doors operation, microwaves, robotics, ultrasonic waves, gesture detector, etc.

 

6. Light Sensor

Light sensor is a photoelectric device. This sensor detects and converts the brightness or luminescence of light or photon into an electrical signal.

There are three types of light sensor.

  • Photoresistor or Light Dependent Resistor (LDR)
  • Photodiode
  • Phototransistor

It is widely used in the solar system, automobile, agriculture sector (automatic sprinkler system), and electronic-based project device like Arduino.

 

7. Vibration Sensor

Sometimes, vibration sensor is known as Piezoelectric Sensor.

The vibration sensor detects and records any movement or activities. And it provides data or signals to connected machines or systems.

 

This sensor helps to send acknowledgement if there is any hazardous activity.

 

In an industrial area such as gas and oil, food and beverage, mining, metalworking, paper, wind power, power generation, the vibration sensords are needed.

 

8. Humidity Sensor

Humidity sensor is also known as a Hygrometer.

For detecting moisture in air and soil, the humidity sensor is very essential. Mostly, it is used in Air Conditioner (AC) system.

WS1 Pro is an example of the wireless humidity sensor.

 

9. Proximity Sensor (근접센서)

Proximity sensor can easily detect nearby objects without any physical touch. It is divided into different types like-

  • Capacitive Proximity Sensor
  • Inductive Proximity Sensor

It is widely used in smartphones, tablet computers, machines, robotic systems, roller coasters, etc.

 

10. Colour Sensor

Colour sensor is the type of photoelectric sensor.

It helps to sense the color of an object and recognize the color mark. This sensor uses RGB (red, green, and blue) color scale.

SEN-11195 is the best example of the color sensor.

For colour painting and printing, cosmetic material, textile area, medical diagnosis, computer color monitor, and the process control, colour sensor is used.

 

11. Radiation Sensor

A radiation sensor is an electronics instrument that senses and measures the radiation particles like alpha, beta, gamma, neutrons, X-ray.

Also, it senses electromagnetic radiation like waves, cosmic radiation (sunlight).

Radiation sensor includes three different type.

  • Gas-filled Radiation Sensor
  • Scintillation Radiation Sensor
  • Solid-state Radiation Sensor

This sensor is used for nuclear energy, medical imaging modalities, and monitoring of environmental radioactivity.

 

12. Level Sensor

The main role of the level sensor is to measure the level or height of different materials like solid, liquid, and gaseous.

It is classified into different parts.

  • Laser Level Sensor
  • Float Sensor
  • Capacitive Level Sensor
  • Resistive Level Sensor
  • Ultrasonic Level Sensor
  • Hydrostatic Level Sensor
  • Optical Level Sensor
  • Electromagnetic Level Sensor

It is widely used in vessel, container, water tank, fuel tank bin, etc for water level check.

 

13. Position Sensor

Position sensor determines the displacement and the position (like linear and rotational).

Basically, position sensor available in the different types.

  • Optical Position Sensor
  • Linear Position Sensor
  • Rotary Position Sensor
  • Inductive Position Sensor
  • Capacitive Position Sensor
  • Fiber-Optic Position Sensor
  • Ultrasonic Position Sensor

For example, a potentiometer contains the rotational position sensor that can vary with angular movement.

The position sensor is used in domestic and industrial applications like door closing/opening, valve monitoring, motor controlling, throttles for controlling the flow of fuel or power to an engine.

 

14. Gas or Smoke Sensor

Gas sensor is used to detect different types of gasses, toxic or explosive gasses, smoke in the air. Some of these sensors are also capable to measure gas concentration. 

Gas or smoke sensor is divided into three parts.

  • Optical Type Smoke Sensor
  • Ionization Type Smoke Sensor
  • Laser Type Smoke Sensor

Smoke sensor is used in plant, industries, buildings, ships, airplanes, etc.

 

15. Flame Sensor

The flame sensor easily detects fire or flame of nearby materials. These detected signals are passed to the connected control devices.

It is used in industrial areas for an alarm system, natural gas plant, fire suppression system and Arduino based design fire detector project.

 

16. Leak Sensor

Leak sensor is used in a closed vessel or vaccum for detecting water leakage, fluid leakage, air leakage, etc.

As per the working role, it is divided into two main parts.

  • Spot Leak Sensor
  • Flow Leak Sensor

17. Accelerometer (가속도계)

Accelerometer is an instrument that measure motion acceleration or velocity.

It is used in many applications such as hand gesture controlled robot, navigation system for aircraft and missiles, process and control system, vehicle acceleration, and other rotating electronic equipment like a turbine, roller, fan, compressor, pump.

 

18. Tilt Sensor

Tilt sensor detects and varies with an angular movement, angular slope, angular motion, axes of the reference plane.

It is mostly used for monitoring the angle and auto-rotating operation in mobile, tablet, hand-held games, boats, vehicles, and aircraft, etc.

 

19. Mark Sensor

Mark sensor works as photoelectric type of sensor. It is used to sense colour mark on presence of an objects.

Mark sensor is widely used in printing and packaging industries.

 

20. Flow Sensor or Float Sensor

Flow sensor measures and detects virtually any process fluid. This detected data will be provided to the controller system.

It is used in industrial area, power generating instruments, power plant, etc.

 

산업 모니터링에 관한 다른 Contents도 확인 하세요. 

 

'ForBeginner' 카테고리의 다른 글

2-4. 센서와 변환기  (0) 2021.05.19
2-3. Analog & Digital Sensors  (0) 2021.05.19
8-7. MSSQL(View)  (0) 2021.05.18
8-5. 트리거(Trigger)  (0) 2021.05.18
8-2-1. MSSQL (Join)  (0) 2021.05.17
  • View는 기존 Table에 모든 Data가 있는데, 의미있는 Data로 다시 Rearrage할때 사용된다. 
  • 자주 조회하는 Data를 Select Group 과 Select join을 이용하여 View로 만들어 놓으면 편리하게 사용할 수 있다. 

 뷰(View)란 무엇인가? 

  1. 뷰는 사용자에게 접근이 허용된 자료만을 제한적으로 보여주기 위해 하나 이상의 기본 테이블로부터 유도된, 이름을 가지는 가상 테이블이다.
  2. 뷰는 저장장치 내에 물리적으로 존재하지 않지만 사용자에게 있는 것처럼 간주된다.
  3. 뷰는 데이터 보정작업, 처리과정 시험 등 임시적인 작업을 위한 용도로 활용된다.
  4. 뷰는 조인문의 사용 최소화로 사용상의 편의성을 최대화 한다.

뷰(View)의 특징

  1. 뷰는 기본테이블로부터 유도된 테이블이기 때문에 기본 테이블과 같은 형태의 구조를 사용하며, 조작도 기본 테이블과 거의 같다.
  2. 뷰는 가상 테이블이기 때문에 물리적으로 구현되어 있지 않다.
  3. 데이터의 논리적 독립성을 제공할 수 있다.
  4. 필요한 데이터만 뷰로 정의해서 처리할 수 있기 때문에 관리가 용이하고 명령문이 간단해진다.
  5. 뷰를 통해서만 데이터에 접근하게 하면 뷰에 나타나지 않는 데이터를 안전하게 보호하는 효율적인 기법으로 사용할 수 있다.
  6. 기본 테이블의 기본키를 포함한 속성(열) 집합으로 뷰를 구성해야지만 삽입, 삭제, 갱신, 연산이 가능하다.
  7. 일단 정의된 뷰는 다른 뷰의 정의에 기초가 될 수 있다.
  8. 뷰가 정의된 기본 테이블이나 뷰를 삭제하면 그 테이블이나 뷰를 기초로 정의된 다른 뷰도 자동으로 삭제된다.

뷰(View)사용시 장 단점

장점

  1. 논리적 데이터 독립성을 제공한다.
  2. 동일 데이터에 대해 동시에 여러사용자의 상이한 응용이나 요구를 지원해 준다.
  3. 사용자의 데이터관리를 간단하게 해준다.
  4. 접근 제어를 통한 자동 보안이 제공된다.

단점

  1. 독립적인 인덱스를 가질 수 없다.
  2. ALTER VIEW문을 사용할 수 없다. 즉 뷰의 정의를 변경할 수 없다.
  3. 뷰로 구성된 내용에 대한 삽입, 삭제, 갱신, 연산에 제약이 따른다.

 

 간단한 예제 

뷰 정의문

--문법-- CREATE VIEW 뷰이름[(속성이름[,속성이름])]AS SELECT문; --고객 테이블에서 주소가 서울시인 고객들의 성명과 전화번호를 서울고객이라는 뷰로 만들어라-- CREATE VIEW 서울고객(성명, 전화번호) AS SELECT 성명 전화번호 FROM 고객 WHERE 주소 = '서울시';

 

뷰 삭제문

 뷰는 ALTER문을 사용하여 변경할 수 없으므로 필요한 경우는 삭제한 후 재생성한다.

--문법-- DROP VIEW 뷰이름 RESTRICT or CASCADE --서울고객이라는 뷰를 삭제해라-- DROP VIEW 서울고객 RESTRICT;

RESTRICT : 뷰를 다른곳에서 참조하고 있으면 삭제가 취소된다.

CASCADE : 뷰를 참조하는 다른 뷰나 제약 조건까지 모두 삭제된다.

 

산업 모니터링에 관한 다른 Contents도 확인 하세요. 

'ForBeginner' 카테고리의 다른 글

2-3. Analog & Digital Sensors  (0) 2021.05.19
2-2. Types of Sensors  (0) 2021.05.18
8-5. 트리거(Trigger)  (0) 2021.05.18
8-2-1. MSSQL (Join)  (0) 2021.05.17
8-2. MSSQL(Group by, Having)  (0) 2021.05.17

+ Recent posts