Remote Industrial VOC Sensor Using Ethernet

We are testing out how much soldering really changes air quality using the MicroMod Ethernet Function board and the MicroMod Environmental Function board!

Favorited Favorite 0

For a while now, I've been curious just how poor the air quality around me gets when I'm soldering. It never really feels like it's that good, and I always try to limit the my time and exposure to the fumes, but it would be interesting to actually gather the numbers.

When the new MicroMod Ethernet Function board came across my desk, I knew it would be ideal for testing out this curiosity (and not just because of the lack of soldering needed to set the project up!). I wanted to use the Ethernet function board with the Environmental Function board and the MicroMod Teensy Processor as it's probably the quickest way to put together this project. The Ethernet adds value to the project because it makes it applicable in an end-use industrial environment. It would be great to monitor the air quality of the soldering station here at SparkFun all day, from my desk, as people come and go to solder. I chose the Teensy Processor board as they've got a really easy Ethernet library to use for this W5500 chip.

SparkFun MicroMod Ethernet Function Board - W5500

SparkFun MicroMod Ethernet Function Board - W5500

COM-18708
$29.95
SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95 $112.46
1
SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$21.50
8

The Hookup

The Hookup is about as simple as it gets! All you need is a screwdriver. However, I will say that when using two function boards like we're doing, it's important to make sure they are fully set in the M.2 connector, and also to tighten all of the screws equally (not move from one to the other).

alt text


The Code The code is also fairly simple, it's just a mixture of creating a web server and sending the VOC levels from the SGP40 to that server.

/*
  Industrial air quality remote sensor

 A simple web server that shows the VOC levels using a Teensy Processor board,
 the MicroMod Ethernet Function board and the MicroMod Environmental Function board. 

 Taken by Paul Clark's SGP40 code and the built in Arduino example for an Ethernet
 web server, thanks to David A. Mellis, Tom Igoe and Arturo Guadalupi

 */

#include <SPI.h>
#include <Ethernet.h>
#include "SparkFun_SGP40_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_SGP40
#include <Wire.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 177);

SGP40 mySensor; //create an object of the SGP40 class

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup() {
  Ethernet.init(10);  // For the Teensy

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Ethernet WebServer Example");

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(1); // do nothing, no point running without Ethernet hardware
    }
  }
  if (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is not connected.");
  }

  // start the server
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());

  Wire.begin();

  if (mySensor.begin() == false)
  {
    Serial.println(F("SGP40 not detected. Check connections. Freezing..."));
    while (1)
      ; // Do nothing more
  }

}


void loop() {
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          clinet.println("VOC Index is");
          client.println("<br />");
          client.println(mySensor.getVOCindex());
          client.println("</html>");
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  }
}

Testing

Okay, time to test it out and see how the air quality changes when we solder! I found that it took a bit of time for the SGP40 to just calibrate to the room's natural VOC level. And there's probably some specific distance that the sensor should sit from the soldering station, but I thought since I sit so close to the fumes, the sensor should be equally close. Turns out, even with the lead free solder, the VOC levels still skyrocketed above the normal VOC numbers.

Project Test

I suppose I'm not surprised; soldering is still introducing new compounds into the air that add to the VOC level. But it was still a good way to build an air quality sensor that can be monitored from anywhere in the building - not just at the soldering station on the serial monitor. And in this case, ethernet was one of the fastest ways to bring this project into the internet space. There are, of course, other ways to build a similar unit, depending on what you have...this could have also been done with a single Ethernet function board and a Qwiic environmental sensor. And of course, there are always ways to make an HTML web server page more spiffy, so that's something to explore too.

My question for you is what other applications might you chose Ethernet over other IoT protocols? When does it serve you best? Comment below, thanks for following along, and happy hacking!


