1 / 6
Legacy RS232 to WIFI adapter / Air Quality Cell Phone App — zdjęcie 1
1 / 6

Legacy RS232 to WIFI adapter / Air Quality Cell Phone App

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

I've been playing with computers since the 1970's. I've gone thru many generations of computers and sensors.

Ocena
0 / 5
Polubienia
5
Pobrania
14
Wydruki
0
Wyświetlenia
369
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
Computers
Licencja
Creative Commons — Attribution — Noncommercial

I've been playing with computers since the 1970's. I've gone thru many generations of computers and sensors. Technology is always changing and it obsoletes your old projects. I have several old sensors that have RS232 interfaces. They still work fine (although in many cases the computers died or the service I was pushing the data to went out of business).

This project show how simple it is to make an RS232 to WIFI adapter that pushes data to the Internet. It then shows you how to make a cell phone app to display the data.

The project parts:

As an Amazon Associate I earn from qualifying purchases.

Particle code:

/*   Program by Christopher Nafis   Written November 2020   Reads data from the Dylos DC1100 with PC Interface   Send the data to a Blynk application or to IFTTT   The DC1100 is a true Laser Particle Counter with 2 size ranges - small (>1 micron bacteria, mold, etc) large (>5 micron pollen, etc.) */ #include #define BLYNK_PRINT Serial  // Set serial output for debug prints #include "Particle.h" const size_t READ_BUF_SIZE = 64; char auth[] = "YourBlynkKey"; BlynkTimer timer; WidgetLCD lcd(V2); // Forward declarations void processBuffer(); // Global variables char readBuf[READ_BUF_SIZE]; size_t readBufOffset = 0; int small = 0; int large = 0; void setup() {    Serial.begin(9600);    Serial1.begin(9600);    delay(5000); // Allow board to settle    Particle.variable("small", small);    Particle.variable("large", large);    Blynk.begin(auth); } void loop() {    // Read data from serial    while(Serial1.available()) {        if (readBufOffset < READ_BUF_SIZE) {            char c = Serial1.read();            if (c != '\n') {                // Add character to buffer                readBuf[readBufOffset++] = c;            }            else {                // End of line character found, process line                readBuf[readBufOffset] = 0;                processBuffer();                readBufOffset = 0;            }        }        else {            Serial.println("readBuf overflow, emptying buffer");            readBufOffset = 0;        }    }    Blynk.run(); } // Since the Dylos only outputs values once a minute, it is OK to // put the Blynk updates in the loop without a separate timer void processBuffer() {    sscanf(readBuf,"%d,%d",&small,&large);  // units are average particles/100 per cubic foot    Serial.print(small);    Serial.print(' ');    Serial.println(large);    Blynk.virtualWrite(V0, small*100);    Blynk.virtualWrite(V1, large*100);    // The Dylos has a "rule of thumb" charts on the back of the sensor    lcd.clear();    lcd.print(1,0,"Air Quality is:");    if (small < 75)       lcd.print(1,1,"Excellent");       else if (small < 150)          lcd.print(1,1,"Very Good");          else if (small < 300)             lcd.print(1,1,"Good");             else if (small < 1050)                lcd.print(1,1,"Fair");                else if (small < 3000)                   lcd.print(1,1,"Poor");                   else                      lcd.print(1,1,"Very Poor"); }

Tagi