Legacy RS232 to WIFI adapter / Air Quality Cell Phone App

Legacy RS232 to WIFI adapter / Air Quality Cell Phone App

prusaprinters

<p>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).</p><p>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.</p><p>The project parts:</p><ul><li>Dylos Air Quality Monitor ( <a href="https://amzn.to/2V8Uy0W">https://amzn.to/2V8Uy0W</a> )</li><li>RS232 to TTL Converter ( <a href="https://amzn.to/376AdyM">https://amzn.to/376AdyM</a> )</li><li>5V Micro USB Power Adapter ( <a href="https://amzn.to/3pZ3MLn">https://amzn.to/3pZ3MLn</a> )</li><li>Particle Photon ( <a href="https://www.sparkfun.com/products/13774">https://www.sparkfun.com/products/13774</a> )</li><li>DB9 Null Modem ( <a href="https://amzn.to/3fF0yIf">https://amzn.to/3fF0yIf</a> )</li><li>Jumper wires ( <a href="https://amzn.to/37e4trs">https://amzn.to/37e4trs</a> )</li><li>PETG Transparent filament ( <a href="https://shop.prusa3d.com/en/prusament/1216-prusament-petg-clear-1kg.html">https://shop.prusa3d.com/en/prusament/1216-prusament-petg-clear-1kg.html</a> )</li></ul><p>As an Amazon Associate I earn from qualifying purchases.</p><figure class="media"><oembed url="https://youtu.be/Vn33wZlQlN4"></oembed></figure><p>Particle code:</p><p>/* &nbsp; Program by Christopher Nafis &nbsp; Written November 2020 &nbsp; Reads data from the Dylos DC1100 with PC Interface &nbsp; Send the data to a Blynk application or to IFTTT &nbsp; The DC1100 is a true Laser Particle Counter with 2 size ranges - small (&gt;1 micron bacteria, mold, etc) large (&gt;5 micron pollen, etc.) */ #include #define BLYNK_PRINT Serial &nbsp;// 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() { &nbsp; &nbsp;Serial.begin(9600); &nbsp; &nbsp;Serial1.begin(9600); &nbsp; &nbsp;delay(5000); // Allow board to settle &nbsp; &nbsp;Particle.variable("small", small); &nbsp; &nbsp;Particle.variable("large", large); &nbsp; &nbsp;Blynk.begin(auth); } void loop() { &nbsp; &nbsp;// Read data from serial &nbsp; &nbsp;while(Serial1.available()) { &nbsp; &nbsp; &nbsp; &nbsp;if (readBufOffset &lt; READ_BUF_SIZE) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char c = Serial1.read(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (c != '\n') { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Add character to buffer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;readBuf[readBufOffset++] = c; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// End of line character found, process line &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;readBuf[readBufOffset] = 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;processBuffer(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;readBufOffset = 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp;else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Serial.println("readBuf overflow, emptying buffer"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;readBufOffset = 0; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp;} &nbsp; &nbsp;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() { &nbsp; &nbsp;sscanf(readBuf,"%d,%d",&amp;small,&amp;large); &nbsp;// units are average particles/100 per cubic foot &nbsp; &nbsp;Serial.print(small); &nbsp; &nbsp;Serial.print(' '); &nbsp; &nbsp;Serial.println(large); &nbsp; &nbsp;Blynk.virtualWrite(V0, small*100); &nbsp; &nbsp;Blynk.virtualWrite(V1, large*100); &nbsp; &nbsp;// The Dylos has a "rule of thumb" charts on the back of the sensor &nbsp; &nbsp;lcd.clear(); &nbsp; &nbsp;lcd.print(1,0,"Air Quality is:"); &nbsp; &nbsp;if (small &lt; 75) &nbsp; &nbsp; &nbsp; lcd.print(1,1,"Excellent"); &nbsp; &nbsp; &nbsp; else if (small &lt; 150) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcd.print(1,1,"Very Good"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (small &lt; 300) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lcd.print(1,1,"Good"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (small &lt; 1050) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcd.print(1,1,"Fair"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (small &lt; 3000) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lcd.print(1,1,"Poor"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcd.print(1,1,"Very Poor"); }</p>

Download Model from prusaprinters

With this file you will be able to print Legacy RS232 to WIFI adapter / Air Quality Cell Phone App with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Legacy RS232 to WIFI adapter / Air Quality Cell Phone App.