45
Tassanai Wongjaroenchai Pharm.D. Department of Pharmacy, Pathum Thani Hospital. Development of a Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Tassanai Wongjaroenchai Pharm.D.Department of Pharmacy, Pathum Thani Hospital.

Development of a Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Page 2: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

รวบรวมข้อมูลที่เกี่ยวกับโครงงาน

ได้แก่ การติดตั้ง การตั้งค่า การ

ปรับแต่งแก้ไข ราคาอุปกรณ์ และ

ตัวอย่างโครงการ

USER MANUAL

2

Page 3: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

GETTING STARTED

Page 4: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

เป้าหมายพัฒนาระบบบันทึกข้อมูลและแจ้งเตือน อุณหภูมิ

ตู้เย็นเก็บรักษายาที่มีต้นทุนที่เหมาะสม อุปกรณ์

หาซื้อได้ในท้องตลาด ขยายระบบได้ง่าย และ

พัฒนาเป็นซอฟท์แวร์ที่สามารถแจกจ่ายได้

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Conceptual Framework

Page 5: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

A Raspberry Pi is a credit card-sized computer originally designed for education. The Raspberry Pi is slower than a modern laptop or desktop but is still a complete Linux computer and can provide all the expected

abilities that implies, at a low-power consumption level. The Raspberry Pi was designed for the Linux operating system, and many Linux distributions now have a version optimized for the Raspberry Pi.

ส่วนเชื่อมตอ่อุปกรณ์ภายนอก

GPIO PORT

USB PORT

MICRO SD CARD SLOT

ใช้ระบบปฏิบัติการ RASBIAN

จ านวน 4 ช่อง

ราคา 1,850 บาท

ETHERNET

WIFI READY

รุ่น RPi 3 B+

Page 6: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

VERSION 1

ใช้ Raspberry Pi

แบบ standalone

ใช้กับตู้เย็น 3 ตู้

2015JANUARY

2018FEBRUARY

Project Development TimelineTemperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

VERSION 2

ใช้ Raspberry Pi

แบบ client - server

ใช้กับตู้เย็น 12 ตู้ และห้องคลังพัสดุ

๑ ๒

Page 7: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

VERSION I

Page 8: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

TEMPERATURE SENSOR

UNINTERUPTABLE

POWER SUPPLY

GPIO

CELLULAR

BUILD IN RPI

CELLULAR PATHWAY

TELEGRAM

BROWSER

INTERNET

INTERNET PATHWAY

Raspberry Pi is a trademark of the Raspberry Pi Foundation, UK.

Gmail™ webmail service, Chrome™ browser and Google Docs™ program is a trademark of Google Inc.

Project Development | Phase I

Page 9: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Parts and hardware **

• RASPBERRY PI 2 MODEL B ขึ้นไป

• POWER ADAPTOR 5V 2A

• MICRO SD CARD 16 GB CLASS 10

• JUMPER WIRE

• DS18B20 TEMPERATURE SENSOR OR

• DHT22 HUMIDITY AND TEMPERATURE SENSOR

• RESISTER 4.7 K Ohm 1/4 W (For DS18B20)

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | hardware assembly

** REFER PRICE LIST FROM APPENDIX-I IN OPERATION MANUAL

Page 10: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Software

• บันทึกข้อมูลใน MySQL Database บน RPi

• ส่งข้อมูลค่าอุณหภูมิด้วย python script บน RPi

• ส่ง SMS และ dial voice ด้วย Gammu

• ส่งอีเมล์ด้วย SMTP

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Conceptual Framework

Page 11: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

สาย VCC เข้ากับพอร์ต 3.3V

สาย DATA เข้ากับพอร์ต GPIO4

สาย GND เข้ากับ GND

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | hardware assembly

Page 12: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | hardware assembly

RPiVersion 1

Page 13: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Refrigerator # 1Refrigerator # 2

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | phase I raspberry pi network diagram

temperature data and notification services

Page 14: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase I Limitation

Limitation of the 2015 projectระบบบันทึกและแจ้งเตือนอุณหภูมิตู้เย็น ปี 2558

ปัญหาการขยายระบบเมื่อเพ่ิม Raspberry Pi ในระบบ จะมีจ ำนวนฐำนข้อมูลเพ่ิมตำมจ ำนวนของ Raspberry Pi ต้องมี 3G aircard และซิมกำรด์โทรศพัทม์ือถือติดตัง้ให้ Raspberry Pi ทุกตวั