Comments 8 comments

  • s-light / about 3 years ago * / 2

    yeah as Member #134773 already mentioned: next thing: a series of sensor with different distances - to get a better idea how near or fare we have to go :-) or at least it could be a interesting project ;-) also interesting as you need multiple I2C ports - per port are only 2 of the BME680 possible from a quick read at https://www.sparkfun.com/products/16466

    to answer your Ethernet-question: as often as possible - i like the fact that wires behave more predictable... it the cable is long enough its working ;-) and with POE you also have just a power solution... and i know sometimes wireless is just nice and easy too....

    sunny greetings
    stefan

    • xsk8rat / about 3 years ago / 1

      In regards to the wireless preference... i agree. Our production area has very spotty wireless coverage. So i concur the wired preference. And IOT adds a layer of dependence on outside services that recent experience with flooding makes me nervous. We maintained onsite power, but not internet during that excitement. So, wired network to onsite data storage for long term critical monitoring. IoT and wireless for short term or non-critical monitoring. That's probably at odds with other folks.

  • Member #134773 / about 3 years ago / 2

    I think it was a bit ironic that as I was reading this blog post on air quality, the TV was showing video from Ukraine. I dare say that all the munitions flying about there pose a much higher health hazard than the VOCs at any of our soldering stations. My heart certainly goes out to the people there!

    Anyway, although soldering doubtless releases VOCs, I would suspect that they are mostly from the flux, there are other hazards, especially metal vapors and metal compounds, that can fly around. FWIW, I have the habit of going and scrubbing my hands with soap and water immediately when I finish soldering. I also NEVER have any edibles or drinks in the area when soldering. (And I don't smoke, so I don't have to worry about getting cigarettes contaminated.) I don't think that all that makes me OCD! :-)

    It might be interesting to use your project to look at VOCs in the area around the vents from the reflow ovens, and see how quickly (in terms of distance) the numbers fall off.

  • Member #489684 / about 3 years ago / 1

    Not all rosins (colophony) are the same; they are usually sourced from paper makers that use Pine waste as the input components (kraft or toilet paper). The rosins carry other compounds, some of which are considered human irritants, and may cause eczema, hives, heartburn, nausea etc.

    Being March 2022 it must be said that Russian (and Scandi) sourced rosin is 2 to 3 times higher in these irritant compounds (unsaponifiables) than most other Pine species used for paper (elliottii, radiata etc)

  • Member #489684 / about 3 years ago / 1

    After soldering you will see the occasional little balls of solder lying around the workbench (dross), or stuck in the burnt flux on the PCB. Also unseen are much more smaller lead balls and bits of solder in the same place (use a microscope)

    Any physical action that disturbs this dross, will cause it to become airborne or become attached to your hands e.g. cleaning the PCB, moving things around on the workbench, wiping the workbench, using airflow tools by the workbench, handling the PCB

    Consistent daily exposure to dross lead in a workplace is detectable in a blood test. If it's a dangerous level I can’t say, and that depends on the air flow safety systems, masks etc you use

  • Member #1549502 / about 3 years ago / 1

    Solder fumes are from the flux, not from the solder itself. Lead doesn't boil until about 1750 Centigrade, which is beyond the capabilities of any soldering iron. The only health risks of leaded solder are to your hands (which you should wash anyway) and to anyone who is so stupid or infantile that they chew or lick the assembled PCB afterwards.

    Think about the kind of sensor you were using. Lead is not an organic compound, let alone a volatile organic compound.

    • Member #489684 / about 3 years ago / 1

      You do not need to boil something to evaporate it. e.g. liquid water evaporates at room temperature due to the action of air particles constantly bombarding it. This action is increased with more vigorous air movements (wind) and higher liquid temperatures

      Liquid lead does effectively evaporate at a low rate when hot enough to be a liquid. Consistent daily exposure to liquid lead in a workplace is detectable in a blood test. If it's a dangerous level I can’t say, and that depends on the air flow safety systems, masks etc you use

      With soldering specifically, you have rosin (colophony) boiling and burning away at a high activity rate, it will evaporate liquid lead at a very slow rate during this boiling process

      • Member #134773 / about 3 years ago / 1

        I feel I have to respond to this. First, "temperature" is a measure of the average energy of the particles (either atoms or molecules) that make up a system. In some systems, such as a solid metal crystal with a high thermal conductivity, all of the constituant atoms will be at very close to the average value, but for a liquid with a heat source applied, there will be some tiny minority of the atoms with much smaller enerty levels and some tiny minority with much higher levels. Note that even solids "evaporate", though the process is usually referred to as "sublimation". An example of this is freeze-dried food, or in your home freezer, so-called "freezer burn".

        Another issue is that in liquifying the solder, it becomes more prone to reactions with the air, notably oxidation, which is why we add the flux to try to get rid of those reaction products. This could produce VOCs that include metal atoms in their chemistry, which would also be bad. Note, too, that the behavior of the solder becomes problematic when remelted multiple times, suggesting that the composition has shifted.

        Also, don't forget that lead isn't the only metal in the solder. Solder is an alloy.

        Please don't get the idea that I'm against soldering. I've been doing it for nearly 60 years. I just urge people to be very careful about it.

Related Posts

Recent Posts

Tags


All Tags