Đồ án tốt nghiệp Điện tự động công nghiệp: Nghiên cứu một số cảm biến đo thông số môi trường và giám sát qua mạng internet

71 0 0
Đồ án tốt nghiệp Điện tự động công nghiệp: Nghiên cứu một số cảm biến đo thông số môi trường và giám sát qua mạng internet

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Đồ án tốt nghiệp Nghiên cứu một số cảm biến đo thông số môi trường và giám sát qua mạng internet được thực hiện với mục tiêu nhằm tìm hiểu và tiếp nhận tín hiệu từ các cảm biến; có chức năng giám sát qua internet, sử dụng điện thoại hoặc máy tính; có chức năng hiển thị lên màn hình; có thể thi công đồ án trên một ngôi nhà thực tế... Đề tài Hoàn thiện công tác quản trị nhân sự tại Công ty TNHH Mộc Khải Tuyên được nghiên cứu nhằm giúp công ty TNHH Mộc Khải Tuyên làm rõ được thực trạng công tác quản trị nhân sự trong công ty như thế nào từ đó đề ra các giải pháp giúp công ty hoàn thiện công tác quản trị nhân sự tốt hơn trong thời gian tới.

/** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC QUẢN LÝ VÀ CƠNG NGHỆ HẢI PHỊNG - ĐỒ ÁN TỐT NGHIỆP NGÀNH : ĐIỆN TỰ ĐỘNG CÔNG NGHIỆP Sinh viên : Phạm Ngọc Hiếu Giảng viên hướng dẫn: TS Đồn Hữu Chức HẢI PHỊNG – 2021 /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC QUẢN LÝ VÀ CƠNG NGHỆ HẢI PHỊNG - NGHIÊN CỨU MỘT SỐ CẢM BIẾN ĐO THÔNG SỐ MÔI TRƯỜNG VÀ GIÁM SÁT QUA MẠNG INTERNET ĐỒ ÁN TỐT NGHIỆP ĐẠI HỌC HỆ CHÍNH QUY NGÀNH : ĐIỆN TỰ ĐỘNG CÔNG NGHIỆP Sinh viên : Phạm Ngọc Hiếu Giảng viên hướng dẫn : TS Đoàn Hữu Chức HẢI PHÒNG – 2021 /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // BỘ GIÁO DỤC VÀ ĐÀO TẠO /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } TRƯỜNG ĐẠI HỌC QUẢN LÝ VÀ CƠNG NGHỆ HẢI PHỊNG // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } NHIỆM VỤ ĐỀ TÀI TỐT NGHIỆP Sinh viên:Phạm Ngọc Hiếu Lớp Mã SV: 1512102007 : DC 1901 Ngành: Điện tự động công nghiệp Tên đề tài: Nghiên cứu số cảm biến đo thông số môi trường giám sát qua mạng internet /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // NHIỆM VỤ ĐỀ TÀI /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Nội dung yêu cầu cần giải nhiệm vụ đề tài tốt nghiệp ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… Các tài liệu, số liệu cần thiết ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… ………………………………………………………………………………… Địa điểm thực tập tốt nghiệp Công ty cổ phần bao bì Thuận Phát Địa 25 QL5, Nam Sơn, An Dương, Hải Phòng /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // CÁN BỘ HƯỚNG DẪN ĐỀ TÀI TỐT NGHIỆP /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Họ tên : Đoàn Hữu Chức Học hàm, học vị: Tiến Sỹ Cơ quan công tác: Trường Đại học Quản lý Cơng nghệ Hải Phịng Nội dung hướng dẫn: Nghiên cứu số cảm biết đo thông số môi trường giám sát qua mạng internet Đề tài tốt nghiệp giao ngày 12 tháng 04 năm 2021 Yêu cầu phải hoàn thành xong trước ngày 03 tháng 07 năm 2021 Đã nhận nhiệm vụ ĐTTN Đã giao nhiệm vụ ĐTTN Sinh viên Giảng viên hướng dẫn Phạm Ngọc Hiếu TS Đồn Hữu Chức Hải Phịng, ngày 04 tháng 07 năm 2021 TRƯỞNG KHOA CỘNG HÒA Xà HỘI CHỦ NGHĨA VIỆT NAM Độc lập - Tự - Hạnh phúc /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } PHIẾU NHẬN XÉT CỦA GIẢNG VIÊN HƯỚNG DẪN TỐT NGHIỆP Họ tên giảng viên: TS Đoàn Hữu Chức Đơn vị công tác: Trường Đại học quản lý công nghệ Hải Phòng Họ tên sinh viên: Phạm Ngọc Hiếu Chuyên ngành: Điện Tự Động Công Nghiệp Đề tài tốt nghiệp: Nghiên cứu số cảm biến đo thông số môi trường giám sát qua mạng internet Tinh thần thái độ sinh viên trình làm đề tài tốt nghiệp Đánh giá chất lượng đồ án Ý kiến giảng viên hướng dẫn tốt nghiệp Được bảo vệ Không bảo vệ Điểm hướng dẫn Hải Phòng, ngày 03 tháng 07 năm 2021 Giảng viên hướng dẫn TS Đoàn Hữu Chức /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // Cộng hòa xã hội chủ nghĩa Việt Nam /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } Độc lập - Tự - Hạnh phúc // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } - PHIẾU NHẬN XÉT CỦA GIẢNG VIÊM CHẤM PHẢN BIỆN Họ tên giảng viên: Đơn vị công tác: Họ tên sinh viên: Chuyên ngành: Đề tài tốt nghiệp: Phần nhận xét giảng viên chấm phản biện Những mặt hạn chế Ý kiến giảng viên chấm phản biện Được bảo vệ Không bảo vệ Điểm hướng dẫn Hải Phòng, ngày tháng năm 2021 Giảng viên chấm phản biện ( ký ghi rõ họ tên) /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // LỜI CẢM ƠN /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Lời em xin gửi lời cảm ơn chân thành sâu sắc tới Tiến Sĩ Đoàn Hữu Chức - thầy người bảo, hướng dẫn, giúp đỡ em việc định hướng, triển khai hoàn thành khóa luận tốt nghiệp Đồng thời em gửi lời cảm ơn chân thành tới Ban giám hiệu nhà trường, Khoa Điện – Điện tử Trường Đại Học Quản Lý Cơng Nghệ Hải Phịng tạo điều kiện cho em hội học tập tốt năm học vừa qua Em xin chúc thầy cô mạnh khỏe, công tác tốt, mãi người ‘‘lái đò’’ cao quý ‘‘chuyến đò’’ tương lai Hải Phòng, tháng năm 2021 Sinh viên Phạm Ngọc HIếu /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // MỤC LỤC /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Lời mở đầu Chương Nghiên cứu số cảm biến đo thông số môi trường 1.1 Cảm biến đo nhiệt độ 1.1.1 Khái niệm 1.1.2 Đo nhiệt độ điện trở 1.1.3 Đo nhiệt độ bán dẫn 1.1.4 Đo nhiệt độ cặp nhiệt 1.2 Cảm biến đo độ ẩm 1.2.1 Cảm biến độ ẩm đất điện dung 1.2.2 Cảm biến đo độ ẩm đất điện trở 1.2.3 Cảm biến DHT11 10 1.3 Cảm biến mưa 12 1.4 Cảm biến khí gas 14 Chương Tìm hiểu Arduino 16 2.1 Tổng quan arduino 16 2.2 Arduino uno r3 17 2.3 Arduino Mega 2560 21 2.4 Phần mềm arduino IDE 23 2.5 Arduino ESP8266 24 Chương Thiết kế hệ thống 27 3.1 Hệ thống nhiệt độ, độ ẩm khơng khí 27 3.1.1 Giới thiệu linh kiện cần dùng 27 3.1.2 Thiết kế hệ thống 28 3.2 Hệ thống đo độ ẩm đất 29 3.2.1 Giới thiệu linh kiện cần dùng 29 3.2.2 Thiết kế hệ thống 29 3.3 Hệ thống báo mưa xuất liệu hình 31 3.3.1Giới thiệu linh kiện cần dùng 31 3.3.2Thiết kế hệ thống 31 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // 3.4 Đưa liệu lên internet 33 /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables 3.4.1 Giới thiệu blynk 33 } 3.4.2 Công nghệ truyền nhận liệu 40 3.4.3 Giới thiệu chuẩn giao tiếp uart 43 3.4.4 Thiết kế hệ thống 45 3.5 Kết luận chương 50 Kết luận hướng phát triển 51 TÀI LIỆU THAM KHẢO 60 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // + Arduino UNO R3 Là xử lý để điều khiển tồn q trình hoạt động /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables mạch xuất liệu qua LCD } + Cảm biến độ ẩm đất, DHT11,cảm biến mưa có nhiệm vụ thu nhận liệu để arduino xử lý + LCD: Hiển thị nhiệt độ độ ẩm khơng khí , độ ẩm đất, báo mưa + Chíp ESP8266: đưa liệu lên internet -Lưu đồ giải thuật Bắt đầu Kết nối wifi Bật cảm biến Bật hình Arduino đọc giá trị cảm biến Gửi liệu qua esp8266 S Kiểm tra Đ In hình Đưa lên internet Kết thúc - Thực lắp ráp cách mạch ghép nối modul B1 hàn modul arduino, esp8266 vào mạch in sẵn 46 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // B2 kết nối arduino với esp8266 /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables B3 hàn DHT11, cảm biến mưa, cảm biến ẩm đất vào mạch in sẵn kết nối } với arduino B4 cấp nguồn cho mạch 5v1a B5 đo đạc kiểm tra chân xem modul kết nối với chưa B6 nạp chương trình test lại xem có đạt u cầu ban đầu khơng Hình 3.13 Hình ảnh mơ hình board - Đưa liệu lên blynk Trước tiên tạo giao diện thông qua app Blynk smartphone có chức sau Đọc hiển thị toàn liệu từ cảm biến Ta tạo tab để hiển thị thông tin trên: 47 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Hình 3.14 Hình ảnh thiết lập giao diện độ ẩm Cảm biến: Độ ẩm, input V5 value – 100 Hình 3.15 Hình ảnh thiết lập giao diện nhiệt độ Nhiệt độ, input V6 value – 100 48 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Hình 3.16 Hình ảnh thiết lập giao diện độ ẩm đất, báo mưa Độ ẩm đất, input V4 value – 100 Báo mưa, input V3 value – - Đo đạc khảo sát +Chức hiển thị nhiêt độ độ ẩm lên hình LCD hình smartphone Hình 21 Hiển thị nhiệt độ, độ ẩm lên hình 49 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // Quan sát vào hình 3.22 thấy nhiệt độ, độ ẩm hiển thị lên LCD nhiệt /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables độ hiển thị lên giao diện Blynk Sau khảo sát nhận thấy } nhiệt độ độ ẩm đo sai số 0°C hệ thống hoạt động ổn định.Ngồi hệ thống cịn có chức khác : + Hệ thống tưới dựa vào độ ẩm đất + Điều chỉnh tốc độ quạt dựa vào nhệt độ phòng vv Nhưng khả hiểu biết thời gian làm đề tài có hạn nên chức chưa thể thực thành cơng 3.5 Kết luận chương Trong chương trình bày cách rõ ràng cách để tiến hành xây dựng mơ hình giám sát bao gồm bước ,sơ đồ thuật tốn,sơ đồ mơ đến thực chế tạo Giới thiệu cách tổng quan ứng dụng Blynk dùng để điều khiển thiết bị Quá trình chế tạo khảo sát cho thấy điều khiển hoạt động xác ổn định 50 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // KẾT LUẬN VÀ HƯỚNG PHÁT TRIỂN /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } Kết luận // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Sau thời gian nghiên cứu, thi cơng đồ án tốt nghiệp em với đề tài “Nghiên cứu số cảm biến đo thông số mơi trường giám sát qua mạng internet”đã hồn thiện, đáp ứng yêu cầu ban đầu đặt - Ưu điểm Mạch điều khiển nhỏ gọn, hoạt động ổn định, thời gian đáp ứng nhanh Giao diện giám sát dễ sử dụng, thân thiện người dùng Mơ hình hệ thống có độ xác, tính an toàn dễ dàng thao tác với người dùng Phù hợp cho hệ thống điện phòng học, hộ gia đình Nhìn chung, mơ hình hoạt động tương đối ổn định, làm việc liên tục, đạt 100% yêu cầu đề ban đầu - Khuyết điểm Tuy nhiên, hạn chế kiến thức thời gian thực hiện, nguồn tài liệu tham khảo chủ yếu thông qua internet nên đề tài không tránh khỏi sai sót cịn số hạn chế: Hệ thống phụ thuộc tốc độ truy cập mạng Internet Hoạt động chủ yếu mơi trường có phủ sóng wifi.mơ hình cịn mang tính tượng trưng Kích thước sản phẩm cịn thơ, thiếu tính thẩm mỹ Số lượng thiết bị cịn hạn chế Giới hạn thời gian, kiến thức nên hệ thống chưa tối ưu Nhìn chung hệ thống điều khiển hoạt động tốt Hướng phát triển Hệ thống đáp ứng việc giám sát thiết bị Trong trình thực hiện, em thấy đề tài phổ biến, có tính ứng dụng cao nhiều dự án thực tế Vì em đưa số đề xuất nhằm cải tiến nâng cấp hệ thống: Giám sát nơi điều khiển camera, cảnh báo chống trộm, báo cháy Điều chỉnh độ sáng đèn, tốc độ quạt, nhiệt độ điều hòa, 51 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // Thiết lập hệ thống điều khiển thiết bị tự động nhằm tối ưu hóa việc sử dụng /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } tiết kiệm điện Ứng dụng đề tài vào hệ thống thực tế // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } Phụ lục -Chương trình đo nhiệt độ, độ âm khơng khí #include #include #include LiquidCrystal_I2C lcd(0x27,16,2); const int DHTPIN = 7; const int DHTTYPE = DHT11; DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); lcd.init(); lcd.backlight(); lcd.begin(16, 2); // Khởi tạo LCD 16x2 lcd.print("nhiet "); lcd.setCursor(0,1); lcd.print("Do am: "); dht.begin(); } void loop() { float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(t) || isnan(h)) { } else { Serial.print("Nhiet do: "); Serial.println(t); //Xuất nhiệt độ Serial.print("Do am: "); Serial.println(h); //Xuất độ ẩm lcd.setCursor(10,0); lcd.print(round(t)); lcd.print(" C"); lcd.setCursor(10,1); lcd.print(round(h)); 52 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // lcd.print(" %"); }} Phụ lục /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } //Chương trình đo độ ẩm đất #include #include #include LiquidCrystal_I2C lcd(0x27,16,2); int doam = A0; void setup() { Serial.begin(9600); lcd.init(); lcd.backlight(); lcd.begin(16, 2); lcd.print("do am dat"); } void loop() { int doamdat = analogRead(doam); float h = map(doamdat, 1023, 0, 0, 100); Serial.print(h); Serial.println('%'); delay(1000); lcd.setCursor(11,0); lcd.print(round(h)); lcd.print("%"); if ((h < 50)){ lcd.setCursor(2,1); lcd.print("thieu am"); } else { lcd.setCursor(2,1); lcd.print(" du am"); } 53 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // Phụ lục //chương trình báo mưa /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } #include #include #include LiquidCrystal_I2C lcd(0x27,16,2); int rainSensor = 6; void setup() { pinMode(rainSensor, INPUT); Serial.begin(9600); Serial.println("da khoi dong xong"); lcd.init(); lcd.backlight(); lcd.begin(16, 2); lcd.print("cam bien mua "); } void loop() { // put your main code here, to run repeatedly: int value = digitalRead(rainSensor);//Đọc tín hiệu cảm biến mưa if (value == HIGH) { // Cảm biến không mưa Serial.println("dang khong mua"); lcd.setCursor(0,1); lcd.print(" no rain "); } else { Serial.println("dang mua"); lcd.setCursor(0,1); lcd.print("raining "); } } 54 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // Phụ lục /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); //Chương trình tồn hệ thống đo nhiệt độ, độ ẩm, độ ẩm đất, báo mưa đưa liệu lên internet } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } +Chương trình aruino #include #include #include LiquidCrystal_I2C lcd(0x27,16,2); int ledPin = 13; const int DHTPIN = 7; const int DHTTYPE = DHT11; int rainSensor = 6; int doam = A0; DHT dht(DHTPIN, DHTTYPE); String a = ""; void setup() { Serial.begin(9600); pinMode(rainSensor, INPUT); dht.begin(); lcd.init(); lcd.begin(16, 2); // Khởi tạo LCD 16x2 lcd.backlight(); lcd.print("T"); lcd.setCursor(0,1); lcd.print("H"); lcd.setCursor(8,0); lcd.print("AD "); lcd.setCursor(8,1); 55 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // lcd.print("BM "); /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables dht.begin(); } pinMode(ledPin, OUTPUT); } void loop() { // put your main code here, to run repeatedly: int doamdat = analogRead(doam); int amdat = map(doamdat, 1023, 300, 0, 100); int mua = digitalRead(rainSensor);//Đọc tín hiệu cảm biến mưa float h = dht.readHumidity(); float t = dht.readTemperature(); a = a+"*"+t+"#"+h+"^"+amdat+"@"+mua; Serial.println(a); a = ""; delay(5000); if (isnan(h) || isnan(t)) {} else { lcd.setCursor(2,0); lcd.print(round(t)); lcd.print("*C"); lcd.setCursor(2,1); lcd.print(round(h)); lcd.print("%"); } if ((mua == HIGH)){ lcd.setCursor(11,1); lcd.print("tanh"); digitalWrite(ledPin, LOW); 56 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // } /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables else { } lcd.setCursor(11,1); lcd.print("mua "); digitalWrite(ledPin, HIGH); } lcd.setCursor(12,0); lcd.print(amdat); lcd.print(" %"); } //Chương trình esp8266 để đưa liệu lên internet #define BLYNK_PRINT Serial #include #include #define SimpleTimer BlynkTimer SimpleTimer timer; char auth[] = "I-qJKcYn-20nXSaH130SJAz17KUI5kaH"; char ssid[] = "u hàng xóm"; char pass[] = "dungcohack"; String f1 = ""; String k1 = "", k2 = "", k3 = "", k4 = ""; int e1 = 0, e2 = 0, e3 = 0, e4 = 0; void setup() { // put your setup code here, to run once: Serial.begin(9600); Blynk.begin(auth, ssid, pass); } void loop() { 57 /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Show.class.getName()).log(java.util.logging.Level SEVERE, null, ex); } // if(Serial.available()){ /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Show().setVisible(true); } }); } // Variables declaration - not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables f1 = Serial.readString(); } delay(4000); for (int i = ; i

Ngày đăng: 14/07/2023, 02:49

Tài liệu cùng người dùng

Tài liệu liên quan