ปัญหาการควบคุมระบบกำรก ำหนดผู้รบักำรแจ้งเตือน ต้องเข้ำไปแก้ท่ี Raspberry Pi แต่ละตวั ตลอดจนไม่มีระบบท่ีช่วยติดตำมสถำนะออนไลน์ของ Raspberry Pi ท ำให้ขำดควำมคล่องตวัในกำรเฝ้ำระวงั

๒ค่าใช้จ่ายสูงขึ้นเมื่อ Raspberry Pi แต่ละตวัมีซิมกำรด์ส ำหรบัโทรออก ท ำให้ต้องเติมเงินเพื่อให้ได้วันใช้งำนในกำรโทรออก ท ำให้มีค่ำใช้จ่ำยสูงขึน้และไม่ทรำบวนัท่ีต้องเติมให้ซิมกำรด์

Page 15: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

VERSION II

Page 16: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

การปรับปรุง ประสิทธิภาพการท างานของระบบ รุ่นที่ 2

• ควบคุม Raspberry Pi ด้วยระบบ remote desktop connection ด้วยโปรแกรม TeamViewer Host

• การแจ้งเตือน สามารถก าหนดให้แจ้งเตือนไปยังผู้เกี่ยวข้องได้ แยกเป็นตู้เย็นแต่ละเครื่องได้

• ก าหนด ให้ Raspberry Pi ทุกตัวในเครือข่าย ส่งข้อมูลมาที่ฐานข้อมูลเดียวกัน

• ระบบ ติดตามความผิดปกติและแจ้งเตือน ย้ายมาไว้ที่เครื่องแม่ข่าย เพ่ือประหยัดค่าใช้จ่ายในระบบแจ้งเตือน และเพิ่มเสถียรภาพของระบบ

Page 17: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

R1 R2 R3 R4 R5 R6

R7 R8 R9 R10 R11 R12

Project Development | phase II raspberry pi network diagram

Page 18: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Server Parts and hardware

• MySQL Server โดยรันบน virtual machine หรือ

database server หรือ NAS หรือ LattePanda

(Windows10 Developer board) ก็ได้

• คอมพิวเตอร์ระบบปฏิบัติการ Windows เพื่อใช้รัน

โปรแกรม ตรวจสอบความผิดปกติและรันระบบแจ้ง

เตือน (สามารถใช้ร่วมกับ MySQL Server ได้)

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | phase II network diagram

Page 19: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Project Development | phase II network diagram

Raspberry Pi # GROUP 1

Raspberry Pi # GROUP 2

Notification Services

Smartphone Widget

Report Viewer Application

Monitoring Application

Server Site

Page 20: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | database server device

LattePandaWindows 10

Board

Page 21: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | database server device

Network Attached Storage

When using virtualized desktop features

Page 22: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Software• บันทึกข้อมูลใน MySQL Database

• ส่งข้อมูลค่าอุณหภูมิด้วย python script บน RPi

• ส่ง sms และ dial voice ด้วย Gammu

• ส่งอีเมล์ด้วย SMTP

• ส่งข้อความไปยัง LINE ด้วยบริการ LINE Notify

• เชื่อมต่อระยะไกลด้วยโปรแกรม TeamViewer

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Conceptual Framework

Page 23: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

VERSION 2DEC.RELEASED

2017

Page 24: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Header One

Lorem Ipsum is simply

dummy text of the printing

and typesetting industry.

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

Page 25: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

assembly instructionsวางเซนเซอร์ไว้ใน

ไซริงค์บรรจุกลีเซอรีน

เพื่อป้องกัน

FALSE ALARM

จากการเปิดประตูตูเ้ย็น

5V 2.5A

POWER ADAPTOR

DS18B20 TEMPERATURE SENSOR

Page 26: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

LAN PORT

POWER ADAPTOR

TEMPERATURE SENSOR

TEMPERATURE SENSOR

Page 27: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

Page 28: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

Page 29: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

Page 30: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II

ควบคุมระยะไกลด้วย TeamViewer

Page 31: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

NOTIFICATION SYSTEM

Page 32: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II notification system

PiStation Monitoring โปรแกรมตรวจสอบข้อมูลอุณหภูมิ

