Manufaktur industri
Industri Internet of Things | bahan industri | Pemeliharaan dan Perbaikan Peralatan | Pemrograman industri |
home  MfgRobots >> Manufaktur industri >  >> Manufacturing Technology >> Proses manufaktur

Pemantau Tingkat Sumpa DIY dengan Arduino Nano, MPXV5010DP & Layar OLED

Tentang Proyek

Pemantau tingkat sumpa dibangun untuk bekerja dengan papan input Ecobee RSM-01 yang saya miliki di rumah putri saya atau proyek Home Monitor saya. Saya menambahkan relay untuk memungkinkannya berdiri sendiri. Saya ingin sesuatu yang saya rasa akan lebih andal dan lebih mudah dipasang daripada sensor ultrasonik. Untuk tujuan ini, saya mulai mencari sensor tekanan dan akhirnya menemukan Freescale MPXV5010DP. Ini memiliki output 0-5vdc untuk 0-10kPa, yang akan sekitar 1020mm kepala air.

Pemantau Tingkat Sumpa DIY dengan Arduino Nano, MPXV5010DP & Layar OLED
Pemantau Tingkat Sumpa DIY dengan Arduino Nano, MPXV5010DP & Layar OLED

Karena saya ingin indikasi lokal, saya memilih modul OLED untuk digunakan dalam desain. Murah, cerah dan ini memiliki layar dua warna. Untuk menyediakan antarmuka, saya menambahkan relay untuk output kontak kering. Saya menambahkan DAC (konverter digital ke analog) untuk output 0-5vdc dengan daya lebih dari sensor MPXV5010DP, ini juga akan melindungi sensor dari kerusakan kabel yang mungkin. Karena saya menggunakan komunikasi I2C, yang diperlukan hanya perubahan perangkat lunak untuk menyediakan data ke Arduino lain.

Pemantau Tingkat Sumpa DIY dengan Arduino Nano, MPXV5010DP & Layar OLED

Saya merancang dan membuat papan kustom untuk kemudahan koneksi. Ini memberikan cukup fleksibilitas untuk konfigurasi yang berbeda.

Sensor terhubung dengan kabel Tygon ke pipa tembaga yang diarahkan ke sumpa. Ini memungkinkan kebebasan dalam menempatkan pemantau dan menjaganya dari air itu sendiri..

Kode

Sump Level MonitorC/C++
Parse as you need, extra garbage in this version go ahead and clean up as you desire.
#include <SPI.h> #include <Wire.h> #include <Adafruit_SSD1306.h> #include <Adafruit_GFX.h> #include <Adafruit_MCP4725.h> #include <math.h> #define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET); #if (SSD1306_LCDHEIGHT != 64) #error("Height incorrect, please fix Adafruit_SSD1306.h!"); #endif Adafruit_MCP4725 dac; int relayPin = 5; // for relay alarm output int analogPin = 0; //measures dac output voltage int v1 = 0; // ADC output from MPXV5010 int v2 = 0; //scaling for dac input converts from PS input to dac input int v3 = 0; //for mm conversion from PS input int v4 = 0; //for percentage of depth from PS input int v5 = 0; // output of dac as read by arduino int v6 = 0; //for mV conversion from PS input float v7 =0; //convert from mm to inches int v8 =0; // to eliminate inches decimals which trash the display int offSet = 40; //the 0 kPa output as measured by arduino int maxSet = 1015; //the 10 kPa output as measured by arduino int maxHeight = 1020; // the depth for the sump from normal water level to lid in mm int ranging = (maxHeight * 0.8) + offSet; int alarmHeight = 12; // the alarm height in inches // For the MPXV5010DP differential pressure sensor int analogPin2 = 1; float divisor = 25.4; //for converting display to inches void setup() { Serial.begin(9600); Serial.println("DAC test with DP sensor"); // by default, we'll generate the high voltage from the 3.3v line internally! (neat!) display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) // init done // Clear the buffer. display.clearDisplay(); // For MCP4725A0 the address is 0x60 or 0x61 dac.begin(0x60); pinMode(relayPin, OUTPUT); digitalWrite(relayPin, HIGH); } void loop() { v1 = analogRead(analogPin2); delay (1000); if (v1 < offSet){v1 = offSet;} //v2=((v1-40)*1.4); v2 = map(v1, offSet, maxSet, 0, 4095); //for dac input converts from PS input to dac input dac.setVoltage(v2,false); //v3 = map(v1, offSet, maxSet, 0, 1020); //for mm conversion from PS input v3 = (v1 - offSet) / 0.8; v7 = v3/divisor; //convert from mm to inches v8 = round (v7); // to eliminate inches decimals which trash the display v4 = map(v1, offSet, ranging, 0, 100); //for percentage of depth from PS input v5 = analogRead(analogPin); // output of dac as read by arduino 0-1023 range v6 = map(v5, 0, 1023, 0, 5000); //for mV conversion from PS input printoled(); serial(); } void printoled() { // Clear the buffer. display.clearDisplay(); // invert the display for alarm and pickup relay with LOW signal if(v8 > alarmHeight) { display.invertDisplay(true); digitalWrite(relayPin,LOW);} else { display.invertDisplay(false); digitalWrite(relayPin,HIGH);} display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(0,0); display.println("SUMP LEVEL"); //display.setTextColor(BLACK, WHITE); // 'inverted' text display.setTextSize(4); display.setTextColor(WHITE); display.print(v8); display.setTextSize(2); display.println("inches"); display.display(); delay(500); } void serial(){ //for debugging and calibration Serial.print(" PS analog input: "); Serial.print(v1); Serial.print( " Height: "); Serial.print(v3); Serial.print(" mm "); Serial.print(v4); Serial.print(" %"); Serial.print(" Converted voltage: "); Serial.print(v6); Serial.println(" mV"); } //end 

Skematik

Used Eagle 6.5.0sump%20level.sch

Proses manufaktur

  1. Memahami Cakupan Variabel C#: Tingkat Kelas, Metode, dan Blok
  2. Membangun Stasiun Udara & Cuaca Raspberry Pi dengan InfluxDB & Grafana
  3. Menginstal Google Assistant pada MATRIX Voice Raspberry Pi – Panduan Langkah demi Langkah
  4. Pantau Cuaca – Stasiun Cuaca DIY Raspberry Pi dengan Unggahan Dropbox
  5. Sistem Pemantauan Detak Jantung Jarak Jauh dengan Peringatan AWS IoT
  6. Membangun Rover Windows IoT Core dengan Raspberry Pi 2 – Panduan Pemula hingga Lanjutan
  7. Memperluas GoPiGo v2 pada Windows 10 IoT Core untuk Raspberry Pi 3
  8. Pemodelan Tingkat Gerbang: Menghubungkan Skema Hardware ke Kode Verilog
  9. JW Machine: Layanan Manufaktur Kontrak CNC Presisi
  10. Penataan Tepat Mesin Bubut: Panduan Profesional