ล่าสุดที่บันทึกในฐานข้อมูล และจะท า

การแจ้งเตือนเมื่อเกิดความผิดปกติ

ได้แก่ อุณหภูมิที่ตรวจวัดได้ผิดปกติ

และ Raspberry Pi ไม่ส่งข้อมูลนาน

ผิดปกติ (offline)

Page 33: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

สถานการณ์ SMS Dial Voice Email Line Notify

อุณหภูมิตู้เย็นผิดปกติ ✓ ✓ ✓ ✓

อุณหภูมิและความชื้นผิดปกติ ✓ ✓

Raspberry Pi ไม่ส่งข้อมูลเกิน 180 นาที ✓

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II notification system

Page 34: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

T E M P E R A T U R E A L E R T I N G S Y S T E M

R A S P B E R R Y P I C O N N E C T I O N L O S T

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II notification system

Page 35: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

ตัวอย่างการแจ้งเตือนผ่าน

อีเมล์

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II notification system

Page 36: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

ตัวอย่างการแจ้งเตือนผา่น

SMS

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II notification system

Page 37: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

RealtimeTemperature Monitors on Smartphone

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II info widget for smartphone

Page 38: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II info widget for smartphone

WIDGET แสดงข้อมูล

• ต าแหน่งที่ติดต้ังเซนเซอร์

• ค่าอุณหภูมิล่าสุดที่บันทึกได้

• ผลต่างอุณหภูมิเมื่อเปรียบเทียบกับ

ข้อมูลที่วัดได้ก่อนหน้า

• วั น แ ล ะ เ ว ล า ข อ ง ข้ อ มู ล ที่ ก า ลั ง

แสดงผลบน widget

• เฉพาะระบบปฏิบัติการ andriod

RealtimeTemperature Monitors onSmartphone

Page 39: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | Phase II limitation

Limitation of the 2018 projectระบบบันทึกและแจ้งเตือนอุณหภูมิตู้เย็น ปี 2561

สัญญาณอินเตอร์เน็ต๑

ปัญหา FALSE ALARM

Raspberry Pi ไม่สำมำรถส่งข้อมลูมำยงัฐำนข้อมูลได้ ถ้ำอินเตอรเ์น็ตขดัข้อง

กำรแจ้งเตือนท่ีบำงครัง้ ไม่ใช่ควำมผิดปกติของตู้เยน็ แต่เป็นกำรสญูเสียอณุหภมิูชัว่ครำว จำกกำรเปิดประตตูู้เยน็

Page 40: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

APPENDIX

Page 41: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

FTP Username: pi

FTP Password: raspberry

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | PiStation Cloud

Page 42: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | PiStation Cloud

Page 43: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

SOFTWARE DISTRIBUTION

ดาวน์โหลดไปใช้งานได้ฟรีอนุญาตให้ผู้ใช้สามารถดาวน์โหลดไปใช้งานได้ฟรี ทั้งน้ี ต้องไม่เป็นไปเพื่อการจ าหน่าย

ส าเนาไปเผยแพร่ แจกจ่ายได้ แก้ไข ดัดแปลงได้ อนุญาตให้ผู้ใช้สามารถส าเนาไปเผยแพร่ แจกจ่าย ดัดแปลงได้ ทั้งน้ี ต้องไม่เป็นไปเพื่อการจ าหน่าย

ผู้ใช้เป็นผู้รับผิดชอบต่อผลที่เกิดขึ้นจากการน าไปใช้

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | software distribution

Page 44: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Tassanai WongjaroenchaiDepartment of Pharmacy, Pathum Thani Hospital

acebook.com/[email protected]

CONTACT QR CODE

Temperature Monitoring and Alerting System for a Pharmaceutical Refrigerator using Raspberry Pi

Project Development | contact information

Page 45: Development of - Ministry of Public Healthdmsic.moph.go.th/.../admin/...RaspberryPi_Tassanai.pdf · The Raspberry Pi is slower than a modern laptop or desktop but is still a complete

Raspberry Pi and Raspberry Pi logo is the registered trademark of the Raspberry Pi Foundation. LATTEPANDA is a trademark of Zhiwei Robotics Corp. LINE is a registered trade name or trademark of LINE Corporation. Other company names and

product or service names mentioned are registered trade names or trademarks of various other companies.

THANKS FOR LISTENING